Class: AWSCDK::ECSPatterns::QueueProcessingFargateServiceProps

Inherits:
QueueProcessingServiceBaseProps
  • Object
show all
Defined in:
ecs_patterns/queue_processing_fargate_service_props.rb

Overview

The properties for the QueueProcessingFargateService service.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(capacity_provider_strategies: nil, circuit_breaker: nil, cluster: nil, command: nil, cooldown: nil, cpu_target_utilization_percent: nil, deployment_controller: nil, disable_cpu_based_scaling: nil, enable_ecs_managed_tags: nil, enable_execute_command: nil, enable_logging: nil, environment: nil, family: nil, image: nil, log_driver: nil, max_healthy_percent: nil, max_receive_count: nil, max_scaling_capacity: nil, min_healthy_percent: nil, min_scaling_capacity: nil, propagate_tags: nil, queue: nil, retention_period: nil, scaling_steps: nil, secrets: nil, service_name: nil, visibility_timeout: nil, vpc: nil, cpu: nil, ephemeral_storage_gib: nil, memory_limit_mib: nil, platform_version: nil, runtime_platform: nil, task_definition: nil, assign_public_ip: nil, container_name: nil, health_check: nil, health_check_grace_period: nil, security_groups: nil, task_subnets: nil) ⇒ QueueProcessingFargateServiceProps

Returns a new instance of QueueProcessingFargateServiceProps.

Parameters:

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

    A list of Capacity Provider strategies used to place a service.

  • circuit_breaker (AWSCDK::ECS::DeploymentCircuitBreaker, nil) (defaults to: nil)

    Whether to enable the deployment circuit breaker.

  • cluster (AWSCDK::ECS::ICluster, nil) (defaults to: nil)

    The name of the cluster that hosts the service.

  • command (Array<String>, nil) (defaults to: nil)

    The command that is passed to the container.

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

    Grace period after scaling activity in seconds.

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

    The target CPU utilization percentage for CPU based scaling strategy when enabled.

  • deployment_controller (AWSCDK::ECS::DeploymentController, nil) (defaults to: nil)

    Specifies which deployment controller to use for the service.

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

    Flag to disable CPU based auto scaling strategy on the service.

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

    Specifies whether to enable Amazon ECS managed tags for the tasks within the service.

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

    Whether ECS Exec should be enabled.

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

    Flag to indicate whether to enable logging.

  • environment (Hash{String => String}, nil) (defaults to: nil)

    The environment variables to pass to the container.

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

    The name of a family that the task definition is registered to.

  • image (AWSCDK::ECS::ContainerImage, nil) (defaults to: nil)

    The image used to start a container.

  • log_driver (AWSCDK::ECS::LogDriver, nil) (defaults to: nil)

    The log driver to use.

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

    The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.

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

    The maximum number of times that a message can be received by consumers.

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

    Maximum capacity to scale to.

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

    The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment.

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

    Minimum capacity to scale to.

  • propagate_tags (AWSCDK::ECS::PropagatedTagSource, nil) (defaults to: nil)

    Specifies whether to propagate the tags from the task definition or the service to the tasks in the service.

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

    A queue for which to process items from.

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

    The number of seconds that Dead Letter Queue retains a message.

  • scaling_steps (Array<AWSCDK::ApplicationAutoScaling::ScalingInterval>, nil) (defaults to: nil)

    The intervals for scaling based on the SQS queue's ApproximateNumberOfMessagesVisible metric.

  • secrets (Hash{String => AWSCDK::ECS::Secret}, nil) (defaults to: nil)

    The secret to expose to the container as an environment variable.

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

    The name of the service.

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

    Timeout of processing a single message.

  • vpc (AWSCDK::EC2::IVPC, nil) (defaults to: nil)

    The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.

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

    The number of cpu units used by the task.

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

    The amount (in GiB) of ephemeral storage to be allocated to the task.

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

    The amount (in MiB) of memory used by the task.

  • platform_version (AWSCDK::ECS::FargatePlatformVersion, nil) (defaults to: nil)

    The platform version on which to run your service.

  • runtime_platform (AWSCDK::ECS::RuntimePlatform, nil) (defaults to: nil)

    The runtime platform of the task definition.

  • task_definition (AWSCDK::ECS::FargateTaskDefinition, nil) (defaults to: nil)

    The task definition to use for tasks in the service. TaskDefinition or TaskImageOptions must be specified, but not both.

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

    Specifies whether the task's elastic network interface receives a public IP address.

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

    Optional name for the container added.

  • health_check (AWSCDK::ECS::HealthCheck, nil) (defaults to: nil)

    The health check command and associated configuration parameters for the container.

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

    The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.

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

    The security groups to associate with the service.

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

    The subnets to associate with the service.



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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 48

