Class: AWSCDK::ECS::CommonTaskDefinitionAttributes

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs/common_task_definition_attributes.rb

Overview

The common task definition attributes used across all types of task definitions.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task_definition_arn:, execution_role: nil, network_mode: nil, task_role: nil) ⇒ CommonTaskDefinitionAttributes

Returns a new instance of CommonTaskDefinitionAttributes.

Parameters:

  • task_definition_arn (String)

    The arn of the task definition.

  • execution_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf.

  • network_mode (AWSCDK::ECS::NetworkMode, nil) (defaults to: nil)

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

  • task_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

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



11
12
13
14
15
16
17
18
19
20
# File 'ecs/common_task_definition_attributes.rb', line 11

def initialize(task_definition_arn:, execution_role: nil, network_mode: nil, task_role: 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?
end

Instance Attribute Details

#execution_roleAWSCDK::IAM::IRole? (readonly)

Note:

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.

Returns:



32
33
34
# File 'ecs/common_task_definition_attributes.rb', line 32

def execution_role
  @execution_role
end

#network_modeAWSCDK::ECS::NetworkMode? (readonly)

Note:

Default: Network mode cannot be provided to the imported task.

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

Returns:



37
38
39
# File 'ecs/common_task_definition_attributes.rb', line 37

def network_mode
  @network_mode
end

#task_definition_arnString (readonly)

The arn of the task definition.

Returns:

  • (String)


25
26
27
# File 'ecs/common_task_definition_attributes.rb', line 25

def task_definition_arn
  @task_definition_arn
end

#task_roleAWSCDK::IAM::IRole? (readonly)

Note:

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.

Returns:



42
43
44
# File 'ecs/common_task_definition_attributes.rb', line 42

def task_role
  @task_role
end

Class Method Details

.jsii_propertiesObject



44
45
46
47
48
49
50
51
# File 'ecs/common_task_definition_attributes.rb', line 44

def self.jsii_properties
  {
    :task_definition_arn => "taskDefinitionArn",
    :execution_role => "executionRole",
    :network_mode => "networkMode",
    :task_role => "taskRole",
  }
end

Instance Method Details

#to_jsiiObject



53
54
55
56
57
58
59
60
61
62
# File 'ecs/common_task_definition_attributes.rb', line 53

def to_jsii
  result = {}
  result.merge!({
    "taskDefinitionArn" => @task_definition_arn,
    "executionRole" => @execution_role,
    "networkMode" => @network_mode,
    "taskRole" => @task_role,
  })
  result.compact
end