Class: AWSCDK::SchedulerTargets::FargateTaskProps
- Inherits:
-
ECSRunTaskBaseProps
- Object
- ECSRunTaskBaseProps
- AWSCDK::SchedulerTargets::FargateTaskProps
- Defined in:
- scheduler_targets/fargate_task_props.rb
Overview
Properties for scheduling an ECS Fargate Task.
Instance Attribute Summary collapse
-
#assign_public_ip ⇒ Boolean?
readonly
Specifies whether the task's elastic network interface receives a public IP address.
-
#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.
-
#platform_version ⇒ AWSCDK::ECS::FargatePlatformVersion?
readonly
Specifies the platform version for the task.
-
#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, assign_public_ip: nil, platform_version: nil) ⇒ FargateTaskProps
constructor
A new instance of FargateTaskProps.
- #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, assign_public_ip: nil, platform_version: nil) ⇒ FargateTaskProps
Returns a new instance of FargateTaskProps.
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 57 58 59 60 61 62 |
# File 'scheduler_targets/fargate_task_props.rb', line 25 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, assign_public_ip: nil, platform_version: 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? @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? @platform_version = platform_version Jsii::Type.check_type(@platform_version, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkZhcmdhdGVQbGF0Zm9ybVZlcnNpb24ifQ==")), "platformVersion") unless @platform_version.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.
If true, the task will receive a public IP address and be accessible from the internet. Should only be set to true when using public subnets.
181 182 183 |
# File 'scheduler_targets/fargate_task_props.rb', line 181 def assign_public_ip @assign_public_ip end |
#capacity_provider_strategies ⇒ Array<AWSCDK::ECS::CapacityProviderStrategy>? (readonly)
Default: - No capacity provider strategy
The capacity provider strategy to use for the task.
116 117 118 |
# File 'scheduler_targets/fargate_task_props.rb', line 116 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.
72 73 74 |
# File 'scheduler_targets/fargate_task_props.rb', line 72 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.
121 122 123 |
# File 'scheduler_targets/fargate_task_props.rb', line 121 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.
128 129 130 |
# File 'scheduler_targets/fargate_task_props.rb', line 128 def enable_execute_command @enable_execute_command end |
#group ⇒ String? (readonly)
Default: - No group
Specifies an ECS task group for the task.
133 134 135 |
# File 'scheduler_targets/fargate_task_props.rb', line 133 def group @group end |
#input ⇒ AWSCDK::Scheduler::ScheduleTargetInput? (readonly)
Default: - no input.
Input passed to the target.
77 78 79 |
# File 'scheduler_targets/fargate_task_props.rb', line 77 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.
85 86 87 |
# File 'scheduler_targets/fargate_task_props.rb', line 85 def max_event_age @max_event_age end |
#platform_version ⇒ AWSCDK::ECS::FargatePlatformVersion? (readonly)
Default: - LATEST
Specifies the platform version for the task.
Specify only the numeric portion of the platform version, such as 1.1.0. Platform versions determine the underlying runtime environment for the task.
189 190 191 |
# File 'scheduler_targets/fargate_task_props.rb', line 189 def platform_version @platform_version 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.
140 141 142 |
# File 'scheduler_targets/fargate_task_props.rb', line 140 def @propagate_tags end |
#reference_id ⇒ String? (readonly)
Default: - No reference ID.
The reference ID to use for the task.
145 146 147 |
# File 'scheduler_targets/fargate_task_props.rb', line 145 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.
93 94 95 |
# File 'scheduler_targets/fargate_task_props.rb', line 93 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.
102 103 104 |
# File 'scheduler_targets/fargate_task_props.rb', line 102 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.
153 154 155 |
# File 'scheduler_targets/fargate_task_props.rb', line 153 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.
160 161 162 |
# File 'scheduler_targets/fargate_task_props.rb', line 160 def @tags end |
#task_count ⇒ Numeric? (readonly)
Default: 1
The number of tasks to create based on TaskDefinition.
165 166 167 |
# File 'scheduler_targets/fargate_task_props.rb', line 165 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.
111 112 113 |
# File 'scheduler_targets/fargate_task_props.rb', line 111 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.
173 174 175 |
# File 'scheduler_targets/fargate_task_props.rb', line 173 def vpc_subnets @vpc_subnets end |
Class Method Details
.jsii_properties ⇒ Object
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/fargate_task_props.rb', line 191 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", :assign_public_ip => "assignPublicIp", :platform_version => "platformVersion", } end |
Instance Method Details
#to_jsii ⇒ Object
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'scheduler_targets/fargate_task_props.rb', line 214 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, "assignPublicIp" => @assign_public_ip, "platformVersion" => @platform_version, }) result.compact end |