Class: AWSCDK::ECS::EC2ServiceProps

Inherits:
BaseServiceOptions
  • Object
show all
Defined in:
ecs/ec2_service_props.rb

Overview

The properties for defining a service using the EC2 launch type.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cluster:, bake_time: nil, canary_configuration: nil, capacity_provider_strategies: nil, circuit_breaker: nil, cloud_map_options: nil, deployment_alarms: nil, deployment_controller: nil, deployment_strategy: nil, desired_count: nil, enable_ecs_managed_tags: nil, enable_execute_command: nil, force_new_deployment: nil, health_check_grace_period: nil, lifecycle_hooks: nil, linear_configuration: nil, max_healthy_percent: nil, min_healthy_percent: nil, propagate_tags: nil, service_connect_configuration: nil, service_name: nil, task_definition_revision: nil, volume_configurations: nil, task_definition:, assign_public_ip: nil, availability_zone_rebalancing: nil, daemon: nil, placement_constraints: nil, placement_strategies: nil, security_groups: nil, vpc_subnets: nil) ⇒ EC2ServiceProps

Returns a new instance of EC2ServiceProps.

Parameters:

  • cluster (AWSCDK::ECS::ICluster)

    The name of the cluster that hosts the service.

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

    bake time minutes for service.

  • canary_configuration (AWSCDK::ECS::TrafficShiftConfig, nil) (defaults to: nil)

    Configuration for canary deployment strategy.

  • 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.

  • cloud_map_options (AWSCDK::ECS::CloudMapOptions, nil) (defaults to: nil)

    The options for configuring an Amazon ECS service to use service discovery.

  • deployment_alarms (AWSCDK::ECS::DeploymentAlarmConfig, nil) (defaults to: nil)

    The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time.

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

    Specifies which deployment controller to use for the service.

  • deployment_strategy (AWSCDK::ECS::DeploymentStrategy, nil) (defaults to: nil)

    The deployment strategy to use for the service.

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

    The desired number of instantiations of the task definition to keep running 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 to enable the ability to execute into a container.

  • force_new_deployment (AWSCDK::ECS::ForceNewDeployment, nil) (defaults to: nil)

    Configuration for forcing a new deployment of the service.

  • 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.

  • lifecycle_hooks (Array<AWSCDK::ECS::IDeploymentLifecycleHookTarget>, nil) (defaults to: nil)

    The lifecycle hooks to execute during deployment stages.

  • linear_configuration (AWSCDK::ECS::TrafficShiftConfig, nil) (defaults to: nil)

    Configuration for linear deployment strategy.

  • 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.

  • 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.

  • 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.

  • service_connect_configuration (AWSCDK::ECS::ServiceConnectProps, nil) (defaults to: nil)

    Configuration for Service Connect.

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

    The name of the service.

  • task_definition_revision (AWSCDK::ECS::TaskDefinitionRevision, nil) (defaults to: nil)

    Revision number for the task definition or latest to use the latest active task revision.

  • volume_configurations (Array<AWSCDK::ECS::ServiceManagedVolume>, nil) (defaults to: nil)

    Configuration details for a volume used by the service.

  • task_definition (AWSCDK::ECS::TaskDefinition)

    The task definition to use for tasks in the service.

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

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

  • availability_zone_rebalancing (AWSCDK::ECS::AvailabilityZoneRebalancing, nil) (defaults to: nil)

    Whether to use Availability Zone rebalancing for the service.

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

    Specifies whether the service will use the daemon scheduling strategy.

  • placement_constraints (Array<AWSCDK::ECS::PlacementConstraint>, nil) (defaults to: nil)

    The placement constraints to use for tasks in the service.

  • placement_strategies (Array<AWSCDK::ECS::PlacementStrategy>, nil) (defaults to: nil)

    The placement strategies to use for tasks in the service.

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

    The security groups to associate with the service.

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

    The subnets to associate with the service.



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
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
# File 'ecs/ec2_service_props.rb', line 38

