Class: AWSCDK::ECSPatterns::ScheduledFargateTaskProps
- Inherits:
-
ScheduledTaskBaseProps
- Object
- ScheduledTaskBaseProps
- AWSCDK::ECSPatterns::ScheduledFargateTaskProps
- Defined in:
- ecs_patterns/scheduled_fargate_task_props.rb
Overview
The properties for the ScheduledFargateTask task.
Instance Attribute Summary collapse
-
#circuit_breaker ⇒ AWSCDK::ECS::DeploymentCircuitBreaker?
readonly
Whether to enable the deployment circuit breaker.
-
#cluster ⇒ AWSCDK::ECS::ICluster?
readonly
The name of the cluster that hosts the service.
-
#cpu ⇒ Numeric?
readonly
The number of cpu units used by the task.
-
#desired_task_count ⇒ Numeric?
readonly
The desired number of instantiations of the task definition to keep running on the service.
-
#enabled ⇒ Boolean?
readonly
Indicates whether the rule is enabled.
-
#ephemeral_storage_gib ⇒ Numeric?
readonly
The amount (in GiB) of ephemeral storage to be allocated to the task.
-
#memory_limit_mib ⇒ Numeric?
readonly
The amount (in MiB) of memory used by the task.
-
#platform_version ⇒ AWSCDK::ECS::FargatePlatformVersion?
readonly
The platform version on which to run your service.
-
#propagate_tags ⇒ AWSCDK::ECS::PropagatedTagSource?
readonly
Specifies whether to propagate the tags from the task definition to the task.
-
#rule_name ⇒ String?
readonly
A name for the rule.
-
#runtime_platform ⇒ AWSCDK::ECS::RuntimePlatform?
readonly
The runtime platform of the task definition.
-
#schedule ⇒ AWSCDK::ApplicationAutoScaling::Schedule
readonly
The schedule or rate (frequency) that determines when CloudWatch Events runs the rule.
-
#scheduled_fargate_task_definition_options ⇒ AWSCDK::ECSPatterns::ScheduledFargateTaskDefinitionOptions?
readonly
The properties to define if using an existing TaskDefinition in this construct.
-
#scheduled_fargate_task_image_options ⇒ AWSCDK::ECSPatterns::ScheduledFargateTaskImageOptions?
readonly
The properties to define if the construct is to create a TaskDefinition.
-
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>?
readonly
Existing security groups to use for your service.
-
#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_definition ⇒ AWSCDK::ECS::FargateTaskDefinition?
readonly
The task definition to use for tasks in the service.
-
#vpc ⇒ AWSCDK::EC2::IVPC?
readonly
The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(schedule:, cluster: nil, desired_task_count: nil, enabled: nil, propagate_tags: nil, rule_name: nil, security_groups: nil, subnet_selection: nil, tags: nil, vpc: nil, circuit_breaker: nil, cpu: nil, ephemeral_storage_gib: nil, memory_limit_mib: nil, platform_version: nil, runtime_platform: nil, task_definition: nil, scheduled_fargate_task_definition_options: nil, scheduled_fargate_task_image_options: nil) ⇒ ScheduledFargateTaskProps
constructor
A new instance of ScheduledFargateTaskProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(schedule:, cluster: nil, desired_task_count: nil, enabled: nil, propagate_tags: nil, rule_name: nil, security_groups: nil, subnet_selection: nil, tags: nil, vpc: nil, circuit_breaker: nil, cpu: nil, ephemeral_storage_gib: nil, memory_limit_mib: nil, platform_version: nil, runtime_platform: nil, task_definition: nil, scheduled_fargate_task_definition_options: nil, scheduled_fargate_task_image_options: nil) ⇒ ScheduledFargateTaskProps
Returns a new instance of ScheduledFargateTaskProps.
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 63 64 65 66 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 27 def initialize(schedule:, cluster: nil, desired_task_count: nil, enabled: nil, propagate_tags: nil, rule_name: nil, security_groups: nil, subnet_selection: nil, tags: nil, vpc: nil, circuit_breaker: nil, cpu: nil, ephemeral_storage_gib: nil, memory_limit_mib: nil, platform_version: nil, runtime_platform: nil, task_definition: nil, scheduled_fargate_task_definition_options: nil, scheduled_fargate_task_image_options: nil) @schedule = schedule Jsii::Type.check_type(@schedule, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbGljYXRpb25hdXRvc2NhbGluZy5TY2hlZHVsZSJ9")), "schedule") @cluster = cluster Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLklDbHVzdGVyIn0=")), "cluster") unless @cluster.nil? @desired_task_count = desired_task_count Jsii::Type.check_type(@desired_task_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "desiredTaskCount") unless @desired_task_count.nil? @enabled = enabled Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") unless @enabled.nil? @propagate_tags = Jsii::Type.check_type(@propagate_tags, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlByb3BhZ2F0ZWRUYWdTb3VyY2UifQ==")), "propagateTags") unless @propagate_tags.nil? @rule_name = rule_name Jsii::Type.check_type(@rule_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ruleName") unless @rule_name.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? @vpc = vpc Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc") unless @vpc.nil? @circuit_breaker = circuit_breaker.is_a?(Hash) ? ::AWSCDK::ECS::DeploymentCircuitBreaker.new(**circuit_breaker.transform_keys(&:to_sym)) : circuit_breaker Jsii::Type.check_type(@circuit_breaker, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkRlcGxveW1lbnRDaXJjdWl0QnJlYWtlciJ9")), "circuitBreaker") unless @circuit_breaker.nil? @cpu = cpu Jsii::Type.check_type(@cpu, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "cpu") unless @cpu.nil? @ephemeral_storage_gib = ephemeral_storage_gib Jsii::Type.check_type(@ephemeral_storage_gib, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "ephemeralStorageGiB") unless @ephemeral_storage_gib.nil? @memory_limit_mib = memory_limit_mib Jsii::Type.check_type(@memory_limit_mib, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "memoryLimitMiB") unless @memory_limit_mib.nil? @platform_version = platform_version Jsii::Type.check_type(@platform_version, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkZhcmdhdGVQbGF0Zm9ybVZlcnNpb24ifQ==")), "platformVersion") unless @platform_version.nil? @runtime_platform = runtime_platform.is_a?(Hash) ? ::AWSCDK::ECS::RuntimePlatform.new(**runtime_platform.transform_keys(&:to_sym)) : runtime_platform Jsii::Type.check_type(@runtime_platform, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlJ1bnRpbWVQbGF0Zm9ybSJ9")), "runtimePlatform") unless @runtime_platform.nil? @task_definition = task_definition Jsii::Type.check_type(@task_definition, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkZhcmdhdGVUYXNrRGVmaW5pdGlvbiJ9")), "taskDefinition") unless @task_definition.nil? @scheduled_fargate_task_definition_options = .is_a?(Hash) ? ::AWSCDK::ECSPatterns::ScheduledFargateTaskDefinitionOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@scheduled_fargate_task_definition_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzX3BhdHRlcm5zLlNjaGVkdWxlZEZhcmdhdGVUYXNrRGVmaW5pdGlvbk9wdGlvbnMifQ==")), "scheduledFargateTaskDefinitionOptions") unless @scheduled_fargate_task_definition_options.nil? @scheduled_fargate_task_image_options = .is_a?(Hash) ? ::AWSCDK::ECSPatterns::ScheduledFargateTaskImageOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@scheduled_fargate_task_image_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzX3BhdHRlcm5zLlNjaGVkdWxlZEZhcmdhdGVUYXNrSW1hZ2VPcHRpb25zIn0=")), "scheduledFargateTaskImageOptions") unless @scheduled_fargate_task_image_options.nil? end |
Instance Attribute Details
#circuit_breaker ⇒ AWSCDK::ECS::DeploymentCircuitBreaker? (readonly)
Default: - disabled
Whether to enable the deployment circuit breaker.
If this property is defined, circuit breaker will be implicitly enabled.
138 139 140 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 138 def circuit_breaker @circuit_breaker end |
#cluster ⇒ AWSCDK::ECS::ICluster? (readonly)
Default: - create a new cluster; if both cluster and vpc are omitted, a new VPC will be created for you.
The name of the cluster that hosts the service.
If a cluster is specified, the vpc construct should be omitted. Alternatively, you can omit both cluster and vpc.
82 83 84 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 82 def cluster @cluster end |
#cpu ⇒ Numeric? (readonly)
Default: 256
The number of cpu units used by the task.
Valid values, which determines your range of valid values for the memory parameter:
256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB
512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB
1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB
2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments
4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments
8192 (8 vCPU) - Available memory values: Between 16GB and 60GB in 4GB increments
16384 (16 vCPU) - Available memory values: Between 32GB and 120GB in 8GB increments
This default is set in the underlying FargateTaskDefinition construct.
161 162 163 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 161 def cpu @cpu end |
#desired_task_count ⇒ Numeric? (readonly)
Default: 1
The desired number of instantiations of the task definition to keep running on the service.
87 88 89 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 87 def desired_task_count @desired_task_count end |
#enabled ⇒ Boolean? (readonly)
Default: true
Indicates whether the rule is enabled.
92 93 94 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 92 def enabled @enabled end |
#ephemeral_storage_gib ⇒ Numeric? (readonly)
Default: Undefined, in which case, the task will receive 20GiB ephemeral storage.
The amount (in GiB) of ephemeral storage to be allocated to the task.
The minimum supported value is 21 GiB and the maximum supported value is 200 GiB.
Only supported in Fargate platform version 1.4.0 or later.
170 171 172 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 170 def ephemeral_storage_gib @ephemeral_storage_gib end |
#memory_limit_mib ⇒ Numeric? (readonly)
Default: 512
The amount (in MiB) of memory used by the task.
This field is required and you must use one of the following values, which determines your range of valid values for the cpu parameter:
512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU)
1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU)
2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU)
Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 (2 vCPU)
Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 vCPU)
Between 16384 (16 GB) and 61440 (60 GB) in increments of 4096 (4 GB) - Available cpu values: 8192 (8 vCPU)
Between 32768 (32 GB) and 122880 (120 GB) in increments of 8192 (8 GB) - Available cpu values: 16384 (16 vCPU)
This default is set in the underlying FargateTaskDefinition construct.
194 195 196 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 194 def memory_limit_mib @memory_limit_mib end |
#platform_version ⇒ AWSCDK::ECS::FargatePlatformVersion? (readonly)
Default: Latest
The platform version on which to run your service.
If one is not specified, the LATEST platform version is used by default. For more information, see AWS Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide.
203 204 205 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 203 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.
99 100 101 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 99 def @propagate_tags end |
#rule_name ⇒ String? (readonly)
Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the rule name. For more information, see Name Type.
A name for the rule.
104 105 106 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 104 def rule_name @rule_name end |
#runtime_platform ⇒ AWSCDK::ECS::RuntimePlatform? (readonly)
Default: - If the property is undefined, operatingSystemFamily is LINUX and cpuArchitecture is X86_64
The runtime platform of the task definition.
208 209 210 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 208 def runtime_platform @runtime_platform end |
#schedule ⇒ AWSCDK::ApplicationAutoScaling::Schedule (readonly)
The schedule or rate (frequency) that determines when CloudWatch Events runs the rule.
For more information, see Schedule Expression Syntax for Rules in the Amazon CloudWatch User Guide.
75 76 77 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 75 def schedule @schedule end |
#scheduled_fargate_task_definition_options ⇒ AWSCDK::ECSPatterns::ScheduledFargateTaskDefinitionOptions? (readonly)
Default: none
The properties to define if using an existing TaskDefinition in this construct.
ScheduledFargateTaskDefinitionOptions or ScheduledFargateTaskImageOptions must be defined, but not both.
222 223 224 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 222 def @scheduled_fargate_task_definition_options end |
#scheduled_fargate_task_image_options ⇒ AWSCDK::ECSPatterns::ScheduledFargateTaskImageOptions? (readonly)
Default: none
The properties to define if the construct is to create a TaskDefinition.
ScheduledFargateTaskDefinitionOptions or ScheduledFargateTaskImageOptions must be defined, but not both.
229 230 231 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 229 def @scheduled_fargate_task_image_options end |
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>? (readonly)
Default: - a new security group will be created.
Existing security groups to use for your service.
109 110 111 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 109 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)
116 117 118 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 116 def subnet_selection @subnet_selection end |
#tags ⇒ Array<AWSCDK::EventsTargets::Tag>? (readonly)
Default: - No 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.
123 124 125 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 123 def @tags end |
#task_definition ⇒ AWSCDK::ECS::FargateTaskDefinition? (readonly)
Default: - none
The task definition to use for tasks in the service. TaskDefinition or TaskImageOptions must be specified, but not both.
[disable-awslint:ref-via-interface]
215 216 217 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 215 def task_definition @task_definition end |
#vpc ⇒ AWSCDK::EC2::IVPC? (readonly)
Default: - uses the VPC defined in the cluster or creates a new VPC.
The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.
If a vpc is specified, the cluster construct should be omitted. Alternatively, you can omit both vpc and cluster.
130 131 132 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 130 def vpc @vpc end |
Class Method Details
.jsii_properties ⇒ Object
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 231 def self.jsii_properties { :schedule => "schedule", :cluster => "cluster", :desired_task_count => "desiredTaskCount", :enabled => "enabled", :propagate_tags => "propagateTags", :rule_name => "ruleName", :security_groups => "securityGroups", :subnet_selection => "subnetSelection", :tags => "tags", :vpc => "vpc", :circuit_breaker => "circuitBreaker", :cpu => "cpu", :ephemeral_storage_gib => "ephemeralStorageGiB", :memory_limit_mib => "memoryLimitMiB", :platform_version => "platformVersion", :runtime_platform => "runtimePlatform", :task_definition => "taskDefinition", :scheduled_fargate_task_definition_options => "scheduledFargateTaskDefinitionOptions", :scheduled_fargate_task_image_options => "scheduledFargateTaskImageOptions", } end |
Instance Method Details
#to_jsii ⇒ Object
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'ecs_patterns/scheduled_fargate_task_props.rb', line 255 def to_jsii result = {} result.merge!(super) result.merge!({ "schedule" => @schedule, "cluster" => @cluster, "desiredTaskCount" => @desired_task_count, "enabled" => @enabled, "propagateTags" => @propagate_tags, "ruleName" => @rule_name, "securityGroups" => @security_groups, "subnetSelection" => @subnet_selection, "tags" => @tags, "vpc" => @vpc, "circuitBreaker" => @circuit_breaker, "cpu" => @cpu, "ephemeralStorageGiB" => @ephemeral_storage_gib, "memoryLimitMiB" => @memory_limit_mib, "platformVersion" => @platform_version, "runtimePlatform" => @runtime_platform, "taskDefinition" => @task_definition, "scheduledFargateTaskDefinitionOptions" => @scheduled_fargate_task_definition_options, "scheduledFargateTaskImageOptions" => @scheduled_fargate_task_image_options, }) result.compact end |