Class: AWSCDK::SchedulerTargets::ECSRunTaskBaseProps

Inherits:
ScheduleTargetBaseProps
  • Object
show all
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

EC2TaskProps, FargateTaskProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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.

Parameters:

  • dead_letter_queue (AWSCDK::SQS::IQueue, nil) (defaults to: nil)

    The SQS queue to be used as deadLetterQueue.

  • input (AWSCDK::Scheduler::ScheduleTargetInput, nil) (defaults to: nil)

    Input passed to the target.

  • max_event_age (AWSCDK::Duration, nil) (defaults to: nil)

    The maximum age of a request that Scheduler sends to a target for processing.

  • retry_attempts (Numeric, nil) (defaults to: nil)

    The maximum number of times to retry when the target returns an error.

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

    An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.

  • task_definition (AWSCDK::ECS::TaskDefinition)

    The task definition to use for scheduled tasks.

  • capacity_provider_strategies (Array<AWSCDK::ECS::CapacityProviderStrategy>, nil) (defaults to: nil)

    The capacity provider strategy to use for the task.

  • enable_ecs_managed_tags (Boolean, nil) (defaults to: nil)

    Specifies whether to enable Amazon ECS managed tags for the task.

  • enable_execute_command (Boolean, nil) (defaults to: nil)

    Whether to enable execute command functionality for the containers in this task.

  • group (String, nil) (defaults to: nil)

    Specifies an ECS task group for the task.

  • propagate_tags (Boolean, nil) (defaults to: nil)

    Specifies whether to propagate the tags from the task definition to the task.

  • reference_id (String, nil) (defaults to: nil)

    The reference ID to use for the task.

  • security_groups (Array<AWSCDK::EC2::ISecurityGroup>, nil) (defaults to: nil)

    The security groups associated with the task.

  • tags (Array<AWSCDK::SchedulerTargets::Tag>, nil) (defaults to: nil)

    The metadata that you apply to the task to help you categorize and organize them.

  • task_count (Numeric, nil) (defaults to: nil)

    The number of tasks to create based on TaskDefinition.

  • vpc_subnets (AWSCDK::EC2::SubnetSelection, nil) (defaults to: nil)

    The subnets associated with the task.



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 = 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 = 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 = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::SchedulerTargets::Tag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  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_strategiesArray<AWSCDK::ECS::CapacityProviderStrategy>? (readonly)

Note:

Default: - No capacity provider strategy

The capacity provider strategy to use for the task.

Returns:



110
111
112
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 110

def capacity_provider_strategies
  @capacity_provider_strategies
end

#dead_letter_queueAWSCDK::SQS::IQueue? (readonly)

Note:

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.

Returns:



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_tagsBoolean? (readonly)

Note:

Default: - false

Specifies whether to enable Amazon ECS managed tags for the task.

Returns:

  • (Boolean, nil)


115
116
117
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 115

def enable_ecs_managed_tags
  @enable_ecs_managed_tags
end

#enable_execute_commandBoolean? (readonly)

Note:

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.

Returns:

  • (Boolean, nil)


122
123
124
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 122

def enable_execute_command
  @enable_execute_command
end

#groupString? (readonly)

Note:

Default: - No group

Specifies an ECS task group for the task.

Returns:

  • (String, nil)


127
128
129
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 127

def group
  @group
end

#inputAWSCDK::Scheduler::ScheduleTargetInput? (readonly)

Note:

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_ageAWSCDK::Duration? (readonly)

Note:

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.

Returns:



79
80
81
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 79

def max_event_age
  @max_event_age
end

#propagate_tagsBoolean? (readonly)

Note:

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.

Returns:

  • (Boolean, nil)


134
135
136
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 134

def propagate_tags
  @propagate_tags
end

#reference_idString? (readonly)

Note:

Default: - No reference ID.

The reference ID to use for the task.

Returns:

  • (String, nil)


139
140
141
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 139

def reference_id
  @reference_id
end

#retry_attemptsNumeric? (readonly)

Note:

Default: 185

The maximum number of times to retry when the target returns an error.

Minimum value of 0. Maximum value of 185.

Returns:

  • (Numeric, nil)


87
88
89
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 87

def retry_attempts
  @retry_attempts
end

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

Note:

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.

Returns:



96
97
98
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 96

def role
  @role
end

#security_groupsArray<AWSCDK::EC2::ISecurityGroup>? (readonly)

Note:

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.

Returns:



147
148
149
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 147

def security_groups
  @security_groups
end

#tagsArray<AWSCDK::SchedulerTargets::Tag>? (readonly)

Note:

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.

Returns:



154
155
156
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 154

def tags
  @tags
end

#task_countNumeric? (readonly)

Note:

Default: 1

The number of tasks to create based on TaskDefinition.

Returns:

  • (Numeric, nil)


159
160
161
# File 'scheduler_targets/ecs_run_task_base_props.rb', line 159

def task_count
  @task_count
end

#task_definitionAWSCDK::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_subnetsAWSCDK::EC2::SubnetSelection? (readonly)

Note:

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_propertiesObject



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_jsiiObject



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