Class: AWSCDK::EventsTargets::ECSTaskProps
- Inherits:
-
TargetBaseProps
- Object
- TargetBaseProps
- AWSCDK::EventsTargets::ECSTaskProps
- Defined in:
- events_targets/ecs_task_props.rb
Overview
Properties to define an ECS Event Task.
Instance Attribute Summary collapse
-
#assign_public_ip ⇒ Boolean?
readonly
Specifies whether the task's elastic network interface receives a public IP address.
-
#cluster ⇒ AWSCDK::ECS::ICluster
readonly
Cluster where service will be deployed.
-
#container_overrides ⇒ Array<AWSCDK::EventsTargets::ContainerOverride>?
readonly
Container setting overrides.
-
#cpu ⇒ String?
readonly
The CPU override for the task.
-
#dead_letter_queue ⇒ AWSCDK::SQS::IQueue?
readonly
The SQS queue to be used as deadLetterQueue.
-
#enable_execute_command ⇒ Boolean?
readonly
Whether or not to enable the execute command functionality for the containers in this task.
-
#ephemeral_storage ⇒ AWSCDK::EventsTargets::EphemeralStorageOverride?
readonly
The ephemeral storage setting override for the task.
-
#execution_role ⇒ AWSCDK::IAM::IRole?
readonly
The execution role for the task.
-
#inference_accelerator_overrides ⇒ Array<AWSCDK::EventsTargets::InferenceAcceleratorOverride>?
readonly
The Elastic Inference accelerator override for the task.
-
#launch_type ⇒ AWSCDK::ECS::LaunchType?
readonly
Specifies the launch type on which your task is running.
-
#max_event_age ⇒ AWSCDK::Duration?
readonly
The maximum age of a request that Lambda sends to a function for processing.
-
#memory ⇒ String?
readonly
The memory override for the task.
-
#platform_version ⇒ AWSCDK::ECS::FargatePlatformVersion?
readonly
The platform version on which to run your task.
-
#propagate_tags ⇒ AWSCDK::ECS::PropagatedTagSource?
readonly
Specifies whether to propagate the tags from the task definition to the task.
-
#retry_attempts ⇒ Numeric?
readonly
The maximum number of times to retry when the function returns an error.
-
#role ⇒ AWSCDK::IAM::IRole?
readonly
Existing IAM role to run the ECS task.
-
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>?
readonly
Existing security groups to use for the task's ENIs.
-
#subnet_selection ⇒ AWSCDK::EC2::SubnetSelection?
readonly
In what subnets to place the task's ENIs.
-
#tags ⇒ Array<AWSCDK::EventsTargets::Tag>?
readonly
The metadata that you apply to the task to help you categorize and organize them.
-
#task_count ⇒ Numeric?
readonly
How many tasks should be started when this event is triggered.
-
#task_definition ⇒ AWSCDK::ECS::ITaskDefinition
readonly
Task Definition of the task that should be started.
-
#task_role ⇒ AWSCDK::IAM::IRole?
readonly
The IAM role for the task.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, cluster:, task_definition:, assign_public_ip: nil, container_overrides: nil, cpu: nil, enable_execute_command: nil, ephemeral_storage: nil, execution_role: nil, inference_accelerator_overrides: nil, launch_type: nil, memory: nil, platform_version: nil, propagate_tags: nil, role: nil, security_groups: nil, subnet_selection: nil, tags: nil, task_count: nil, task_role: nil) ⇒ ECSTaskProps
constructor
A new instance of ECSTaskProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, cluster:, task_definition:, assign_public_ip: nil, container_overrides: nil, cpu: nil, enable_execute_command: nil, ephemeral_storage: nil, execution_role: nil, inference_accelerator_overrides: nil, launch_type: nil, memory: nil, platform_version: nil, propagate_tags: nil, role: nil, security_groups: nil, subnet_selection: nil, tags: nil, task_count: nil, task_role: nil) ⇒ ECSTaskProps
Returns a new instance of ECSTaskProps.
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 68 69 70 71 72 73 74 |
# File 'events_targets/ecs_task_props.rb', line 29 def initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, cluster:, task_definition:, assign_public_ip: nil, container_overrides: nil, cpu: nil, enable_execute_command: nil, ephemeral_storage: nil, execution_role: nil, inference_accelerator_overrides: nil, launch_type: nil, memory: nil, platform_version: nil, propagate_tags: nil, role: nil, security_groups: nil, subnet_selection: nil, tags: nil, task_count: nil, task_role: nil) @dead_letter_queue = dead_letter_queue Jsii::Type.check_type(@dead_letter_queue, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLklRdWV1ZSJ9")), "deadLetterQueue") unless @dead_letter_queue.nil? @max_event_age = max_event_age Jsii::Type.check_type(@max_event_age, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "maxEventAge") unless @max_event_age.nil? @retry_attempts = retry_attempts Jsii::Type.check_type(@retry_attempts, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retryAttempts") unless @retry_attempts.nil? @cluster = cluster Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLklDbHVzdGVyIn0=")), "cluster") @task_definition = task_definition Jsii::Type.check_type(@task_definition, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLklUYXNrRGVmaW5pdGlvbiJ9")), "taskDefinition") @assign_public_ip = assign_public_ip Jsii::Type.check_type(@assign_public_ip, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "assignPublicIp") unless @assign_public_ip.nil? @container_overrides = container_overrides.is_a?(Array) ? container_overrides.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::EventsTargets::ContainerOverride.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : container_overrides Jsii::Type.check_type(@container_overrides, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ldmVudHNfdGFyZ2V0cy5Db250YWluZXJPdmVycmlkZSJ9LCJraW5kIjoiYXJyYXkifX0=")), "containerOverrides") unless @container_overrides.nil? @cpu = cpu Jsii::Type.check_type(@cpu, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "cpu") unless @cpu.nil? @enable_execute_command = enable_execute_command Jsii::Type.check_type(@enable_execute_command, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableExecuteCommand") unless @enable_execute_command.nil? @ephemeral_storage = ephemeral_storage.is_a?(Hash) ? ::AWSCDK::EventsTargets::EphemeralStorageOverride.new(**ephemeral_storage.transform_keys(&:to_sym)) : ephemeral_storage Jsii::Type.check_type(@ephemeral_storage, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzX3RhcmdldHMuRXBoZW1lcmFsU3RvcmFnZU92ZXJyaWRlIn0=")), "ephemeralStorage") unless @ephemeral_storage.nil? @execution_role = execution_role Jsii::Type.check_type(@execution_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "executionRole") unless @execution_role.nil? @inference_accelerator_overrides = inference_accelerator_overrides.is_a?(Array) ? inference_accelerator_overrides.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::EventsTargets::InferenceAcceleratorOverride.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : inference_accelerator_overrides Jsii::Type.check_type(@inference_accelerator_overrides, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ldmVudHNfdGFyZ2V0cy5JbmZlcmVuY2VBY2NlbGVyYXRvck92ZXJyaWRlIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "inferenceAcceleratorOverrides") unless @inference_accelerator_overrides.nil? @launch_type = launch_type Jsii::Type.check_type(@launch_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkxhdW5jaFR5cGUifQ==")), "launchType") unless @launch_type.nil? @memory = memory Jsii::Type.check_type(@memory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "memory") unless @memory.nil? @platform_version = platform_version Jsii::Type.check_type(@platform_version, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkZhcmdhdGVQbGF0Zm9ybVZlcnNpb24ifQ==")), "platformVersion") unless @platform_version.nil? @propagate_tags = Jsii::Type.check_type(@propagate_tags, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlByb3BhZ2F0ZWRUYWdTb3VyY2UifQ==")), "propagateTags") unless @propagate_tags.nil? @role = role Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil? @security_groups = security_groups Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups") unless @security_groups.nil? @subnet_selection = subnet_selection.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**subnet_selection.transform_keys(&:to_sym)) : subnet_selection Jsii::Type.check_type(@subnet_selection, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "subnetSelection") unless @subnet_selection.nil? @tags = .is_a?(Array) ? .map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::EventsTargets::Tag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ldmVudHNfdGFyZ2V0cy5UYWcifSwia2luZCI6ImFycmF5In19")), "tags") unless @tags.nil? @task_count = task_count Jsii::Type.check_type(@task_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "taskCount") unless @task_count.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
#assign_public_ip ⇒ Boolean? (readonly)
Default: - true if the subnet type is PUBLIC, otherwise false
Specifies whether the task's elastic network interface receives a public IP address.
You can specify true only when LaunchType is set to FARGATE.
115 116 117 |
# File 'events_targets/ecs_task_props.rb', line 115 def assign_public_ip @assign_public_ip end |
#cluster ⇒ AWSCDK::ECS::ICluster (readonly)
Cluster where service will be deployed.
104 105 106 |
# File 'events_targets/ecs_task_props.rb', line 104 def cluster @cluster end |
#container_overrides ⇒ Array<AWSCDK::EventsTargets::ContainerOverride>? (readonly)
Container setting overrides.
Key is the name of the container to override, value is the values you want to override.
122 123 124 |
# File 'events_targets/ecs_task_props.rb', line 122 def container_overrides @container_overrides end |
#cpu ⇒ String? (readonly)
Default: - The task definition's CPU value
The CPU override for the task.
127 128 129 |
# File 'events_targets/ecs_task_props.rb', line 127 def cpu @cpu end |
#dead_letter_queue ⇒ AWSCDK::SQS::IQueue? (readonly)
Default: - no dead-letter queue
The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.
The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
84 85 86 |
# File 'events_targets/ecs_task_props.rb', line 84 def dead_letter_queue @dead_letter_queue end |
#enable_execute_command ⇒ Boolean? (readonly)
Default: - false
Whether or not to enable the execute command functionality for the containers in this task.
If true, this enables execute command functionality on all containers in the task.
134 135 136 |
# File 'events_targets/ecs_task_props.rb', line 134 def enable_execute_command @enable_execute_command end |
#ephemeral_storage ⇒ AWSCDK::EventsTargets::EphemeralStorageOverride? (readonly)
Default: - The task definition's ephemeral storage value
The ephemeral storage setting override for the task.
NOTE: This parameter is only supported for tasks hosted on Fargate that use the following platform versions:
- Linux platform version 1.4.0 or later.
- Windows platform version 1.0.0 or later.
144 145 146 |
# File 'events_targets/ecs_task_props.rb', line 144 def ephemeral_storage @ephemeral_storage end |
#execution_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - The task definition's execution role
The execution role for the task.
The Amazon Resource Name (ARN) of the task execution role override for the task.
151 152 153 |
# File 'events_targets/ecs_task_props.rb', line 151 def execution_role @execution_role end |
#inference_accelerator_overrides ⇒ Array<AWSCDK::EventsTargets::InferenceAcceleratorOverride>? (readonly)
Default: - The task definition's inference accelerator overrides
The Elastic Inference accelerator override for the task.
156 157 158 |
# File 'events_targets/ecs_task_props.rb', line 156 def inference_accelerator_overrides @inference_accelerator_overrides end |
#launch_type ⇒ AWSCDK::ECS::LaunchType? (readonly)
Default: - 'EC2' if isEc2Compatible for the taskDefinition is true, otherwise 'FARGATE'
Specifies the launch type on which your task is running.
The launch type that you specify here must match one of the launch type (compatibilities) of the target task.
164 165 166 |
# File 'events_targets/ecs_task_props.rb', line 164 def launch_type @launch_type end |
#max_event_age ⇒ AWSCDK::Duration? (readonly)
Default: Duration.hours(24)
The maximum age of a request that Lambda sends to a function for processing.
Minimum value of 60. Maximum value of 86400.
92 93 94 |
# File 'events_targets/ecs_task_props.rb', line 92 def max_event_age @max_event_age end |
#memory ⇒ String? (readonly)
Default: - The task definition's memory value
The memory override for the task.
169 170 171 |
# File 'events_targets/ecs_task_props.rb', line 169 def memory @memory end |
#platform_version ⇒ AWSCDK::ECS::FargatePlatformVersion? (readonly)
Default: - ECS will set the Fargate platform version to 'LATEST'
The platform version on which to run your task.
Unless you have specific compatibility requirements, you don't need to specify this.
177 178 179 |
# File 'events_targets/ecs_task_props.rb', line 177 def platform_version @platform_version end |
#propagate_tags ⇒ AWSCDK::ECS::PropagatedTagSource? (readonly)
Default: - Tags will not be propagated
Specifies whether to propagate the tags from the task definition to the task.
If no value is specified, the tags are not propagated.
184 185 186 |
# File 'events_targets/ecs_task_props.rb', line 184 def @propagate_tags end |
#retry_attempts ⇒ Numeric? (readonly)
Default: 185
The maximum number of times to retry when the function returns an error.
Minimum value of 0. Maximum value of 185.
100 101 102 |
# File 'events_targets/ecs_task_props.rb', line 100 def retry_attempts @retry_attempts end |
#role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: A new IAM role is created
Existing IAM role to run the ECS task.
189 190 191 |
# File 'events_targets/ecs_task_props.rb', line 189 def role @role end |
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>? (readonly)
Default: A new security group is created
Existing security groups to use for the task's ENIs.
(Only applicable in case the TaskDefinition is configured for AwsVpc networking)
196 197 198 |
# File 'events_targets/ecs_task_props.rb', line 196 def security_groups @security_groups end |
#subnet_selection ⇒ AWSCDK::EC2::SubnetSelection? (readonly)
Default: Private subnets
In what subnets to place the task's ENIs.
(Only applicable in case the TaskDefinition is configured for AwsVpc networking)
203 204 205 |
# File 'events_targets/ecs_task_props.rb', line 203 def subnet_selection @subnet_selection end |
#tags ⇒ Array<AWSCDK::EventsTargets::Tag>? (readonly)
Default: - No additional tags are applied to the task
The metadata that you apply to the task to help you categorize and organize them.
Each tag consists of a key and an optional value, both of which you define.
210 211 212 |
# File 'events_targets/ecs_task_props.rb', line 210 def @tags end |
#task_count ⇒ Numeric? (readonly)
Default: 1
How many tasks should be started when this event is triggered.
215 216 217 |
# File 'events_targets/ecs_task_props.rb', line 215 def task_count @task_count end |
#task_definition ⇒ AWSCDK::ECS::ITaskDefinition (readonly)
Task Definition of the task that should be started.
108 109 110 |
# File 'events_targets/ecs_task_props.rb', line 108 def task_definition @task_definition end |
#task_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - The task definition's task role
The IAM role for the task.
220 221 222 |
# File 'events_targets/ecs_task_props.rb', line 220 def task_role @task_role end |
Class Method Details
.jsii_properties ⇒ Object
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
# File 'events_targets/ecs_task_props.rb', line 222 def self.jsii_properties { :dead_letter_queue => "deadLetterQueue", :max_event_age => "maxEventAge", :retry_attempts => "retryAttempts", :cluster => "cluster", :task_definition => "taskDefinition", :assign_public_ip => "assignPublicIp", :container_overrides => "containerOverrides", :cpu => "cpu", :enable_execute_command => "enableExecuteCommand", :ephemeral_storage => "ephemeralStorage", :execution_role => "executionRole", :inference_accelerator_overrides => "inferenceAcceleratorOverrides", :launch_type => "launchType", :memory => "memory", :platform_version => "platformVersion", :propagate_tags => "propagateTags", :role => "role", :security_groups => "securityGroups", :subnet_selection => "subnetSelection", :tags => "tags", :task_count => "taskCount", :task_role => "taskRole", } end |
Instance Method Details
#to_jsii ⇒ Object
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'events_targets/ecs_task_props.rb', line 249 def to_jsii result = {} result.merge!(super) result.merge!({ "deadLetterQueue" => @dead_letter_queue, "maxEventAge" => @max_event_age, "retryAttempts" => @retry_attempts, "cluster" => @cluster, "taskDefinition" => @task_definition, "assignPublicIp" => @assign_public_ip, "containerOverrides" => @container_overrides, "cpu" => @cpu, "enableExecuteCommand" => @enable_execute_command, "ephemeralStorage" => @ephemeral_storage, "executionRole" => @execution_role, "inferenceAcceleratorOverrides" => @inference_accelerator_overrides, "launchType" => @launch_type, "memory" => @memory, "platformVersion" => @platform_version, "propagateTags" => @propagate_tags, "role" => @role, "securityGroups" => @security_groups, "subnetSelection" => @subnet_selection, "tags" => @tags, "taskCount" => @task_count, "taskRole" => @task_role, }) result.compact end |