Class: AWSCDK::ECS::FargateTaskDefinition
- Inherits:
-
TaskDefinition
- Object
- TaskDefinition
- AWSCDK::ECS::FargateTaskDefinition
- 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
-
.from_fargate_task_definition_arn(scope, id, fargate_task_definition_arn) ⇒ AWSCDK::ECS::IFargateTaskDefinition
Imports a task definition from the specified task definition ARN.
-
.from_fargate_task_definition_attributes(scope, id, attrs) ⇒ AWSCDK::ECS::IFargateTaskDefinition
Import an existing Fargate task definition from its attributes.
- .jsii_overridable_methods ⇒ Object
-
.PROPERTY_INJECTION_ID ⇒ String
Uniquely identifies this class.
Instance Method Summary collapse
-
#add_container(id, props) ⇒ AWSCDK::ECS::ContainerDefinition
Adds a new container to the task definition.
-
#add_extension(extension) ⇒ void
Adds the specified extension to the task definition.
-
#add_firelens_log_router(id, props) ⇒ AWSCDK::ECS::FirelensLogRouter
Adds a firelens log router to the task definition.
-
#add_inference_accelerator(inference_accelerator) ⇒ void
deprecated
Deprecated.
ECS TaskDefinition's inferenceAccelerator is EOL since April 2024
-
#add_placement_constraint(constraint) ⇒ void
Adds the specified placement constraint to the task definition.
-
#add_to_execution_role_policy(statement) ⇒ void
Adds a policy statement to the task execution IAM role.
-
#add_to_task_role_policy(statement) ⇒ void
Adds a policy statement to the task IAM role.
-
#add_volume(volume) ⇒ void
Adds a volume to the task definition.
-
#apply_cross_stack_reference_strength(strength) ⇒ void
Override the cross-stack reference strength for this resource.
-
#apply_removal_policy(policy) ⇒ void
Apply the given removal policy to this resource.
-
#compatibility ⇒ AWSCDK::ECS::Compatibility
The task launch type compatibility requirement.
-
#containers ⇒ Array<AWSCDK::ECS::ContainerDefinition>
The container definitions.
-
#cpu ⇒ Numeric
The number of cpu units used by the task.
-
#default_container ⇒ AWSCDK::ECS::ContainerDefinition?
Default container for this task.
- #default_container=(value) ⇒ Object
-
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
-
#ephemeral_storage_gib ⇒ Numeric?
The amount (in GiB) of ephemeral storage to be allocated to the task.
-
#execution_role ⇒ AWSCDK::IAM::IRole?
Execution role for this task definition.
-
#family ⇒ String
The name of a family that this task definition is registered to.
-
#find_container(container_name) ⇒ AWSCDK::ECS::ContainerDefinition?
Returns the container that match the provided containerName.
-
#find_port_mapping_by_name(name) ⇒ AWSCDK::ECS::PortMapping?
Determine the existing port mapping for the provided name.
- #generate_physical_name ⇒ String
-
#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). -
#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). -
#grant_run(grantee) ⇒ AWSCDK::IAM::Grant
Grants permissions to run this task definition.
-
#inference_accelerators ⇒ Array<AWSCDK::ECS::InferenceAccelerator>
Public getter method to access list of inference accelerators attached to the instance.
-
#initialize(scope, id, props = nil) ⇒ FargateTaskDefinition
constructor
Constructs a new instance of the FargateTaskDefinition class.
-
#is_ec2_compatible ⇒ Boolean
Return true if the task definition can be run on an EC2 cluster.
-
#is_external_compatible ⇒ Boolean
Return true if the task definition can be run on a ECS anywhere cluster.
-
#is_fargate_compatible ⇒ Boolean
Return true if the task definition can be run on a Fargate cluster.
-
#is_managed_instances_compatible ⇒ Boolean
Return true if the task definition can be run on Managed Instances.
-
#memory_mib ⇒ Numeric
The amount (in MiB) of memory used by the task.
-
#network_mode ⇒ AWSCDK::ECS::NetworkMode
The Docker networking mode to use for the containers in the task.
-
#node ⇒ Constructs::Node
The tree node.
-
#obtain_execution_role ⇒ AWSCDK::IAM::IRole
Creates the task execution IAM role if it doesn't already exist.
-
#physical_name ⇒ String
Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
-
#pid_mode ⇒ AWSCDK::ECS::PidMode?
The process namespace to use for the containers in the task.
-
#references_secret_json_field ⇒ Boolean?
Whether this task definition has at least a container that references a specific JSON field of a secret stored in Secrets Manager.
-
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
-
#task_definition_arn ⇒ String
The full Amazon Resource Name (ARN) of the task definition.
-
#task_definition_ref ⇒ AWSCDK::Interfaces::AWSECS::TaskDefinitionReference
A reference to this task definition.
-
#task_role ⇒ AWSCDK::IAM::IRole
The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props = nil) ⇒ FargateTaskDefinition
Constructs a new instance of the FargateTaskDefinition class.
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.
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.
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_methods ⇒ Object
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_ID ⇒ String
Uniquely identifies this class.
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.
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
ECS TaskDefinition's inferenceAccelerator is EOL since April 2024
This method returns an undefined value.
Adds an inference accelerator to the task definition.
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.
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.
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.
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.
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.
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).
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 |
#compatibility ⇒ AWSCDK::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 |
#containers ⇒ Array<AWSCDK::ECS::ContainerDefinition>
The container definitions.
156 157 158 |
# File 'ecs/fargate_task_definition.rb', line 156 def containers() jsii_get_property("containers") end |
#cpu ⇒ Numeric
The number of cpu units used by the task.
287 288 289 |
# File 'ecs/fargate_task_definition.rb', line 287 def cpu() jsii_get_property("cpu") end |
#default_container ⇒ AWSCDK::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 |
#env ⇒ AWSCDK::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_gib ⇒ Numeric?
The amount (in GiB) of ephemeral storage to be allocated to the task.
237 238 239 |
# File 'ecs/fargate_task_definition.rb', line 237 def ephemeral_storage_gib() jsii_get_property("ephemeralStorageGiB") end |
#execution_role ⇒ AWSCDK::IAM::IRole?
Execution role for this task definition.
244 245 246 |
# File 'ecs/fargate_task_definition.rb', line 244 def execution_role() jsii_get_property("executionRole") end |
#family ⇒ String
The name of a family that this task definition is registered to.
A family groups multiple versions of a task definition.
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.
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.
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_name ⇒ 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.
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.
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]
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_accelerators ⇒ Array<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_compatible ⇒ Boolean
Return true if the task definition can be run on an EC2 cluster.
179 180 181 |
# File 'ecs/fargate_task_definition.rb', line 179 def is_ec2_compatible() jsii_get_property("isEc2Compatible") end |
#is_external_compatible ⇒ Boolean
Return true if the task definition can be run on a ECS anywhere cluster.
186 187 188 |
# File 'ecs/fargate_task_definition.rb', line 186 def is_external_compatible() jsii_get_property("isExternalCompatible") end |
#is_fargate_compatible ⇒ Boolean
Return true if the task definition can be run on a Fargate cluster.
193 194 195 |
# File 'ecs/fargate_task_definition.rb', line 193 def is_fargate_compatible() jsii_get_property("isFargateCompatible") end |
#is_managed_instances_compatible ⇒ Boolean
Return true if the task definition can be run on Managed Instances.
200 201 202 |
# File 'ecs/fargate_task_definition.rb', line 200 def is_managed_instances_compatible() jsii_get_property("isManagedInstancesCompatible") end |
#memory_mib ⇒ Numeric
The amount (in MiB) of memory used by the task.
294 295 296 |
# File 'ecs/fargate_task_definition.rb', line 294 def memory_mib() jsii_get_property("memoryMiB") end |
#network_mode ⇒ AWSCDK::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 |
#node ⇒ Constructs::Node
The tree node.
99 100 101 |
# File 'ecs/fargate_task_definition.rb', line 99 def node() jsii_get_property("node") end |
#obtain_execution_role ⇒ AWSCDK::IAM::IRole
Creates the task execution IAM role if it doesn't already exist.
509 510 511 |
# File 'ecs/fargate_task_definition.rb', line 509 def obtain_execution_role() jsii_call_method("obtainExecutionRole", []) end |
#physical_name ⇒ String
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.
128 129 130 |
# File 'ecs/fargate_task_definition.rb', line 128 def physical_name() jsii_get_property("physicalName") end |
#pid_mode ⇒ AWSCDK::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.
257 258 259 |
# File 'ecs/fargate_task_definition.rb', line 257 def pid_mode() jsii_get_property("pidMode") end |
#references_secret_json_field ⇒ Boolean?
Whether this task definition has at least a container that references a specific JSON field of a secret stored in Secrets Manager.
264 265 266 |
# File 'ecs/fargate_task_definition.rb', line 264 def references_secret_json_field() jsii_get_property("referencesSecretJsonField") end |
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
135 136 137 |
# File 'ecs/fargate_task_definition.rb', line 135 def stack() jsii_get_property("stack") end |
#task_definition_arn ⇒ String
The full Amazon Resource Name (ARN) of the task definition.
216 217 218 |
# File 'ecs/fargate_task_definition.rb', line 216 def task_definition_arn() jsii_get_property("taskDefinitionArn") end |
#task_definition_ref ⇒ AWSCDK::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_role ⇒ AWSCDK::IAM::IRole
The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.
230 231 232 |
# File 'ecs/fargate_task_definition.rb', line 230 def task_role() jsii_get_property("taskRole") end |
#to_string ⇒ String
Returns a string representation of this construct.
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.
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 |