Module: AWSCDK::ECS::ITaskDefinition

Includes:
IResource, Interfaces::AWSECS::ITaskDefinitionRef
Included in:
IEC2TaskDefinition, IExternalTaskDefinition, IFargateTaskDefinition, TaskDefinition
Defined in:
ecs/i_task_definition.rb

Overview

The interface for all task definitions.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'ecs/i_task_definition.rb', line 139

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :task_definition_ref => { kind: :property, name: "taskDefinitionRef", is_optional: false },
    :compatibility => { kind: :property, name: "compatibility", is_optional: false },
    :is_ec2_compatible => { kind: :property, name: "isEc2Compatible", is_optional: false },
    :is_external_compatible => { kind: :property, name: "isExternalCompatible", is_optional: false },
    :is_fargate_compatible => { kind: :property, name: "isFargateCompatible", is_optional: false },
    :is_managed_instances_compatible => { kind: :property, name: "isManagedInstancesCompatible", is_optional: false },
    :network_mode => { kind: :property, name: "networkMode", is_optional: false },
    :task_definition_arn => { kind: :property, name: "taskDefinitionArn", is_optional: false },
    :task_role => { kind: :property, name: "taskRole", is_optional: false },
    :execution_role => { kind: :property, name: "executionRole", is_optional: true },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
  }
end

Instance Method Details

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:



134
135
136
137
# File 'ecs/i_task_definition.rb', line 134

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#compatibilityAWSCDK::ECS::Compatibility

What launch types this task definition should be compatible with.



48
49
50
# File 'ecs/i_task_definition.rb', line 48

def compatibility()
  jsii_get_property("compatibility")
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



27
28
29
# File 'ecs/i_task_definition.rb', line 27

def env()
  jsii_get_property("env")
end

#execution_roleAWSCDK::IAM::IRole?

Execution role for this task definition.

Returns:



104
105
106
# File 'ecs/i_task_definition.rb', line 104

def execution_role()
  jsii_get_property("executionRole")
end

#is_ec2_compatibleBoolean

Return true if the task definition can be run on an EC2 cluster.

Returns:

  • (Boolean)


55
56
57
# File 'ecs/i_task_definition.rb', line 55

def is_ec2_compatible()
  jsii_get_property("isEc2Compatible")
end

#is_external_compatibleBoolean

Return true if the task definition can be run on a ECS Anywhere cluster.

Returns:

  • (Boolean)


62
63
64
# File 'ecs/i_task_definition.rb', line 62

def is_external_compatible()
  jsii_get_property("isExternalCompatible")
end

#is_fargate_compatibleBoolean

Return true if the task definition can be run on a Fargate cluster.

Returns:

  • (Boolean)


69
70
71
# File 'ecs/i_task_definition.rb', line 69

def is_fargate_compatible()
  jsii_get_property("isFargateCompatible")
end

#is_managed_instances_compatibleBoolean

Return true if the task definition can be run on Managed Instances.

Returns:

  • (Boolean)


76
77
78
# File 'ecs/i_task_definition.rb', line 76

def is_managed_instances_compatible()
  jsii_get_property("isManagedInstancesCompatible")
end

#network_modeAWSCDK::ECS::NetworkMode

The networking mode to use for the containers in the task.



83
84
85
# File 'ecs/i_task_definition.rb', line 83

def network_mode()
  jsii_get_property("networkMode")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


12
13
14
# File 'ecs/i_task_definition.rb', line 12

def node()
  jsii_get_property("node")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



34
35
36
# File 'ecs/i_task_definition.rb', line 34

def stack()
  jsii_get_property("stack")
end

#task_definition_arnString

ARN of this task definition.

Returns:

  • (String)


90
91
92
# File 'ecs/i_task_definition.rb', line 90

def task_definition_arn()
  jsii_get_property("taskDefinitionArn")
end

#task_definition_refAWSCDK::Interfaces::AWSECS::TaskDefinitionReference

A reference to a TaskDefinition resource.



41
42
43
# File 'ecs/i_task_definition.rb', line 41

def task_definition_ref()
  jsii_get_property("taskDefinitionRef")
end

#task_roleAWSCDK::IAM::IRole

The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.

Returns:



97
98
99
# File 'ecs/i_task_definition.rb', line 97

def task_role()
  jsii_get_property("taskRole")
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



115
116
117
118
119
120
# File 'ecs/i_task_definition.rb', line 115

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end