Class: AWSCDK::SchedulerTargets::ECSRunTaskBaseProps
- Inherits:
-
ScheduleTargetBaseProps
- Object
- ScheduleTargetBaseProps
- AWSCDK::SchedulerTargets::ECSRunTaskBaseProps
- Defined in:
- scheduler_targets/ecs_run_task_base_props.rb
Overview
Parameters for scheduling ECS Run Task (common to EC2 and Fargate launch types).
Direct Known Subclasses
Instance Attribute Summary collapse
-
#capacity_provider_strategies ⇒ Array<AWSCDK::ECS::CapacityProviderStrategy>?
readonly
The capacity provider strategy to use for the task.
-
#dead_letter_queue ⇒ AWSCDK::SQS::IQueue?
readonly
The SQS queue to be used as deadLetterQueue.
-
#enable_ecs_managed_tags ⇒ Boolean?
readonly
Specifies whether to enable Amazon ECS managed tags for the task.
-
#enable_execute_command ⇒ Boolean?
readonly
Whether to enable execute command functionality for the containers in this task.
-
#group ⇒ String?
readonly
Specifies an ECS task group for the task.
-
#input ⇒ AWSCDK::Scheduler::ScheduleTargetInput?
readonly
Input passed to the target.
-
#max_event_age ⇒ AWSCDK::Duration?
readonly
The maximum age of a request that Scheduler sends to a target for processing.
-
#propagate_tags ⇒ Boolean?
readonly
Specifies whether to propagate the tags from the task definition to the task.
-
#reference_id ⇒ String?
readonly
The reference ID to use for the task.
-
#retry_attempts ⇒ Numeric?
readonly
The maximum number of times to retry when the target returns an error.
-
#role ⇒ AWSCDK::IAM::IRole?
readonly
An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.
-
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>?
readonly
The security groups associated with the task.
-
#tags ⇒ Array<AWSCDK::SchedulerTargets::Tag>?
readonly
The metadata that you apply to the task to help you categorize and organize them.
-
#task_count ⇒ Numeric?
readonly
The number of tasks to create based on TaskDefinition.
-
#task_definition ⇒ AWSCDK::ECS::TaskDefinition
readonly
The task definition to use for scheduled tasks.
-
#vpc_subnets ⇒ AWSCDK::EC2::SubnetSelection?
readonly
The subnets associated with the task.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dead_letter_queue: nil, input: nil, max_event_age: nil, retry_attempts: nil, role: nil, task_definition:, capacity_provider_strategies: nil, enable_ecs_managed_tags: nil, enable_execute_command: nil, group: nil, propagate_tags: nil, reference_id: nil, security_groups: nil, tags: nil, task_count: nil, vpc_subnets: nil) ⇒ ECSRunTaskBaseProps
constructor
A new instance of ECSRunTaskBaseProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(dead_letter_queue: nil, input: nil, max_event_age: nil, retry_attempts: nil, role: nil, task_definition:, capacity_provider_strategies: nil, enable_ecs_managed_tags: nil, enable_execute_command: nil, group: nil, propagate_tags: nil, reference_id: nil, security_groups: nil, tags: nil, task_count: nil, vpc_subnets: nil) ⇒ ECSRunTaskBaseProps
Returns a new instance of ECSRunTaskBaseProps.
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 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 23 def initialize(dead_letter_queue: nil, input: nil, max_event_age: nil, retry_attempts: nil, role: nil, task_definition:, capacity_provider_strategies: nil, enable_ecs_managed_tags: nil, enable_execute_command: nil, group: nil, propagate_tags: nil, reference_id: nil, security_groups: nil, tags: nil, task_count: nil, vpc_subnets: 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? @input = input Jsii::Type.check_type(@input, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2NoZWR1bGVyLlNjaGVkdWxlVGFyZ2V0SW5wdXQifQ==")), "input") unless @input.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? @role = role Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil? @task_definition = task_definition Jsii::Type.check_type(@task_definition, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlRhc2tEZWZpbml0aW9uIn0=")), "taskDefinition") @capacity_provider_strategies = capacity_provider_strategies.is_a?(Array) ? capacity_provider_strategies.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECS::CapacityProviderStrategy.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : capacity_provider_strategies Jsii::Type.check_type(@capacity_provider_strategies, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2FwYWNpdHlQcm92aWRlclN0cmF0ZWd5In0sImtpbmQiOiJhcnJheSJ9fQ==")), "capacityProviderStrategies") unless @capacity_provider_strategies.nil? @enable_ecs_managed_tags = Jsii::Type.check_type(@enable_ecs_managed_tags, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableEcsManagedTags") unless @enable_ecs_managed_tags.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? @group = group Jsii::Type.check_type(@group, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "group") unless @group.nil? @propagate_tags = Jsii::Type.check_type(@propagate_tags, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "propagateTags") unless @propagate_tags.nil? @reference_id = reference_id Jsii::Type.check_type(@reference_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "referenceId") unless @reference_id.nil? @security_groups = security_groups Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups") unless @security_groups.nil? @tags = .is_a?(Array) ? .map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::SchedulerTargets::Tag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zY2hlZHVsZXJfdGFyZ2V0cy5UYWcifSwia2luZCI6ImFycmF5In19")), "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? @vpc_subnets = vpc_subnets.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**vpc_subnets.transform_keys(&:to_sym)) : vpc_subnets Jsii::Type.check_type(@vpc_subnets, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "vpcSubnets") unless @vpc_subnets.nil? end |
Instance Attribute Details
#capacity_provider_strategies ⇒ Array<AWSCDK::ECS::CapacityProviderStrategy>? (readonly)
Default: - No capacity provider strategy
The capacity provider strategy to use for the task.
110 111 112 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 110 def capacity_provider_strategies @capacity_provider_strategies end |
#dead_letter_queue ⇒ AWSCDK::SQS::IQueue? (readonly)
Default: - no dead-letter queue
The SQS queue to be used as deadLetterQueue.
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.
66 67 68 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 66 def dead_letter_queue @dead_letter_queue end |
#enable_ecs_managed_tags ⇒ Boolean? (readonly)
Default: - false
Specifies whether to enable Amazon ECS managed tags for the task.
115 116 117 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 115 def @enable_ecs_managed_tags end |
#enable_execute_command ⇒ Boolean? (readonly)
Default: - false
Whether to enable execute command functionality for the containers in this task.
If true, this enables execute command functionality on all containers in the task.
122 123 124 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 122 def enable_execute_command @enable_execute_command end |
#group ⇒ String? (readonly)
Default: - No group
Specifies an ECS task group for the task.
127 128 129 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 127 def group @group end |
#input ⇒ AWSCDK::Scheduler::ScheduleTargetInput? (readonly)
Default: - no input.
Input passed to the target.
71 72 73 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 71 def input @input end |
#max_event_age ⇒ AWSCDK::Duration? (readonly)
Default: Duration.hours(24)
The maximum age of a request that Scheduler sends to a target for processing.
Minimum value of 60. Maximum value of 86400.
79 80 81 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 79 def max_event_age @max_event_age end |
#propagate_tags ⇒ Boolean? (readonly)
Default: - No tag propagation
Specifies whether to propagate the tags from the task definition to the task.
If no value is specified, the tags are not propagated.
134 135 136 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 134 def @propagate_tags end |
#reference_id ⇒ String? (readonly)
Default: - No reference ID.
The reference ID to use for the task.
139 140 141 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 139 def reference_id @reference_id end |
#retry_attempts ⇒ Numeric? (readonly)
Default: 185
The maximum number of times to retry when the target returns an error.
Minimum value of 0. Maximum value of 185.
87 88 89 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 87 def retry_attempts @retry_attempts end |
#role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - created by target
An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.
If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions.
96 97 98 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 96 def role @role end |
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>? (readonly)
Default: - The security group for the VPC is used.
The security groups associated with the task.
These security groups must all be in the same VPC. Controls inbound and outbound network access for the task.
147 148 149 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 147 def security_groups @security_groups end |
#tags ⇒ Array<AWSCDK::SchedulerTargets::Tag>? (readonly)
Default: - No tags
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.
154 155 156 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 154 def @tags end |
#task_count ⇒ Numeric? (readonly)
Default: 1
The number of tasks to create based on TaskDefinition.
159 160 161 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 159 def task_count @task_count end |
#task_definition ⇒ AWSCDK::ECS::TaskDefinition (readonly)
The task definition to use for scheduled tasks.
Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions If you want to run a RunTask with an imported task definition, consider using a Universal target.
105 106 107 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 105 def task_definition @task_definition end |
#vpc_subnets ⇒ AWSCDK::EC2::SubnetSelection? (readonly)
Default: - all private subnets of the VPC are selected.
The subnets associated with the task.
These subnets must all be in the same VPC. The task will be launched in these subnets.
167 168 169 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 167 def vpc_subnets @vpc_subnets end |
Class Method Details
.jsii_properties ⇒ Object
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 169 def self.jsii_properties { :dead_letter_queue => "deadLetterQueue", :input => "input", :max_event_age => "maxEventAge", :retry_attempts => "retryAttempts", :role => "role", :task_definition => "taskDefinition", :capacity_provider_strategies => "capacityProviderStrategies", :enable_ecs_managed_tags => "enableEcsManagedTags", :enable_execute_command => "enableExecuteCommand", :group => "group", :propagate_tags => "propagateTags", :reference_id => "referenceId", :security_groups => "securityGroups", :tags => "tags", :task_count => "taskCount", :vpc_subnets => "vpcSubnets", } end |
Instance Method Details
#to_jsii ⇒ Object
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 190 def to_jsii result = {} result.merge!(super) result.merge!({ "deadLetterQueue" => @dead_letter_queue, "input" => @input, "maxEventAge" => @max_event_age, "retryAttempts" => @retry_attempts, "role" => @role, "taskDefinition" => @task_definition, "capacityProviderStrategies" => @capacity_provider_strategies, "enableEcsManagedTags" => @enable_ecs_managed_tags, "enableExecuteCommand" => @enable_execute_command, "group" => @group, "propagateTags" => @propagate_tags, "referenceId" => @reference_id, "securityGroups" => @security_groups, "tags" => @tags, "taskCount" => @task_count, "vpcSubnets" => @vpc_subnets, }) result.compact end |