Class: AWSCDK::ECS::CfnServiceProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs/cfn_service_props.rb

Overview

Properties for defining a CfnService.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(availability_zone_rebalancing: nil, capacity_provider_strategy: nil, cluster: nil, deployment_configuration: nil, deployment_controller: nil, desired_count: nil, enable_ecs_managed_tags: nil, enable_execute_command: nil, force_new_deployment: nil, health_check_grace_period_seconds: nil, launch_type: nil, load_balancers: nil, monitoring: nil, network_configuration: nil, placement_constraints: nil, placement_strategies: nil, platform_version: nil, propagate_tags: nil, role: nil, scheduling_strategy: nil, service_connect_configuration: nil, service_name: nil, service_registries: nil, tags: nil, task_definition: nil, volume_configurations: nil, vpc_lattice_configurations: nil) ⇒ CfnServiceProps

Returns a new instance of CfnServiceProps.

Parameters:



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

def initialize(availability_zone_rebalancing: nil, capacity_provider_strategy: nil, cluster: nil, deployment_configuration: nil, deployment_controller: nil, desired_count: nil, enable_ecs_managed_tags: nil, enable_execute_command: nil, force_new_deployment: nil, health_check_grace_period_seconds: nil, launch_type: nil, load_balancers: nil, monitoring: nil, network_configuration: nil, placement_constraints: nil, placement_strategies: nil, platform_version: nil, propagate_tags: nil, role: nil, scheduling_strategy: nil, service_connect_configuration: nil, service_name: nil, service_registries: nil, tags: nil, task_definition: nil, volume_configurations: nil, vpc_lattice_configurations: nil)
  @availability_zone_rebalancing = availability_zone_rebalancing
  Jsii::Type.check_type(@availability_zone_rebalancing, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "availabilityZoneRebalancing") unless @availability_zone_rebalancing.nil?
  @capacity_provider_strategy = capacity_provider_strategy
  Jsii::Type.check_type(@capacity_provider_strategy, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblNlcnZpY2UuQ2FwYWNpdHlQcm92aWRlclN0cmF0ZWd5SXRlbVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "capacityProviderStrategy") unless @capacity_provider_strategy.nil?
  @cluster = cluster
  Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19lY3MuSUNsdXN0ZXJSZWYifV19fQ==")), "cluster") unless @cluster.nil?
  @deployment_configuration = deployment_configuration.is_a?(Hash) ? ::AWSCDK::ECS::CfnService::DeploymentConfigurationProperty.new(**deployment_configuration.transform_keys(&:to_sym)) : deployment_configuration
  Jsii::Type.check_type(@deployment_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuU2VydmljZS5EZXBsb3ltZW50Q29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "deploymentConfiguration") unless @deployment_configuration.nil?
  @deployment_controller = deployment_controller.is_a?(Hash) ? ::AWSCDK::ECS::CfnService::DeploymentControllerProperty.new(**deployment_controller.transform_keys(&:to_sym)) : deployment_controller
  Jsii::Type.check_type(@deployment_controller, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuU2VydmljZS5EZXBsb3ltZW50Q29udHJvbGxlclByb3BlcnR5In1dfX0=")), "deploymentController") unless @deployment_controller.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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enableExecuteCommand") unless @enable_execute_command.nil?
  @force_new_deployment = force_new_deployment.is_a?(Hash) ? ::AWSCDK::ECS::CfnService::ForceNewDeploymentProperty.new(**force_new_deployment.transform_keys(&:to_sym)) : force_new_deployment
  Jsii::Type.check_type(@force_new_deployment, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuU2VydmljZS5Gb3JjZU5ld0RlcGxveW1lbnRQcm9wZXJ0eSJ9XX19")), "forceNewDeployment") unless @force_new_deployment.nil?
  @health_check_grace_period_seconds = health_check_grace_period_seconds
  Jsii::Type.check_type(@health_check_grace_period_seconds, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "healthCheckGracePeriodSeconds") unless @health_check_grace_period_seconds.nil?
  @launch_type = launch_type
  Jsii::Type.check_type(@launch_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "launchType") unless @launch_type.nil?
  @load_balancers = load_balancers
  Jsii::Type.check_type(@load_balancers, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblNlcnZpY2UuTG9hZEJhbGFuY2VyUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "loadBalancers") unless @load_balancers.nil?
  @monitoring = monitoring.is_a?(Hash) ? ::AWSCDK::ECS::CfnService::MonitoringConfigurationProperty.new(**monitoring.transform_keys(&:to_sym)) : monitoring
  Jsii::Type.check_type(@monitoring, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuU2VydmljZS5Nb25pdG9yaW5nQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "monitoring") unless @monitoring.nil?
  @network_configuration = network_configuration.is_a?(Hash) ? ::AWSCDK::ECS::CfnService::NetworkConfigurationProperty.new(**network_configuration.transform_keys(&:to_sym)) : network_configuration
  Jsii::Type.check_type(@network_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuU2VydmljZS5OZXR3b3JrQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "networkConfiguration") unless @network_configuration.nil?
  @placement_constraints = placement_constraints
  Jsii::Type.check_type(@placement_constraints, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblNlcnZpY2UuUGxhY2VtZW50Q29uc3RyYWludFByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "placementConstraints") unless @placement_constraints.nil?
  @placement_strategies = placement_strategies
  Jsii::Type.check_type(@placement_strategies, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblNlcnZpY2UuUGxhY2VtZW50U3RyYXRlZ3lQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "placementStrategies") unless @placement_strategies.nil?
  @platform_version = platform_version
  Jsii::Type.check_type(@platform_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "platformVersion") unless @platform_version.nil?
  @propagate_tags = propagate_tags
  Jsii::Type.check_type(@propagate_tags, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "propagateTags") unless @propagate_tags.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19pYW0uSVJvbGVSZWYifV19fQ==")), "role") unless @role.nil?
  @scheduling_strategy = scheduling_strategy
  Jsii::Type.check_type(@scheduling_strategy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "schedulingStrategy") unless @scheduling_strategy.nil?
  @service_connect_configuration = service_connect_configuration.is_a?(Hash) ? ::AWSCDK::ECS::CfnService::ServiceConnectConfigurationProperty.new(**service_connect_configuration.transform_keys(&:to_sym)) : service_connect_configuration
  Jsii::Type.check_type(@service_connect_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuU2VydmljZS5TZXJ2aWNlQ29ubmVjdENvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "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?
  @service_registries = service_registries
  Jsii::Type.check_type(@service_registries, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblNlcnZpY2UuU2VydmljZVJlZ2lzdHJ5UHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "serviceRegistries") unless @service_registries.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @task_definition = task_definition
  Jsii::Type.check_type(@task_definition, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19lY3MuSVRhc2tEZWZpbml0aW9uUmVmIn1dfX0=")), "taskDefinition") unless @task_definition.nil?
  @volume_configurations = volume_configurations
  Jsii::Type.check_type(@volume_configurations, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblNlcnZpY2UuU2VydmljZVZvbHVtZUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "volumeConfigurations") unless @volume_configurations.nil?
  @vpc_lattice_configurations = vpc_lattice_configurations
  Jsii::Type.check_type(@vpc_lattice_configurations, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblNlcnZpY2UuVnBjTGF0dGljZUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "vpcLatticeConfigurations") unless @vpc_lattice_configurations.nil?
end

Instance Attribute Details

#availability_zone_rebalancingString? (readonly)

Note:

Default: - "ENABLED"

Indicates whether to use Availability Zone rebalancing for the service.

For more information, see Balancing an Amazon ECS service across Availability Zones in the Amazon Elastic Container Service Developer Guide .

The default behavior of AvailabilityZoneRebalancing differs between create and update requests:

  • For create service requests, when no value is specified for AvailabilityZoneRebalancing , Amazon ECS defaults the value to ENABLED .
  • For update service requests, when no value is specified for AvailabilityZoneRebalancing , Amazon ECS defaults to the existing service’s AvailabilityZoneRebalancing value. If the service never had an AvailabilityZoneRebalancing value set, Amazon ECS treats this as DISABLED .


105
106
107
# File 'ecs/cfn_service_props.rb', line 105

def availability_zone_rebalancing
  @availability_zone_rebalancing
end

#capacity_provider_strategyAWSCDK::IResolvable, ... (readonly)

The capacity provider strategy to use for the service.

If a capacity_provider_strategy is specified, the launch_type parameter must be omitted. If no capacity_provider_strategy or launch_type is specified, the default_capacity_provider_strategy for the cluster is used.

A capacity provider strategy can contain a maximum of 20 capacity providers.

To remove this property from your service resource, specify an empty CapacityProviderStrategyItem array.



116
117
118
# File 'ecs/cfn_service_props.rb', line 116

def capacity_provider_strategy
  @capacity_provider_strategy
end

#clusterString, ... (readonly)

The short name or full Amazon Resource Name (ARN) of the cluster that you run your service on.

If you do not specify a cluster, the default cluster is assumed.



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

def cluster
  @cluster
end

#deployment_configurationAWSCDK::IResolvable, ... (readonly)

Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.



128
129
130
# File 'ecs/cfn_service_props.rb', line 128

def deployment_configuration
  @deployment_configuration
end

#deployment_controllerAWSCDK::IResolvable, ... (readonly)

The deployment controller to use for the service.



133
134
135
# File 'ecs/cfn_service_props.rb', line 133

def deployment_controller
  @deployment_controller
end

#desired_countNumeric? (readonly)

The number of instantiations of the specified task definition to place and keep running in your service.

For new services, if a desired count is not specified, a default value of 1 is used. When using the DAEMON scheduling strategy, the desired count is not required.

For existing services, if a desired count is not specified, it is omitted from the operation.



142
143
144
# File 'ecs/cfn_service_props.rb', line 142

def desired_count
  @desired_count
end

#enable_ecs_managed_tagsBoolean, ... (readonly)

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

For more information, see Tagging your Amazon ECS resources in the Amazon Elastic Container Service Developer Guide .

When you use Amazon ECS managed tags, you must set the propagate_tags request parameter.



151
152
153
# File 'ecs/cfn_service_props.rb', line 151

def enable_ecs_managed_tags
  @enable_ecs_managed_tags
end

#enable_execute_commandBoolean, ... (readonly)

Determines whether the execute command functionality is turned on for the service.

If true , the execute command functionality is turned on for all containers in tasks as part of the service.



158
159
160
# File 'ecs/cfn_service_props.rb', line 158

def enable_execute_command
  @enable_execute_command
end

#force_new_deploymentAWSCDK::IResolvable, ... (readonly)

Determines whether to force 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.



165
166
167
# File 'ecs/cfn_service_props.rb', line 165

def force_new_deployment
  @force_new_deployment
end

#health_check_grace_period_secondsNumeric? (readonly)

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

If you do not specify a health check grace period value, the default value of 0 is used. If you do not use any of the health checks, then health_check_grace_period_seconds is unused.

If your service has more running tasks than desired, unhealthy tasks in the grace period might be stopped to reach the desired count.



174
175
176
# File 'ecs/cfn_service_props.rb', line 174

def health_check_grace_period_seconds
  @health_check_grace_period_seconds
end

#launch_typeString? (readonly)

The launch type on which to run your service.

For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide .

If you want to use Managed Instances, you must use the capacity_provider_strategy request parameter



183
184
185
# File 'ecs/cfn_service_props.rb', line 183

def launch_type
  @launch_type
end

#load_balancersAWSCDK::IResolvable, ... (readonly)

A list of load balancer objects to associate with the service.

If you specify the Role property, LoadBalancers must be specified as well. For information about the number of load balancers that you can specify per service, see Service Load Balancing in the Amazon Elastic Container Service Developer Guide .

To remove this property from your service resource, specify an empty LoadBalancer array.



192
193
194
# File 'ecs/cfn_service_props.rb', line 192

def load_balancers
  @load_balancers
end

#monitoringAWSCDK::IResolvable, ... (readonly)



195
196
197
# File 'ecs/cfn_service_props.rb', line 195

def monitoring
  @monitoring
end

#network_configurationAWSCDK::IResolvable, ... (readonly)

The network configuration for the service.

This parameter is required for task definitions that use the awsvpc network mode to receive their own elastic network interface, and it is not supported for other network modes. For more information, see Task Networking in the Amazon Elastic Container Service Developer Guide .



202
203
204
# File 'ecs/cfn_service_props.rb', line 202

def network_configuration
  @network_configuration
end

#placement_constraintsAWSCDK::IResolvable, ... (readonly)

An array of placement constraint objects to use for tasks in your service.

You can specify a maximum of 10 constraints for each task. This limit includes constraints in the task definition and those specified at runtime.

To remove this property from your service resource, specify an empty PlacementConstraint array.



211
212
213
# File 'ecs/cfn_service_props.rb', line 211

def placement_constraints
  @placement_constraints
end

#placement_strategiesAWSCDK::IResolvable, ... (readonly)

The placement strategy objects to use for tasks in your service.

You can specify a maximum of 5 strategy rules for each service.

To remove this property from your service resource, specify an empty PlacementStrategy array.



220
221
222
# File 'ecs/cfn_service_props.rb', line 220

def placement_strategies
  @placement_strategies
end

#platform_versionString? (readonly)

Note:

Default: - "LATEST"

The platform version that your tasks in the service are running on.

A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the LATEST platform version is used. For more information, see AWS Fargate platform versions in the Amazon Elastic Container Service Developer Guide .



228
229
230
# File 'ecs/cfn_service_props.rb', line 228

def platform_version
  @platform_version
end

#propagate_tagsString? (readonly)

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

If no value is specified, the tags aren't propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use the TagResource API action.

You must set this to a value other than NONE when you use Cost Explorer. For more information, see Amazon ECS usage reports in the Amazon Elastic Container Service Developer Guide .

The default is NONE .



239
240
241
# File 'ecs/cfn_service_props.rb', line 239

def propagate_tags
  @propagate_tags
end

#roleString, ... (readonly)

The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf.

This parameter is only permitted if you are using a load balancer with your service and your task definition doesn't use the awsvpc network mode. If you specify the role parameter, you must also specify a load balancer object with the load_balancers parameter.

If your account has already created the Amazon ECS service-linked role, that role is used for your service unless you specify a role here. The service-linked role is required if your task definition uses the awsvpc network mode or if the service is configured to use service discovery, an external deployment controller, multiple target groups, or Elastic Inference accelerators in which case you don't specify a role here. For more information, see Using service-linked roles for Amazon ECS in the Amazon Elastic Container Service Developer Guide .

If your specified role has a path other than / , then you must either specify the full role ARN (this is recommended) or prefix the role name with the path. For example, if a role with the name bar has a path of /foo/ then you would specify /foo/bar as the role name. For more information, see Friendly names and paths in the IAM User Guide .



250
251
252
# File 'ecs/cfn_service_props.rb', line 250

def role
  @role
end

#scheduling_strategyString? (readonly)

The scheduling strategy to use for the service. For more information, see Services .

There are two service scheduler strategies available:

  • REPLICA -The replica scheduling strategy places and maintains the desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions. This scheduler strategy is required if the service uses the CODE_DEPLOY or EXTERNAL deployment controller types.
  • DAEMON -The daemon scheduling strategy deploys exactly one task on each active container instance that meets all of the task placement constraints that you specify in your cluster. The service scheduler also evaluates the task placement constraints for running tasks and will stop tasks that don't meet the placement constraints. When you're using this strategy, you don't need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies.

Tasks using the Fargate launch type or the CODE_DEPLOY or EXTERNAL deployment controller types don't support the DAEMON scheduling strategy.



262
263
264
# File 'ecs/cfn_service_props.rb', line 262

def scheduling_strategy
  @scheduling_strategy
end

#service_connect_configurationAWSCDK::IResolvable, ... (readonly)

The configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace.

Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide .



269
270
271
# File 'ecs/cfn_service_props.rb', line 269

def service_connect_configuration
  @service_connect_configuration
end

#service_nameString? (readonly)

The name of your service.

Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple clusters within a Region or across multiple Regions.

The stack update fails if you change any properties that require replacement and the ServiceName is configured. This is because AWS CloudFormation creates the replacement service first, but each ServiceName must be unique in the cluster.



278
279
280
# File 'ecs/cfn_service_props.rb', line 278

def service_name
  @service_name
end

#service_registriesAWSCDK::IResolvable, ... (readonly)

The details of the service discovery registry to associate with this service. For more information, see Service discovery .

Each service may be associated with one service registry. Multiple service registries for each service isn't supported. > To remove this property from your service resource, specify an empty ServiceRegistry array.



285
286
287
# File 'ecs/cfn_service_props.rb', line 285

def service_registries
  @service_registries
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

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

Each tag consists of a key and an optional value, both of which you define. When a service is deleted, the tags are deleted as well.

The following basic restrictions apply to tags:

  • Maximum number of tags per resource - 50
  • For each resource, each tag key must be unique, and each tag key can have only one value.
  • Maximum key length - 128 Unicode characters in UTF-8
  • Maximum value length - 256 Unicode characters in UTF-8
  • If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : /


300
301
302
# File 'ecs/cfn_service_props.rb', line 300

def tags
  @tags
end

#task_definitionString, ... (readonly)

The family and revision ( family:revision ) or full ARN of the task definition to run in your service.

If a revision isn't specified, the latest ACTIVE revision is used.

A task definition must be specified if the service uses either the ECS or CODE_DEPLOY deployment controllers.

For more information about deployment types, see Amazon ECS deployment types .



311
312
313
# File 'ecs/cfn_service_props.rb', line 311

def task_definition
  @task_definition
end

#volume_configurationsAWSCDK::IResolvable, ... (readonly)

The configuration for a volume specified in the task definition as a volume that is configured at launch time.

Currently, the only supported volume type is an Amazon EBS volume.

To remove this property from your service resource, specify an empty ServiceVolumeConfiguration array.



320
321
322
# File 'ecs/cfn_service_props.rb', line 320

def volume_configurations
  @volume_configurations
end

#vpc_lattice_configurationsAWSCDK::IResolvable, ... (readonly)

The VPC Lattice configuration for the service being created.



325
326
327
# File 'ecs/cfn_service_props.rb', line 325

def vpc_lattice_configurations
  @vpc_lattice_configurations
end

Class Method Details

.jsii_propertiesObject



327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# File 'ecs/cfn_service_props.rb', line 327

def self.jsii_properties
  {
    :availability_zone_rebalancing => "availabilityZoneRebalancing",
    :capacity_provider_strategy => "capacityProviderStrategy",
    :cluster => "cluster",
    :deployment_configuration => "deploymentConfiguration",
    :deployment_controller => "deploymentController",
    :desired_count => "desiredCount",
    :enable_ecs_managed_tags => "enableEcsManagedTags",
    :enable_execute_command => "enableExecuteCommand",
    :force_new_deployment => "forceNewDeployment",
    :health_check_grace_period_seconds => "healthCheckGracePeriodSeconds",
    :launch_type => "launchType",
    :load_balancers => "loadBalancers",
    :monitoring => "monitoring",
    :network_configuration => "networkConfiguration",
    :placement_constraints => "placementConstraints",
    :placement_strategies => "placementStrategies",
    :platform_version => "platformVersion",
    :propagate_tags => "propagateTags",
    :role => "role",
    :scheduling_strategy => "schedulingStrategy",
    :service_connect_configuration => "serviceConnectConfiguration",
    :service_name => "serviceName",
    :service_registries => "serviceRegistries",
    :tags => "tags",
    :task_definition => "taskDefinition",
    :volume_configurations => "volumeConfigurations",
    :vpc_lattice_configurations => "vpcLatticeConfigurations",
  }
end

Instance Method Details

#to_jsiiObject



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
388
389
390
391
# File 'ecs/cfn_service_props.rb', line 359

def to_jsii
  result = {}
  result.merge!({
    "availabilityZoneRebalancing" => @availability_zone_rebalancing,
    "capacityProviderStrategy" => @capacity_provider_strategy,
    "cluster" => @cluster,
    "deploymentConfiguration" => @deployment_configuration,
    "deploymentController" => @deployment_controller,
    "desiredCount" => @desired_count,
    "enableEcsManagedTags" => @enable_ecs_managed_tags,
    "enableExecuteCommand" => @enable_execute_command,
    "forceNewDeployment" => @force_new_deployment,
    "healthCheckGracePeriodSeconds" => @health_check_grace_period_seconds,
    "launchType" => @launch_type,
    "loadBalancers" => @load_balancers,
    "monitoring" => @monitoring,
    "networkConfiguration" => @network_configuration,
    "placementConstraints" => @placement_constraints,
    "placementStrategies" => @placement_strategies,
    "platformVersion" => @platform_version,
    "propagateTags" => @propagate_tags,
    "role" => @role,
    "schedulingStrategy" => @scheduling_strategy,
    "serviceConnectConfiguration" => @service_connect_configuration,
    "serviceName" => @service_name,
    "serviceRegistries" => @service_registries,
    "tags" => @tags,
    "taskDefinition" => @task_definition,
    "volumeConfigurations" => @volume_configurations,
    "vpcLatticeConfigurations" => @vpc_lattice_configurations,
  })
  result.compact
end