Class: AWSCDK::ECS::TaskDefinitionAttributes
- Inherits:
-
CommonTaskDefinitionAttributes
- Object
- CommonTaskDefinitionAttributes
- AWSCDK::ECS::TaskDefinitionAttributes
- Defined in:
- ecs/task_definition_attributes.rb
Overview
A reference to an existing task definition.
Instance Attribute Summary collapse
-
#compatibility ⇒ AWSCDK::ECS::Compatibility?
readonly
What launch types this task definition should be compatible with.
-
#execution_role ⇒ AWSCDK::IAM::IRole?
readonly
The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf.
-
#network_mode ⇒ AWSCDK::ECS::NetworkMode?
readonly
The networking mode to use for the containers in the task.
-
#task_definition_arn ⇒ String
readonly
The arn of the task definition.
-
#task_role ⇒ AWSCDK::IAM::IRole?
readonly
The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(task_definition_arn:, execution_role: nil, network_mode: nil, task_role: nil, compatibility: nil) ⇒ TaskDefinitionAttributes
constructor
A new instance of TaskDefinitionAttributes.
- #to_jsii ⇒ Object
Constructor Details
#initialize(task_definition_arn:, execution_role: nil, network_mode: nil, task_role: nil, compatibility: nil) ⇒ TaskDefinitionAttributes
Returns a new instance of TaskDefinitionAttributes.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'ecs/task_definition_attributes.rb', line 12 def initialize(task_definition_arn:, execution_role: nil, network_mode: nil, task_role: nil, compatibility: nil) @task_definition_arn = task_definition_arn Jsii::Type.check_type(@task_definition_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "taskDefinitionArn") @execution_role = execution_role Jsii::Type.check_type(@execution_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "executionRole") unless @execution_role.nil? @network_mode = network_mode Jsii::Type.check_type(@network_mode, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLk5ldHdvcmtNb2RlIn0=")), "networkMode") unless @network_mode.nil? @task_role = task_role Jsii::Type.check_type(@task_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "taskRole") unless @task_role.nil? @compatibility = compatibility Jsii::Type.check_type(@compatibility, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNvbXBhdGliaWxpdHkifQ==")), "compatibility") unless @compatibility.nil? end |
Instance Attribute Details
#compatibility ⇒ AWSCDK::ECS::Compatibility? (readonly)
Default: Compatibility.EC2_AND_FARGATE
What launch types this task definition should be compatible with.
50 51 52 |
# File 'ecs/task_definition_attributes.rb', line 50 def compatibility @compatibility end |
#execution_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - undefined
The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf.
Some tasks do not have an execution role.
35 36 37 |
# File 'ecs/task_definition_attributes.rb', line 35 def execution_role @execution_role end |
#network_mode ⇒ AWSCDK::ECS::NetworkMode? (readonly)
Default: Network mode cannot be provided to the imported task.
The networking mode to use for the containers in the task.
40 41 42 |
# File 'ecs/task_definition_attributes.rb', line 40 def network_mode @network_mode end |
#task_definition_arn ⇒ String (readonly)
The arn of the task definition.
28 29 30 |
# File 'ecs/task_definition_attributes.rb', line 28 def task_definition_arn @task_definition_arn end |
#task_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: Permissions cannot be granted to the imported task.
The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.
45 46 47 |
# File 'ecs/task_definition_attributes.rb', line 45 def task_role @task_role end |
Class Method Details
.jsii_properties ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'ecs/task_definition_attributes.rb', line 52 def self.jsii_properties { :task_definition_arn => "taskDefinitionArn", :execution_role => "executionRole", :network_mode => "networkMode", :task_role => "taskRole", :compatibility => "compatibility", } end |
Instance Method Details
#to_jsii ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'ecs/task_definition_attributes.rb', line 62 def to_jsii result = {} result.merge!(super) result.merge!({ "taskDefinitionArn" => @task_definition_arn, "executionRole" => @execution_role, "networkMode" => @network_mode, "taskRole" => @task_role, "compatibility" => @compatibility, }) result.compact end |