def initialize(cluster:, bake_time: nil, canary_configuration: nil, capacity_provider_strategies: nil, circuit_breaker: nil, cloud_map_options: nil, deployment_alarms: nil, deployment_controller: nil, deployment_strategy: nil, desired_count: nil, enable_ecs_managed_tags: nil, enable_execute_command: nil, force_new_deployment: nil, health_check_grace_period: nil, lifecycle_hooks: nil, linear_configuration: nil, max_healthy_percent: nil, min_healthy_percent: nil, propagate_tags: nil, service_connect_configuration: nil, service_name: nil, task_definition_revision: nil, volume_configurations: nil, task_definition:, assign_public_ip: nil, availability_zone_rebalancing: nil, daemon: nil, placement_constraints: nil, placement_strategies: nil, security_groups: nil, vpc_subnets: nil)
  @cluster = cluster
  Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLklDbHVzdGVyIn0=")), "cluster")
  @bake_time = bake_time
  Jsii::Type.check_type(@bake_time, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "bakeTime") unless @bake_time.nil?
  @canary_configuration = canary_configuration.is_a?(Hash) ? ::AWSCDK::ECS::TrafficShiftConfig.new(**canary_configuration.transform_keys(&:to_sym)) : canary_configuration
  Jsii::Type.check_type(@canary_configuration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlRyYWZmaWNTaGlmdENvbmZpZyJ9")), "canaryConfiguration") unless @canary_configuration.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?
  @cloud_map_options = cloud_map_options.is_a?(Hash) ? ::AWSCDK::ECS::CloudMapOptions.new(**cloud_map_options.transform_keys(&:to_sym)) : cloud_map_options
  Jsii::Type.check_type(@cloud_map_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNsb3VkTWFwT3B0aW9ucyJ9")), "cloudMapOptions") unless @cloud_map_options.nil?
  @deployment_alarms = deployment_alarms.is_a?(Hash) ? ::AWSCDK::ECS::DeploymentAlarmConfig.new(**deployment_alarms.transform_keys(&:to_sym)) : deployment_alarms
  Jsii::Type.check_type(@deployment_alarms, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkRlcGxveW1lbnRBbGFybUNvbmZpZyJ9")), "deploymentAlarms") unless @deployment_alarms.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?
  @deployment_strategy = deployment_strategy
  Jsii::Type.check_type(@deployment_strategy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkRlcGxveW1lbnRTdHJhdGVneSJ9")), "deploymentStrategy") unless @deployment_strategy.nil?
  @desired_count = desired_count
  Jsii::Type.check_type(@desired_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "desiredCount") unless @desired_count.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?
  @force_new_deployment = force_new_deployment.is_a?(Hash) ? ::AWSCDK::ECS::ForceNewDeployment.new(**force_new_deployment.transform_keys(&:to_sym)) : force_new_deployment
  Jsii::Type.check_type(@force_new_deployment, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkZvcmNlTmV3RGVwbG95bWVudCJ9")), "forceNewDeployment") unless @force_new_deployment.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?
  @lifecycle_hooks = lifecycle_hooks
  Jsii::Type.check_type(@lifecycle_hooks, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuSURlcGxveW1lbnRMaWZlY3ljbGVIb29rVGFyZ2V0In0sImtpbmQiOiJhcnJheSJ9fQ==")), "lifecycleHooks") unless @lifecycle_hooks.nil?
  @linear_configuration = linear_configuration.is_a?(Hash) ? ::AWSCDK::ECS::TrafficShiftConfig.new(**linear_configuration.transform_keys(&:to_sym)) : linear_configuration
  Jsii::Type.check_type(@linear_configuration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlRyYWZmaWNTaGlmdENvbmZpZyJ9")), "linearConfiguration") unless @linear_configuration.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?
  @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?
  @propagate_tags = propagate_tags
  Jsii::Type.check_type(@propagate_tags, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlByb3BhZ2F0ZWRUYWdTb3VyY2UifQ==")), "propagateTags") unless @propagate_tags.nil?
  @service_connect_configuration = service_connect_configuration.is_a?(Hash) ? ::AWSCDK::ECS::ServiceConnectProps.new(**service_connect_configuration.transform_keys(&:to_sym)) : service_connect_configuration
  Jsii::Type.check_type(@service_connect_configuration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlNlcnZpY2VDb25uZWN0UHJvcHMifQ==")), "serviceConnectConfiguration") unless @service_connect_configuration.nil?
  @service_name = service_name
  Jsii::Type.check_type(@service_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "serviceName") unless @service_name.nil?
  @task_definition_revision = task_definition_revision
  Jsii::Type.check_type(@task_definition_revision, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlRhc2tEZWZpbml0aW9uUmV2aXNpb24ifQ==")), "taskDefinitionRevision") unless @task_definition_revision.nil?
  @volume_configurations = volume_configurations
  Jsii::Type.check_type(@volume_configurations, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuU2VydmljZU1hbmFnZWRWb2x1bWUifSwia2luZCI6ImFycmF5In19")), "volumeConfigurations") unless @volume_configurations.nil?
  @task_definition = task_definition
  Jsii::Type.check_type(@task_definition, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlRhc2tEZWZpbml0aW9uIn0=")), "taskDefinition")
  @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?
  @availability_zone_rebalancing = availability_zone_rebalancing
  Jsii::Type.check_type(@availability_zone_rebalancing, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkF2YWlsYWJpbGl0eVpvbmVSZWJhbGFuY2luZyJ9")), "availabilityZoneRebalancing") unless @availability_zone_rebalancing.nil?
  @daemon = daemon
  Jsii::Type.check_type(@daemon, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "daemon") unless @daemon.nil?
  @placement_constraints = placement_constraints
  Jsii::Type.check_type(@placement_constraints, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuUGxhY2VtZW50Q29uc3RyYWludCJ9LCJraW5kIjoiYXJyYXkifX0=")), "placementConstraints") unless @placement_constraints.nil?
  @placement_strategies = placement_strategies
  Jsii::Type.check_type(@placement_strategies, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuUGxhY2VtZW50U3RyYXRlZ3kifSwia2luZCI6ImFycmF5In19")), "placementStrategies") unless @placement_strategies.nil?
  @security_groups = security_groups
  Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups") unless @security_groups.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

#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.

This property is only used for tasks that use the awsvpc network mode.

Returns:

  • (Boolean, nil)


260
261
262
# File 'ecs/ec2_service_props.rb', line 260

def assign_public_ip
  @assign_public_ip
end

#availability_zone_rebalancingAWSCDK::ECS::AvailabilityZoneRebalancing? (readonly)

Note:

Default: AvailabilityZoneRebalancing.ENABLED

Whether to use Availability Zone rebalancing for the service.

If enabled: max_healthy_percent must be greater than 100; daemon must be false; if there are any placement_strategies, the first must be "spread across Availability Zones"; there must be no placement_constraints using attribute:ecs.availability-zone, and the service must not be a target of a Classic Load Balancer.



271
272
273
# File 'ecs/ec2_service_props.rb', line 271

def availability_zone_rebalancing
  @availability_zone_rebalancing
end

#bake_timeAWSCDK::Duration? (readonly)

Note:

Default: - none

bake time minutes for service.

Returns:



111
112
113
# File 'ecs/ec2_service_props.rb', line 111

def bake_time
  @bake_time
end

#canary_configurationAWSCDK::ECS::TrafficShiftConfig? (readonly)

Note:

Default: - no canary configuration

Configuration for canary deployment strategy.

Only valid when deploymentStrategy is set to CANARY.



118
119
120
# File 'ecs/ec2_service_props.rb', line 118

def canary_configuration
  @canary_configuration
end

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

Note:

Default: - undefined

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

Returns:



123
124
125
# File 'ecs/ec2_service_props.rb', line 123

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.



131
132
133
# File 'ecs/ec2_service_props.rb', line 131

def circuit_breaker
  @circuit_breaker
end

#cloud_map_optionsAWSCDK::ECS::CloudMapOptions? (readonly)

Note:

Default: - AWS Cloud Map service discovery is not enabled.

The options for configuring an Amazon ECS service to use service discovery.



136
137
138
# File 'ecs/ec2_service_props.rb', line 136

def cloud_map_options
  @cloud_map_options
end

#clusterAWSCDK::ECS::ICluster (readonly)

The name of the cluster that hosts the service.



106
107
108
# File 'ecs/ec2_service_props.rb', line 106

def cluster
  @cluster
end

#daemonBoolean? (readonly)

Note:

Default: false

Specifies whether the service will use the daemon scheduling strategy.

If true, the service scheduler deploys exactly one task on each container instance in your cluster.

When you are using this strategy, do not specify a desired number of tasks or any task placement strategies.

Returns:

  • (Boolean, nil)


280
281
282
# File 'ecs/ec2_service_props.rb', line 280

def daemon
  @daemon
end

#deployment_alarmsAWSCDK::ECS::DeploymentAlarmConfig? (readonly)

Note:

Default: - No alarms will be monitored during deployment.

The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time.



141
142
143
# File 'ecs/ec2_service_props.rb', line 141

def deployment_alarms
  @deployment_alarms
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



149
150
151
# File 'ecs/ec2_service_props.rb', line 149

def deployment_controller
  @deployment_controller
end

#deployment_strategyAWSCDK::ECS::DeploymentStrategy? (readonly)

Note:

Default: ROLLING

The deployment strategy to use for the service.



154
155
156
# File 'ecs/ec2_service_props.rb', line 154

def deployment_strategy
  @deployment_strategy
end

#desired_countNumeric? (readonly)

Note:

Default: - When creating the service, default is 1; when updating the service, default uses the current task number.

The desired number of instantiations of the task definition to keep running on the service.

Returns:

  • (Numeric, nil)


159
160
161
# File 'ecs/ec2_service_props.rb', line 159

def desired_count
  @desired_count
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)


167
168
169
# File 'ecs/ec2_service_props.rb', line 167

def enable_ecs_managed_tags
  @enable_ecs_managed_tags
end

#enable_execute_commandBoolean? (readonly)

Note:

Default: - undefined

Whether to enable the ability to execute into a container.

Returns:

  • (Boolean, nil)


172
173
174
# File 'ecs/ec2_service_props.rb', line 172

def enable_execute_command
  @enable_execute_command
end

#force_new_deploymentAWSCDK::ECS::ForceNewDeployment? (readonly)

Note:

Default: - no forced deployment

Configuration for forcing a new deployment of the service.

By default, deployments aren't forced. You can use this option to start a new deployment with no service definition changes. For example, you can update a service's tasks to use a newer Docker image with the same image/tag combination (my_image:latest) or to roll Fargate tasks onto a newer platform version.

This is equivalent to calling the force_new_deployment() method, but allows you to configure it declaratively at construction time, including the ability to explicitly disable it with enabled: false.



188
189
190
# File 'ecs/ec2_service_props.rb', line 188

def force_new_deployment
  @force_new_deployment
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:



193
194
195
# File 'ecs/ec2_service_props.rb', line 193

def health_check_grace_period
  @health_check_grace_period
end

#lifecycle_hooksArray<AWSCDK::ECS::IDeploymentLifecycleHookTarget>? (readonly)

Note:

Default: - none;

The lifecycle hooks to execute during deployment stages.



198
199
200
# File 'ecs/ec2_service_props.rb', line 198

def lifecycle_hooks
  @lifecycle_hooks
end

#linear_configurationAWSCDK::ECS::TrafficShiftConfig? (readonly)

Note:

Default: - no linear configuration

Configuration for linear deployment strategy.

Only valid when deploymentStrategy is set to LINEAR.



205
206
207
# File 'ecs/ec2_service_props.rb', line 205

def linear_configuration
  @linear_configuration
end

#max_healthy_percentNumeric? (readonly)

Note:

Default: - 100 if daemon, otherwise 200

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)


210
211
212
# File 'ecs/ec2_service_props.rb', line 210

def max_healthy_percent
  @max_healthy_percent
end

#min_healthy_percentNumeric? (readonly)

Note:

Default: - 0 if daemon, otherwise 50

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)


215
216
217
# File 'ecs/ec2_service_props.rb', line 215

def min_healthy_percent
  @min_healthy_percent
end

#placement_constraintsArray<AWSCDK::ECS::PlacementConstraint>? (readonly)

Note:

Default: - No constraints.

The placement constraints to use for tasks in the service.

For more information, see Amazon ECS Task Placement Constraints.

Returns:



288
289
290
# File 'ecs/ec2_service_props.rb', line 288

def placement_constraints
  @placement_constraints
end

#placement_strategiesArray<AWSCDK::ECS::PlacementStrategy>? (readonly)

Note:

Default: - No strategies.

The placement strategies to use for tasks in the service.

For more information, see Amazon ECS Task Placement Strategies.

Returns:



296
297
298
# File 'ecs/ec2_service_props.rb', line 296

def placement_strategies
  @placement_strategies
end

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

Note:

Default: PropagatedTagSource.NONE

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

Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE



222
223
224
# File 'ecs/ec2_service_props.rb', line 222

def propagate_tags
  @propagate_tags
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.

This property is only used for tasks that use the awsvpc network mode.

Returns:



305
306
307
# File 'ecs/ec2_service_props.rb', line 305

def security_groups
  @security_groups
end

#service_connect_configurationAWSCDK::ECS::ServiceConnectProps? (readonly)

Note:

Default: No ports are advertised via Service Connect on this service, and the service cannot make requests to other services via Service Connect.

Configuration for Service Connect.



227
228
229
# File 'ecs/ec2_service_props.rb', line 227

def service_connect_configuration
  @service_connect_configuration
end

#service_nameString? (readonly)

Note:

Default: - CloudFormation-generated name.

The name of the service.

Returns:

  • (String, nil)


232
233
234
# File 'ecs/ec2_service_props.rb', line 232

def service_name
  @service_name
end

#task_definitionAWSCDK::ECS::TaskDefinition (readonly)

The task definition to use for tasks in the service.

[disable-awslint:ref-via-interface]



251
252
253
# File 'ecs/ec2_service_props.rb', line 251

def task_definition
  @task_definition
end

#task_definition_revisionAWSCDK::ECS::TaskDefinitionRevision? (readonly)

Note:

Default: - Uses the revision of the passed task definition deployed by CloudFormation

Revision number for the task definition or latest to use the latest active task revision.



237
238
239
# File 'ecs/ec2_service_props.rb', line 237

def task_definition_revision
  @task_definition_revision
end

#volume_configurationsArray<AWSCDK::ECS::ServiceManagedVolume>? (readonly)

Note:

Default: - undefined

Configuration details for a volume used by the service.

This allows you to specify details about the EBS volume that can be attached to ECS tasks.

Returns:



245
246
247
# File 'ecs/ec2_service_props.rb', line 245

def volume_configurations
  @volume_configurations
end

#vpc_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.

This property is only used for tasks that use the awsvpc network mode.



312
313
314
# File 'ecs/ec2_service_props.rb', line 312

def vpc_subnets
  @vpc_subnets
end

Class Method Details

.jsii_propertiesObject



314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'ecs/ec2_service_props.rb', line 314

def self.jsii_properties
  {
    :cluster => "cluster",
    :bake_time => "bakeTime",
    :canary_configuration => "canaryConfiguration",
    :capacity_provider_strategies => "capacityProviderStrategies",
    :circuit_breaker => "circuitBreaker",
    :cloud_map_options => "cloudMapOptions",
    :deployment_alarms => "deploymentAlarms",
    :deployment_controller => "deploymentController",
    :deployment_strategy => "deploymentStrategy",
    :desired_count => "desiredCount",
    :enable_ecs_managed_tags => "enableECSManagedTags",
    :enable_execute_command => "enableExecuteCommand",
    :force_new_deployment => "forceNewDeployment",
    :health_check_grace_period => "healthCheckGracePeriod",
    :lifecycle_hooks => "lifecycleHooks",
    :linear_configuration => "linearConfiguration",
    :max_healthy_percent => "maxHealthyPercent",
    :min_healthy_percent => "minHealthyPercent",
    :propagate_tags => "propagateTags",
    :service_connect_configuration => "serviceConnectConfiguration",
    :service_name => "serviceName",
    :task_definition_revision => "taskDefinitionRevision",
    :volume_configurations => "volumeConfigurations",
    :task_definition => "taskDefinition",
    :assign_public_ip => "assignPublicIp",
    :availability_zone_rebalancing => "availabilityZoneRebalancing",
    :daemon => "daemon",
    :placement_constraints => "placementConstraints",
    :placement_strategies => "placementStrategies",
    :security_groups => "securityGroups",
    :vpc_subnets => "vpcSubnets",
  }
end

Instance Method Details

#to_jsiiObject



350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'ecs/ec2_service_props.rb', line 350

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "cluster" => @cluster,
    "bakeTime" => @bake_time,
    "canaryConfiguration" => @canary_configuration,
    "capacityProviderStrategies" => @capacity_provider_strategies,
    "circuitBreaker" => @circuit_breaker,
    "cloudMapOptions" => @cloud_map_options,
    "deploymentAlarms" => @deployment_alarms,
    "deploymentController" => @deployment_controller,
    "deploymentStrategy" => @deployment_strategy,
    "desiredCount" => @desired_count,
    "enableECSManagedTags" => @enable_ecs_managed_tags,
    "enableExecuteCommand" => @enable_execute_command,
    "forceNewDeployment" => @force_new_deployment,
    "healthCheckGracePeriod" => @health_check_grace_period,
    "lifecycleHooks" => @lifecycle_hooks,
    "linearConfiguration" => @linear_configuration,
    "maxHealthyPercent" => @max_healthy_percent,
    "minHealthyPercent" => @min_healthy_percent,
    "propagateTags" => @propagate_tags,
    "serviceConnectConfiguration" => @service_connect_configuration,
    "serviceName" => @service_name,
    "taskDefinitionRevision" => @task_definition_revision,
    "volumeConfigurations" => @volume_configurations,
    "taskDefinition" => @task_definition,
    "assignPublicIp" => @assign_public_ip,
    "availabilityZoneRebalancing" => @availability_zone_rebalancing,
    "daemon" => @daemon,
    "placementConstraints" => @placement_constraints,
    "placementStrategies" => @placement_strategies,
    "securityGroups" => @security_groups,
    "vpcSubnets" => @vpc_subnets,
  })
  result.compact
end