def initialize(capacity_provider_strategies: nil, circuit_breaker: nil, cluster: nil, command: nil, cooldown: nil, cpu_target_utilization_percent: nil, deployment_controller: nil, disable_cpu_based_scaling: nil, enable_ecs_managed_tags: nil, enable_execute_command: nil, enable_logging: nil, environment: nil, family: nil, image: nil, log_driver: nil, max_healthy_percent: nil, max_receive_count: nil, max_scaling_capacity: nil, min_healthy_percent: nil, min_scaling_capacity: nil, propagate_tags: nil, queue: nil, retention_period: nil, scaling_steps: nil, secrets: nil, service_name: nil, visibility_timeout: nil, vpc: nil, cpu: nil, ephemeral_storage_gib: nil, memory_limit_mib: nil, platform_version: nil, runtime_platform: nil, task_definition: nil, assign_public_ip: nil, container_name: nil, health_check: nil, health_check_grace_period: nil, security_groups: nil, task_subnets: nil)
  @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?
  @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?
  @cluster = cluster
  Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLklDbHVzdGVyIn0=")), "cluster") unless @cluster.nil?
  @command = command
  Jsii::Type.check_type(@command, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "command") unless @command.nil?
  @cooldown = cooldown
  Jsii::Type.check_type(@cooldown, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "cooldown") unless @cooldown.nil?
  @cpu_target_utilization_percent = cpu_target_utilization_percent
  Jsii::Type.check_type(@cpu_target_utilization_percent, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "cpuTargetUtilizationPercent") unless @cpu_target_utilization_percent.nil?
  @deployment_controller = deployment_controller.is_a?(Hash) ? ::AWSCDK::ECS::DeploymentController.new(**deployment_controller.transform_keys(&:to_sym)) : deployment_controller
  Jsii::Type.check_type(@deployment_controller, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkRlcGxveW1lbnRDb250cm9sbGVyIn0=")), "deploymentController") unless @deployment_controller.nil?
  @disable_cpu_based_scaling = disable_cpu_based_scaling
  Jsii::Type.check_type(@disable_cpu_based_scaling, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "disableCpuBasedScaling") unless @disable_cpu_based_scaling.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?
  @enable_logging = enable_logging
  Jsii::Type.check_type(@enable_logging, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableLogging") unless @enable_logging.nil?
  @environment = environment
  Jsii::Type.check_type(@environment, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "environment") unless @environment.nil?
  @family = family
  Jsii::Type.check_type(@family, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "family") unless @family.nil?
  @image = image
  Jsii::Type.check_type(@image, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNvbnRhaW5lckltYWdlIn0=")), "image") unless @image.nil?
  @log_driver = log_driver
  Jsii::Type.check_type(@log_driver, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkxvZ0RyaXZlciJ9")), "logDriver") unless @log_driver.nil?
  @max_healthy_percent = max_healthy_percent
  Jsii::Type.check_type(@max_healthy_percent, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxHealthyPercent") unless @max_healthy_percent.nil?
  @max_receive_count = max_receive_count
  Jsii::Type.check_type(@max_receive_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxReceiveCount") unless @max_receive_count.nil?
  @max_scaling_capacity = max_scaling_capacity
  Jsii::Type.check_type(@max_scaling_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxScalingCapacity") unless @max_scaling_capacity.nil?
  @min_healthy_percent = min_healthy_percent
  Jsii::Type.check_type(@min_healthy_percent, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minHealthyPercent") unless @min_healthy_percent.nil?
  @min_scaling_capacity = min_scaling_capacity
  Jsii::Type.check_type(@min_scaling_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minScalingCapacity") unless @min_scaling_capacity.nil?
  @propagate_tags = propagate_tags
  Jsii::Type.check_type(@propagate_tags, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlByb3BhZ2F0ZWRUYWdTb3VyY2UifQ==")), "propagateTags") unless @propagate_tags.nil?
  @queue = queue
  Jsii::Type.check_type(@queue, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLklRdWV1ZSJ9")), "queue") unless @queue.nil?
  @retention_period = retention_period
  Jsii::Type.check_type(@retention_period, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "retentionPeriod") unless @retention_period.nil?
  @scaling_steps = scaling_steps.is_a?(Array) ? scaling_steps.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::ScalingInterval.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : scaling_steps
  Jsii::Type.check_type(@scaling_steps, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLlNjYWxpbmdJbnRlcnZhbCJ9LCJraW5kIjoiYXJyYXkifX0=")), "scalingSteps") unless @scaling_steps.nil?
  @secrets = secrets
  Jsii::Type.check_type(@secrets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuU2VjcmV0In0sImtpbmQiOiJtYXAifX0=")), "secrets") unless @secrets.nil?
  @service_name = service_name
  Jsii::Type.check_type(@service_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "serviceName") unless @service_name.nil?
  @visibility_timeout = visibility_timeout
  Jsii::Type.check_type(@visibility_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "visibilityTimeout") unless @visibility_timeout.nil?
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc") unless @vpc.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?
  @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_name = container_name
  Jsii::Type.check_type(@container_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerName") unless @container_name.nil?
  @health_check = health_check.is_a?(Hash) ? ::AWSCDK::ECS::HealthCheck.new(**health_check.transform_keys(&:to_sym)) : health_check
  Jsii::Type.check_type(@health_check, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkhlYWx0aENoZWNrIn0=")), "healthCheck") unless @health_check.nil?
  @health_check_grace_period = health_check_grace_period
  Jsii::Type.check_type(@health_check_grace_period, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "healthCheckGracePeriod") unless @health_check_grace_period.nil?
  @security_groups = security_groups
  Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups") unless @security_groups.nil?
  @task_subnets = task_subnets.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**task_subnets.transform_keys(&:to_sym)) : task_subnets
  Jsii::Type.check_type(@task_subnets, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "taskSubnets") unless @task_subnets.nil?
end

Instance Attribute Details

#assign_public_ipBoolean? (readonly)

Note:

Default: false

Specifies whether the task's elastic network interface receives a public IP address.

If true, each task will receive a public IP address.

Returns:

  • (Boolean, nil)


402
403
404
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 402

def assign_public_ip
  @assign_public_ip
end

#capacity_provider_strategiesArray<AWSCDK::ECS::CapacityProviderStrategy>? (readonly)

Note:

Default: - undefined

A list of Capacity Provider strategies used to place a service.

Returns:



135
136
137
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 135

def capacity_provider_strategies
  @capacity_provider_strategies
end

#circuit_breakerAWSCDK::ECS::DeploymentCircuitBreaker? (readonly)

Note:

Default: - disabled

Whether to enable the deployment circuit breaker.

If this property is defined, circuit breaker will be implicitly enabled.



143
144
145
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 143

def circuit_breaker
  @circuit_breaker
end

#clusterAWSCDK::ECS::ICluster? (readonly)

Note:

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.

Returns:



150
151
152
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 150

def cluster
  @cluster
end

#commandArray<String>? (readonly)

Note:

Default: - CMD value built into container image.

The command that is passed to the container.

If you provide a shell command as a single string, you have to quote command-line arguments.

Returns:

  • (Array<String>, nil)


157
158
159
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 157

def command
  @command
end

#container_nameString? (readonly)

Note:

Default: - QueueProcessingContainer

Optional name for the container added.

This name is not used when task_definition is provided.

Returns:

  • (String, nil)


409
410
411
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 409

def container_name
  @container_name
end

#cooldownAWSCDK::Duration? (readonly)

Note:

Default: 300 seconds

Grace period after scaling activity in seconds.

Subsequent scale outs during the cooldown period are squashed so that only the biggest scale out happens.

Subsequent scale ins during the cooldown period are ignored.



168
169
170
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 168

def cooldown
  @cooldown
end

#cpuNumeric? (readonly)

Note:

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.

Returns:

  • (Numeric, nil)


341
342
343
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 341

def cpu
  @cpu
end

#cpu_target_utilization_percentNumeric? (readonly)

Note:

Default: - 50

The target CPU utilization percentage for CPU based scaling strategy when enabled.

Returns:

  • (Numeric, nil)


173
174
175
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 173

def cpu_target_utilization_percent
  @cpu_target_utilization_percent
end

#deployment_controllerAWSCDK::ECS::DeploymentController? (readonly)

Note:

Default: - Rolling update (ECS)

Specifies which deployment controller to use for the service.

For more information, see Amazon ECS Deployment Types



181
182
183
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 181

def deployment_controller
  @deployment_controller
end

#disable_cpu_based_scalingBoolean? (readonly)

Note:

Default: - false

Flag to disable CPU based auto scaling strategy on the service.

Returns:

  • (Boolean, nil)


186
187
188
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 186

def disable_cpu_based_scaling
  @disable_cpu_based_scaling
end

#enable_ecs_managed_tagsBoolean? (readonly)

Note:

Default: false

Specifies whether to enable Amazon ECS managed tags for the tasks within the service.

For more information, see Tagging Your Amazon ECS Resources

Returns:

  • (Boolean, nil)


194
195
196
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 194

def enable_ecs_managed_tags
  @enable_ecs_managed_tags
end

#enable_execute_commandBoolean? (readonly)

Note:

Default: - false

Whether ECS Exec should be enabled.

Returns:

  • (Boolean, nil)


199
200
201
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 199

def enable_execute_command
  @enable_execute_command
end

#enable_loggingBoolean? (readonly)

Note:

Default: true

Flag to indicate whether to enable logging.

Returns:

  • (Boolean, nil)


204
205
206
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 204

def enable_logging
  @enable_logging
end

#environmentHash{String => String}? (readonly)

Note:

Default: 'QUEUE_NAME: queue.queueName'

The environment variables to pass to the container.

The variable QUEUE_NAME with value queue.queueName will always be passed.

Returns:

  • (Hash{String => String}, nil)


212
213
214
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 212

def environment
  @environment
end

#ephemeral_storage_gibNumeric? (readonly)

Note:

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.

Returns:

  • (Numeric, nil)


350
351
352
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 350

def ephemeral_storage_gib
  @ephemeral_storage_gib
end

#familyString? (readonly)

Note:

Default: - Automatically generated name.

The name of a family that the task definition is registered to.

A family groups multiple versions of a task definition.

Returns:

  • (String, nil)


219
220
221
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 219

def family
  @family
end

#health_checkAWSCDK::ECS::HealthCheck? (readonly)

Note:

Default: - Health check configuration from container.

The health check command and associated configuration parameters for the container.

Returns:



414
415
416
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 414

def health_check
  @health_check
end

#health_check_grace_periodAWSCDK::Duration? (readonly)

Note:

Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set

The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.

Returns:



419
420
421
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 419

def health_check_grace_period
  @health_check_grace_period
end

#imageAWSCDK::ECS::ContainerImage? (readonly)

Note:

Default: - the image of the task definition is used for Fargate, required otherwise

The image used to start a container.

For QueueProcessingFargateService, either image or task_definition must be specified, but not both. For QueueProcessingEc2Service, image is required.

Returns:



227
228
229
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 227

def image
  @image
end

#log_driverAWSCDK::ECS::LogDriver? (readonly)

Note:

Default: - AwsLogDriver if enableLogging is true

The log driver to use.

Returns:



232
233
234
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 232

def log_driver
  @log_driver
end

#max_healthy_percentNumeric? (readonly)

Note:

Default: - default from underlying service.

The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.

Returns:

  • (Numeric, nil)


237
238
239
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 237

def max_healthy_percent
  @max_healthy_percent
end

#max_receive_countNumeric? (readonly)

Note:

Default: 3

The maximum number of times that a message can be received by consumers.

When this value is exceeded for a message the message will be automatically sent to the Dead Letter Queue.

If the queue construct is specified, maxReceiveCount should be omitted.

Returns:

  • (Numeric, nil)


246
247
248
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 246

def max_receive_count
  @max_receive_count
end

#max_scaling_capacityNumeric? (readonly)

Note:

Default: 2

Maximum capacity to scale to.

Returns:

  • (Numeric, nil)


251
252
253
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 251

def max_scaling_capacity
  @max_scaling_capacity
end

#memory_limit_mibNumeric? (readonly)

Note:

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.

Returns:

  • (Numeric, nil)


374
375
376
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 374

def memory_limit_mib
  @memory_limit_mib
end

#min_healthy_percentNumeric? (readonly)

Note:

Default: - default from underlying service.

The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment.

Returns:

  • (Numeric, nil)


256
257
258
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 256

def min_healthy_percent
  @min_healthy_percent
end

#min_scaling_capacityNumeric? (readonly)

Note:

Default: 1

Minimum capacity to scale to.

Returns:

  • (Numeric, nil)


261
262
263
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 261

def min_scaling_capacity
  @min_scaling_capacity
end

#platform_versionAWSCDK::ECS::FargatePlatformVersion? (readonly)

Note:

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.



383
384
385
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 383

def platform_version
  @platform_version
end

#propagate_tagsAWSCDK::ECS::PropagatedTagSource? (readonly)

Note:

Default: - none

Specifies whether to propagate the tags from the task definition or the service to the tasks in the service.

Tags can only be propagated to the tasks within the service during service creation.



268
269
270
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 268

def propagate_tags
  @propagate_tags
end

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

Note:

Default: 'SQSQueue with CloudFormation-generated name'

A queue for which to process items from.

If specified and this is a FIFO queue, the queue name must end in the string '.fifo'. See CreateQueue

Returns:



276
277
278
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 276

def queue
  @queue
end

#retention_periodAWSCDK::Duration? (readonly)

Note:

Default: Duration.days(14)

The number of seconds that Dead Letter Queue retains a message.

If the queue construct is specified, retentionPeriod should be omitted.

Returns:



283
284
285
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 283

def retention_period
  @retention_period
end

#runtime_platformAWSCDK::ECS::RuntimePlatform? (readonly)

Note:

Default: - If the property is undefined, operatingSystemFamily is LINUX and cpuArchitecture is X86_64

The runtime platform of the task definition.



388
389
390
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 388

def runtime_platform
  @runtime_platform
end

#scaling_stepsArray<AWSCDK::ApplicationAutoScaling::ScalingInterval>? (readonly)

Note:

Default: [{ upper: 0, change: -1 },{ lower: 100, change: +1 },{ lower: 500, change: +5 }]

The intervals for scaling based on the SQS queue's ApproximateNumberOfMessagesVisible metric.

Maps a range of metric values to a particular scaling behavior. See Simple and Step Scaling Policies for Amazon EC2 Auto Scaling



291
292
293
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 291

def scaling_steps
  @scaling_steps
end

#secretsHash{String => AWSCDK::ECS::Secret}? (readonly)

Note:

Default: - No secret environment variables.

The secret to expose to the container as an environment variable.

Returns:



296
297
298
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 296

def secrets
  @secrets
end

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

Note:

Default: - A new security group is created.

The security groups to associate with the service.

If you do not specify a security group, a new security group is created.

Returns:



426
427
428
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 426

def security_groups
  @security_groups
end

#service_nameString? (readonly)

Note:

Default: - CloudFormation-generated name.

The name of the service.

Returns:

  • (String, nil)


301
302
303
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 301

def service_name
  @service_name
end

#task_definitionAWSCDK::ECS::FargateTaskDefinition? (readonly)

Note:

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]



395
396
397
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 395

def task_definition
  @task_definition
end

#task_subnetsAWSCDK::EC2::SubnetSelection? (readonly)

Note:

Default: - Public subnets if assignPublicIp is set, otherwise the first available one of Private, Isolated, Public, in that order.

The subnets to associate with the service.



431
432
433
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 431

def task_subnets
  @task_subnets
end

#visibility_timeoutAWSCDK::Duration? (readonly)

Note:

Default: Duration.seconds(30)

Timeout of processing a single message.

After dequeuing, the processor has this much time to handle the message and delete it from the queue before it becomes visible again for dequeueing by another processor. Values must be between 0 and (12 hours).

If the queue construct is specified, visibilityTimeout should be omitted.

Returns:



311
312
313
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 311

def visibility_timeout
  @visibility_timeout
end

#vpcAWSCDK::EC2::IVPC? (readonly)

Note:

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.

Returns:



318
319
320
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 318

def vpc
  @vpc
end

Class Method Details

.jsii_propertiesObject



433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 433

def self.jsii_properties
  {
    :capacity_provider_strategies => "capacityProviderStrategies",
    :circuit_breaker => "circuitBreaker",
    :cluster => "cluster",
    :command => "command",
    :cooldown => "cooldown",
    :cpu_target_utilization_percent => "cpuTargetUtilizationPercent",
    :deployment_controller => "deploymentController",
    :disable_cpu_based_scaling => "disableCpuBasedScaling",
    :enable_ecs_managed_tags => "enableECSManagedTags",
    :enable_execute_command => "enableExecuteCommand",
    :enable_logging => "enableLogging",
    :environment => "environment",
    :family => "family",
    :image => "image",
    :log_driver => "logDriver",
    :max_healthy_percent => "maxHealthyPercent",
    :max_receive_count => "maxReceiveCount",
    :max_scaling_capacity => "maxScalingCapacity",
    :min_healthy_percent => "minHealthyPercent",
    :min_scaling_capacity => "minScalingCapacity",
    :propagate_tags => "propagateTags",
    :queue => "queue",
    :retention_period => "retentionPeriod",
    :scaling_steps => "scalingSteps",
    :secrets => "secrets",
    :service_name => "serviceName",
    :visibility_timeout => "visibilityTimeout",
    :vpc => "vpc",
    :cpu => "cpu",
    :ephemeral_storage_gib => "ephemeralStorageGiB",
    :memory_limit_mib => "memoryLimitMiB",
    :platform_version => "platformVersion",
    :runtime_platform => "runtimePlatform",
    :task_definition => "taskDefinition",
    :assign_public_ip => "assignPublicIp",
    :container_name => "containerName",
    :health_check => "healthCheck",
    :health_check_grace_period => "healthCheckGracePeriod",
    :security_groups => "securityGroups",
    :task_subnets => "taskSubnets",
  }
end

Instance Method Details

#to_jsiiObject



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'ecs_patterns/queue_processing_fargate_service_props.rb', line 478

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "capacityProviderStrategies" => @capacity_provider_strategies,
    "circuitBreaker" => @circuit_breaker,
    "cluster" => @cluster,
    "command" => @command,
    "cooldown" => @cooldown,
    "cpuTargetUtilizationPercent" => @cpu_target_utilization_percent,
    "deploymentController" => @deployment_controller,
    "disableCpuBasedScaling" => @disable_cpu_based_scaling,
    "enableECSManagedTags" => @enable_ecs_managed_tags,
    "enableExecuteCommand" => @enable_execute_command,
    "enableLogging" => @enable_logging,
    "environment" => @environment,
    "family" => @family,
    "image" => @image,
    "logDriver" => @log_driver,
    "maxHealthyPercent" => @max_healthy_percent,
    "maxReceiveCount" => @max_receive_count,
    "maxScalingCapacity" => @max_scaling_capacity,
    "minHealthyPercent" => @min_healthy_percent,
    "minScalingCapacity" => @min_scaling_capacity,
    "propagateTags" => @propagate_tags,
    "queue" => @queue,
    "retentionPeriod" => @retention_period,
    "scalingSteps" => @scaling_steps,
    "secrets" => @secrets,
    "serviceName" => @service_name,
    "visibilityTimeout" => @visibility_timeout,
    "vpc" => @vpc,
    "cpu" => @cpu,
    "ephemeralStorageGiB" => @ephemeral_storage_gib,
    "memoryLimitMiB" => @memory_limit_mib,
    "platformVersion" => @platform_version,
    "runtimePlatform" => @runtime_platform,
    "taskDefinition" => @task_definition,
    "assignPublicIp" => @assign_public_ip,
    "containerName" => @container_name,
    "healthCheck" => @health_check,
    "healthCheckGracePeriod" => @health_check_grace_period,
    "securityGroups" => @security_groups,
    "taskSubnets" => @task_subnets,
  })
  result.compact
end