Class: AWSCDK::ECS::FargateTaskDefinition

Inherits:
TaskDefinition
  • Object
show all
Includes:
IFargateTaskDefinition
Defined in:
ecs/fargate_task_definition.rb

Overview

The details of a task definition run on a Fargate cluster.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props = nil) ⇒ FargateTaskDefinition

Constructs a new instance of the FargateTaskDefinition class.

Parameters:



14
15
16
17
18
19
20
# File 'ecs/fargate_task_definition.rb', line 14

def initialize(scope, id, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::ECS::FargateTaskDefinitionProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkZhcmdhdGVUYXNrRGVmaW5pdGlvblByb3BzIn0=")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.from_fargate_task_definition_arn(scope, id, fargate_task_definition_arn) ⇒ AWSCDK::ECS::IFargateTaskDefinition

Imports a task definition from the specified task definition ARN.

Parameters:

  • scope (Constructs::Construct)
  • id (String)
  • fargate_task_definition_arn (String)

Returns:



75
76
77
78
79
80
# File 'ecs/fargate_task_definition.rb', line 75

def self.from_fargate_task_definition_arn(scope, id, fargate_task_definition_arn)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(fargate_task_definition_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "fargateTaskDefinitionArn")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ecs.FargateTaskDefinition", "fromFargateTaskDefinitionArn", [scope, id, fargate_task_definition_arn])
end

.from_fargate_task_definition_attributes(scope, id, attrs) ⇒ AWSCDK::ECS::IFargateTaskDefinition

Import an existing Fargate task definition from its attributes.

Parameters:

Returns:



88
89
90
91
92
93
94
# File 'ecs/fargate_task_definition.rb', line 88

def self.from_fargate_task_definition_attributes(scope, id, attrs)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  attrs = attrs.is_a?(Hash) ? ::AWSCDK::ECS::FargateTaskDefinitionAttributes.new(**attrs.transform_keys(&:to_sym)) : attrs
  Jsii::Type.check_type(attrs, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkZhcmdhdGVUYXNrRGVmaW5pdGlvbkF0dHJpYnV0ZXMifQ==")), "attrs")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ecs.FargateTaskDefinition", "fromFargateTaskDefinitionAttributes", [scope, id, attrs])
end

.jsii_overridable_methodsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'ecs/fargate_task_definition.rb', line 22

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :physical_name => { kind: :property, name: "physicalName", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :compatibility => { kind: :property, name: "compatibility", is_optional: false },
    :containers => { kind: :property, name: "containers", is_optional: false },
    :family => { kind: :property, name: "family", is_optional: false },
    :inference_accelerators => { kind: :property, name: "inferenceAccelerators", 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_definition_ref => { kind: :property, name: "taskDefinitionRef", is_optional: false },
    :task_role => { kind: :property, name: "taskRole", is_optional: false },
    :ephemeral_storage_gib => { kind: :property, name: "ephemeralStorageGiB", is_optional: true },
    :execution_role => { kind: :property, name: "executionRole", is_optional: true },
    :pid_mode => { kind: :property, name: "pidMode", is_optional: true },
    :references_secret_json_field => { kind: :property, name: "referencesSecretJsonField", is_optional: true },
    :default_container => { kind: :property, name: "defaultContainer", is_optional: true },
    :cpu => { kind: :property, name: "cpu", is_optional: false },
    :memory_mib => { kind: :property, name: "memoryMiB", is_optional: false },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_cross_stack_reference_strength => { kind: :method, name: "applyCrossStackReferenceStrength", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :generate_physical_name => { kind: :method, name: "generatePhysicalName", is_optional: false },
    :get_resource_arn_attribute => { kind: :method, name: "getResourceArnAttribute", is_optional: false },
    :get_resource_name_attribute => { kind: :method, name: "getResourceNameAttribute", is_optional: false },
    :add_container => { kind: :method, name: "addContainer", is_optional: false },
    :add_extension => { kind: :method, name: "addExtension", is_optional: false },
    :add_firelens_log_router => { kind: :method, name: "addFirelensLogRouter", is_optional: false },
    :add_inference_accelerator => { kind: :method, name: "addInferenceAccelerator", is_optional: false },
    :add_placement_constraint => { kind: :method, name: "addPlacementConstraint", is_optional: false },
    :add_to_execution_role_policy => { kind: :method, name: "addToExecutionRolePolicy", is_optional: false },
    :add_to_task_role_policy => { kind: :method, name: "addToTaskRolePolicy", is_optional: false },
    :add_volume => { kind: :method, name: "addVolume", is_optional: false },
    :find_container => { kind: :method, name: "findContainer", is_optional: false },
    :find_port_mapping_by_name => { kind: :method, name: "findPortMappingByName", is_optional: false },
    :grant_run => { kind: :method, name: "grantRun", is_optional: false },
    :obtain_execution_role => { kind: :method, name: "obtainExecutionRole", is_optional: false },
  }
end

.PROPERTY_INJECTION_IDString

Uniquely identifies this class.

Returns:

  • (String)


142
143
144
# File 'ecs/fargate_task_definition.rb', line 142

def self.PROPERTY_INJECTION_ID()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ecs.FargateTaskDefinition", "PROPERTY_INJECTION_ID")
end

Instance Method Details

#add_container(id, props) ⇒ AWSCDK::ECS::ContainerDefinition

Adds a new container to the task definition.



393
394
395
396
397
398
# File 'ecs/fargate_task_definition.rb', line 393

def add_container(id, props)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ECS::ContainerDefinitionOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNvbnRhaW5lckRlZmluaXRpb25PcHRpb25zIn0=")), "props")
  jsii_call_method("addContainer", [id, props])
end

#add_extension(extension) ⇒ void

This method returns an undefined value.

Adds the specified extension to the task definition.

Extension can be used to apply a packaged modification to a task definition.

Parameters:



407
408
409
410
# File 'ecs/fargate_task_definition.rb', line 407

def add_extension(extension)
  Jsii::Type.check_type(extension, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLklUYXNrRGVmaW5pdGlvbkV4dGVuc2lvbiJ9")), "extension")
  jsii_call_method("addExtension", [extension])
end

#add_firelens_log_router(id, props) ⇒ AWSCDK::ECS::FirelensLogRouter

Adds a firelens log router to the task definition.



417
418
419
420
421
422
# File 'ecs/fargate_task_definition.rb', line 417

def add_firelens_log_router(id, props)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ECS::FirelensLogRouterDefinitionOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkZpcmVsZW5zTG9nUm91dGVyRGVmaW5pdGlvbk9wdGlvbnMifQ==")), "props")
  jsii_call_method("addFirelensLogRouter", [id, props])
end

#add_inference_accelerator(inference_accelerator) ⇒ void

Deprecated.

ECS TaskDefinition's inferenceAccelerator is EOL since April 2024

This method returns an undefined value.

Adds an inference accelerator to the task definition.

Parameters:



429
430
431
432
433
# File 'ecs/fargate_task_definition.rb', line 429

def add_inference_accelerator(inference_accelerator)
  inference_accelerator = inference_accelerator.is_a?(Hash) ? ::AWSCDK::ECS::InferenceAccelerator.new(**inference_accelerator.transform_keys(&:to_sym)) : inference_accelerator
  Jsii::Type.check_type(inference_accelerator, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkluZmVyZW5jZUFjY2VsZXJhdG9yIn0=")), "inferenceAccelerator")
  jsii_call_method("addInferenceAccelerator", [inference_accelerator])
end

#add_placement_constraint(constraint) ⇒ void

This method returns an undefined value.

Adds the specified placement constraint to the task definition.

Parameters:



439
440
441
442
# File 'ecs/fargate_task_definition.rb', line 439

def add_placement_constraint(constraint)
  Jsii::Type.check_type(constraint, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlBsYWNlbWVudENvbnN0cmFpbnQifQ==")), "constraint")
  jsii_call_method("addPlacementConstraint", [constraint])
end

#add_to_execution_role_policy(statement) ⇒ void

This method returns an undefined value.

Adds a policy statement to the task execution IAM role.

Parameters:



448
449
450
451
# File 'ecs/fargate_task_definition.rb', line 448

def add_to_execution_role_policy(statement)
  Jsii::Type.check_type(statement, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeVN0YXRlbWVudCJ9")), "statement")
  jsii_call_method("addToExecutionRolePolicy", [statement])
end

#add_to_task_role_policy(statement) ⇒ void

This method returns an undefined value.

Adds a policy statement to the task IAM role.

Parameters:



457
458
459
460
# File 'ecs/fargate_task_definition.rb', line 457

def add_to_task_role_policy(statement)
  Jsii::Type.check_type(statement, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeVN0YXRlbWVudCJ9")), "statement")
  jsii_call_method("addToTaskRolePolicy", [statement])
end

#add_volume(volume) ⇒ void

This method returns an undefined value.

Adds a volume to the task definition.

Parameters:



466
467
468
469
470
# File 'ecs/fargate_task_definition.rb', line 466

def add_volume(volume)
  volume = volume.is_a?(Hash) ? ::AWSCDK::ECS::Volume.new(**volume.transform_keys(&:to_sym)) : volume
  Jsii::Type.check_type(volume, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlZvbHVtZSJ9")), "volume")
  jsii_call_method("addVolume", [volume])
end

#apply_cross_stack_reference_strength(strength) ⇒ void

This method returns an undefined value.

Override the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters:



331
332
333
334
# File 'ecs/fargate_task_definition.rb', line 331

def apply_cross_stack_reference_strength(strength)
  Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength")
  jsii_call_method("applyCrossStackReferenceStrength", [strength])
end

#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:



348
349
350
351
# File 'ecs/fargate_task_definition.rb', line 348

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

The task launch type compatibility requirement.



149
150
151
# File 'ecs/fargate_task_definition.rb', line 149

def compatibility()
  jsii_get_property("compatibility")
end

#containersArray<AWSCDK::ECS::ContainerDefinition>

The container definitions.



156
157
158
# File 'ecs/fargate_task_definition.rb', line 156

def containers()
  jsii_get_property("containers")
end

#cpuNumeric

The number of cpu units used by the task.

Returns:

  • (Numeric)


287
288
289
# File 'ecs/fargate_task_definition.rb', line 287

def cpu()
  jsii_get_property("cpu")
end

#default_containerAWSCDK::ECS::ContainerDefinition?

Default container for this task.

Load balancers will send traffic to this container. The first essential container that is added to this task will become the default container.



275
276
277
# File 'ecs/fargate_task_definition.rb', line 275

def default_container()
  jsii_get_property("defaultContainer")
end

#default_container=(value) ⇒ Object



279
280
281
282
# File 'ecs/fargate_task_definition.rb', line 279

def default_container=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNvbnRhaW5lckRlZmluaXRpb24ifQ==")), "defaultContainer") unless value.nil?
  jsii_set_property("defaultContainer", value)
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.



114
115
116
# File 'ecs/fargate_task_definition.rb', line 114

def env()
  jsii_get_property("env")
end

#ephemeral_storage_gibNumeric?

The amount (in GiB) of ephemeral storage to be allocated to the task.

Returns:

  • (Numeric, nil)


237
238
239
# File 'ecs/fargate_task_definition.rb', line 237

def ephemeral_storage_gib()
  jsii_get_property("ephemeralStorageGiB")
end

#execution_roleAWSCDK::IAM::IRole?

Execution role for this task definition.

Returns:



244
245
246
# File 'ecs/fargate_task_definition.rb', line 244

def execution_role()
  jsii_get_property("executionRole")
end

#familyString

The name of a family that this task definition is registered to.

A family groups multiple versions of a task definition.

Returns:

  • (String)


165
166
167
# File 'ecs/fargate_task_definition.rb', line 165

def family()
  jsii_get_property("family")
end

#find_container(container_name) ⇒ AWSCDK::ECS::ContainerDefinition?

Returns the container that match the provided containerName.

Parameters:

  • container_name (String)

Returns:



476
477
478
479
# File 'ecs/fargate_task_definition.rb', line 476

def find_container(container_name)
  Jsii::Type.check_type(container_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerName")
  jsii_call_method("findContainer", [container_name])
end

#find_port_mapping_by_name(name) ⇒ AWSCDK::ECS::PortMapping?

Determine the existing port mapping for the provided name.

Parameters:

  • name (String)

    : port mapping name.

Returns:



485
486
487
488
# File 'ecs/fargate_task_definition.rb', line 485

def find_port_mapping_by_name(name)
  Jsii::Type.check_type(name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  jsii_call_method("findPortMappingByName", [name])
end

#generate_physical_nameString

Returns:

  • (String)


354
355
356
# File 'ecs/fargate_task_definition.rb', line 354

def generate_physical_name()
  jsii_call_method("generatePhysicalName", [])
end

#get_resource_arn_attribute(arn_attr, arn_components) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arn_attr, but if the resource is referenced across environments, arn_components will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arn_components.

Parameters:

  • arn_attr (String)

    The CFN attribute which resolves to the ARN of the resource.

  • arn_components (AWSCDK::ARNComponents)

    The format of the ARN of this resource.

Returns:

  • (String)


368
369
370
371
372
373
# File 'ecs/fargate_task_definition.rb', line 368

def get_resource_arn_attribute(arn_attr, arn_components)
  Jsii::Type.check_type(arn_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arnAttr")
  arn_components = arn_components.is_a?(Hash) ? ::AWSCDK::ARNComponents.new(**arn_components.transform_keys(&:to_sym)) : arn_components
  Jsii::Type.check_type(arn_components, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bcm5Db21wb25lbnRzIn0=")), "arnComponents")
  jsii_call_method("getResourceArnAttribute", [arn_attr, arn_components])
end

#get_resource_name_attribute(name_attr) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to name_attr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

Parameters:

  • name_attr (String)

    The CFN attribute which resolves to the resource's name.

Returns:

  • (String)


383
384
385
386
# File 'ecs/fargate_task_definition.rb', line 383

def get_resource_name_attribute(name_attr)
  Jsii::Type.check_type(name_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nameAttr")
  jsii_call_method("getResourceNameAttribute", [name_attr])
end

#grant_run(grantee) ⇒ AWSCDK::IAM::Grant

Grants permissions to run this task definition.

This will grant the following permissions:

  • ecs:RunTask
  • iam:PassRole

[disable-awslint:no-grants]

Parameters:

Returns:



501
502
503
504
# File 'ecs/fargate_task_definition.rb', line 501

def grant_run(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantRun", [grantee])
end

#inference_acceleratorsArray<AWSCDK::ECS::InferenceAccelerator>

Public getter method to access list of inference accelerators attached to the instance.



172
173
174
# File 'ecs/fargate_task_definition.rb', line 172

def inference_accelerators()
  jsii_get_property("inferenceAccelerators")
end

#is_ec2_compatibleBoolean

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

Returns:

  • (Boolean)


179
180
181
# File 'ecs/fargate_task_definition.rb', line 179

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)


186
187
188
# File 'ecs/fargate_task_definition.rb', line 186

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)


193
194
195
# File 'ecs/fargate_task_definition.rb', line 193

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)


200
201
202
# File 'ecs/fargate_task_definition.rb', line 200

def is_managed_instances_compatible()
  jsii_get_property("isManagedInstancesCompatible")
end

#memory_mibNumeric

The amount (in MiB) of memory used by the task.

Returns:

  • (Numeric)


294
295
296
# File 'ecs/fargate_task_definition.rb', line 294

def memory_mib()
  jsii_get_property("memoryMiB")
end

#network_modeAWSCDK::ECS::NetworkMode

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

Fargate tasks require the awsvpc network mode.



209
210
211
# File 'ecs/fargate_task_definition.rb', line 209

def network_mode()
  jsii_get_property("networkMode")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


99
100
101
# File 'ecs/fargate_task_definition.rb', line 99

def node()
  jsii_get_property("node")
end

#obtain_execution_roleAWSCDK::IAM::IRole

Creates the task execution IAM role if it doesn't already exist.

Returns:



509
510
511
# File 'ecs/fargate_task_definition.rb', line 509

def obtain_execution_role()
  jsii_call_method("obtainExecutionRole", [])
end

#physical_nameString

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

Returns:

  • (String)


128
129
130
# File 'ecs/fargate_task_definition.rb', line 128

def physical_name()
  jsii_get_property("physicalName")
end

#pid_modeAWSCDK::ECS::PidMode?

The process namespace to use for the containers in the task.

Only supported for tasks that are hosted on AWS Fargate if the tasks are using platform version 1.4.0 or later (Linux). Not supported in Windows containers. If pidMode is specified for a Fargate task, then runtimePlatform.operatingSystemFamily must also be specified. For more information, see Task Definition Parameters.

Returns:



257
258
259
# File 'ecs/fargate_task_definition.rb', line 257

def pid_mode()
  jsii_get_property("pidMode")
end

#references_secret_json_fieldBoolean?

Whether this task definition has at least a container that references a specific JSON field of a secret stored in Secrets Manager.

Returns:

  • (Boolean, nil)


264
265
266
# File 'ecs/fargate_task_definition.rb', line 264

def references_secret_json_field()
  jsii_get_property("referencesSecretJsonField")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



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

def stack()
  jsii_get_property("stack")
end

#task_definition_arnString

The full Amazon Resource Name (ARN) of the task definition.

Returns:

  • (String)


216
217
218
# File 'ecs/fargate_task_definition.rb', line 216

def task_definition_arn()
  jsii_get_property("taskDefinitionArn")
end

#task_definition_refAWSCDK::Interfaces::AWSECS::TaskDefinitionReference

A reference to this task definition.



223
224
225
# File 'ecs/fargate_task_definition.rb', line 223

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:



230
231
232
# File 'ecs/fargate_task_definition.rb', line 230

def task_role()
  jsii_get_property("taskRole")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


301
302
303
# File 'ecs/fargate_task_definition.rb', line 301

def to_string()
  jsii_call_method("toString", [])
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. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

Returns:

  • (Constructs::IConstruct)


314
315
316
317
318
319
# File 'ecs/fargate_task_definition.rb', line 314

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