Class: AWSCDK::ECS::CommonTaskDefinitionProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ECS::CommonTaskDefinitionProps
- Defined in:
- ecs/common_task_definition_props.rb
Overview
The common properties for all task definitions.
For more information, see Task Definition Parameters.
Direct Known Subclasses
EC2TaskDefinitionProps, ExternalTaskDefinitionProps, FargateTaskDefinitionProps, TaskDefinitionProps
Instance Attribute Summary collapse
-
#enable_fault_injection ⇒ Boolean?
readonly
Enables fault injection and allows for fault injection requests to be accepted from the task's containers.
-
#execution_role ⇒ AWSCDK::IAM::IRole?
readonly
The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf.
-
#family ⇒ String?
readonly
The name of a family that this task definition is registered to.
-
#proxy_configuration ⇒ AWSCDK::ECS::ProxyConfiguration?
readonly
The configuration details for the App Mesh proxy.
-
#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.
-
#volumes ⇒ Array<AWSCDK::ECS::Volume>?
readonly
The list of volume definitions for the task.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(enable_fault_injection: nil, execution_role: nil, family: nil, proxy_configuration: nil, task_role: nil, volumes: nil) ⇒ CommonTaskDefinitionProps
constructor
A new instance of CommonTaskDefinitionProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(enable_fault_injection: nil, execution_role: nil, family: nil, proxy_configuration: nil, task_role: nil, volumes: nil) ⇒ CommonTaskDefinitionProps
Returns a new instance of CommonTaskDefinitionProps.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'ecs/common_task_definition_props.rb', line 16 def initialize(enable_fault_injection: nil, execution_role: nil, family: nil, proxy_configuration: nil, task_role: nil, volumes: nil) @enable_fault_injection = enable_fault_injection Jsii::Type.check_type(@enable_fault_injection, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableFaultInjection") unless @enable_fault_injection.nil? @execution_role = execution_role Jsii::Type.check_type(@execution_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "executionRole") unless @execution_role.nil? @family = family Jsii::Type.check_type(@family, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "family") unless @family.nil? @proxy_configuration = proxy_configuration Jsii::Type.check_type(@proxy_configuration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlByb3h5Q29uZmlndXJhdGlvbiJ9")), "proxyConfiguration") unless @proxy_configuration.nil? @task_role = task_role Jsii::Type.check_type(@task_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "taskRole") unless @task_role.nil? @volumes = volumes.is_a?(Array) ? volumes.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECS::Volume.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : volumes Jsii::Type.check_type(@volumes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuVm9sdW1lIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "volumes") unless @volumes.nil? end |
Instance Attribute Details
#enable_fault_injection ⇒ Boolean? (readonly)
Default: undefined - ECS default setting is false
Enables fault injection and allows for fault injection requests to be accepted from the task's containers.
Fault injection only works with tasks using the NetworkMode.AWS_VPC or NetworkMode.HOST network modes.
37 38 39 |
# File 'ecs/common_task_definition_props.rb', line 37 def enable_fault_injection @enable_fault_injection end |
#execution_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - An execution role will be automatically created if you use ECR images in your task definition.
The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf.
The role will be used to retrieve container images from ECR and create CloudWatch log groups.
44 45 46 |
# File 'ecs/common_task_definition_props.rb', line 44 def execution_role @execution_role end |
#family ⇒ String? (readonly)
Default: - Automatically generated name.
The name of a family that this task definition is registered to.
A family groups multiple versions of a task definition.
51 52 53 |
# File 'ecs/common_task_definition_props.rb', line 51 def family @family end |
#proxy_configuration ⇒ AWSCDK::ECS::ProxyConfiguration? (readonly)
Default: - No proxy configuration.
The configuration details for the App Mesh proxy.
56 57 58 |
# File 'ecs/common_task_definition_props.rb', line 56 def proxy_configuration @proxy_configuration end |
#task_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - A task role is automatically created for you.
The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.
61 62 63 |
# File 'ecs/common_task_definition_props.rb', line 61 def task_role @task_role end |
#volumes ⇒ Array<AWSCDK::ECS::Volume>? (readonly)
Default: - No volumes are passed to the Docker daemon on a container instance.
The list of volume definitions for the task.
For more information, see Task Definition Parameter Volumes.
69 70 71 |
# File 'ecs/common_task_definition_props.rb', line 69 def volumes @volumes end |
Class Method Details
.jsii_properties ⇒ Object
71 72 73 74 75 76 77 78 79 80 |
# File 'ecs/common_task_definition_props.rb', line 71 def self.jsii_properties { :enable_fault_injection => "enableFaultInjection", :execution_role => "executionRole", :family => "family", :proxy_configuration => "proxyConfiguration", :task_role => "taskRole", :volumes => "volumes", } end |
Instance Method Details
#to_jsii ⇒ Object
82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'ecs/common_task_definition_props.rb', line 82 def to_jsii result = {} result.merge!({ "enableFaultInjection" => @enable_fault_injection, "executionRole" => @execution_role, "family" => @family, "proxyConfiguration" => @proxy_configuration, "taskRole" => @task_role, "volumes" => @volumes, }) result.compact end |