Class: AWSCDK::ECS::CfnTaskSetProps

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

Overview

Properties for defining a CfnTaskSet.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cluster:, service:, task_definition:, capacity_provider_strategy: nil, external_id: nil, launch_type: nil, load_balancers: nil, network_configuration: nil, platform_version: nil, scale: nil, service_registries: nil, tags: nil) ⇒ CfnTaskSetProps

Returns a new instance of CfnTaskSetProps.

Parameters:



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'ecs/cfn_task_set_props.rb', line 21

def initialize(cluster:, service:, task_definition:, capacity_provider_strategy: nil, external_id: nil, launch_type: nil, load_balancers: nil, network_configuration: nil, platform_version: nil, scale: nil, service_registries: nil, tags: nil)
  @cluster = cluster
  Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "cluster")
  @service = service
  Jsii::Type.check_type(@service, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "service")
  @task_definition = task_definition
  Jsii::Type.check_type(@task_definition, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "taskDefinition")
  @capacity_provider_strategy = capacity_provider_strategy
  Jsii::Type.check_type(@capacity_provider_strategy, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblRhc2tTZXQuQ2FwYWNpdHlQcm92aWRlclN0cmF0ZWd5SXRlbVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "capacityProviderStrategy") unless @capacity_provider_strategy.nil?
  @external_id = external_id
  Jsii::Type.check_type(@external_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "externalId") unless @external_id.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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblRhc2tTZXQuTG9hZEJhbGFuY2VyUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "loadBalancers") unless @load_balancers.nil?
  @network_configuration = network_configuration.is_a?(Hash) ? ::AWSCDK::ECS::CfnTaskSet::NetworkConfigurationProperty.new(**network_configuration.transform_keys(&:to_sym)) : network_configuration
  Jsii::Type.check_type(@network_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuVGFza1NldC5OZXR3b3JrQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "networkConfiguration") unless @network_configuration.nil?
  @platform_version = platform_version
  Jsii::Type.check_type(@platform_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "platformVersion") unless @platform_version.nil?
  @scale = scale.is_a?(Hash) ? ::AWSCDK::ECS::CfnTaskSet::ScaleProperty.new(**scale.transform_keys(&:to_sym)) : scale
  Jsii::Type.check_type(@scale, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuVGFza1NldC5TY2FsZVByb3BlcnR5In1dfX0=")), "scale") unless @scale.nil?
  @service_registries = service_registries
  Jsii::Type.check_type(@service_registries, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblRhc2tTZXQuU2VydmljZVJlZ2lzdHJ5UHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "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?
end

Instance Attribute Details

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

The capacity provider strategy that are associated with the task set.



69
70
71
# File 'ecs/cfn_task_set_props.rb', line 69

def capacity_provider_strategy
  @capacity_provider_strategy
end

#clusterString (readonly)

The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in.



52
53
54
# File 'ecs/cfn_task_set_props.rb', line 52

def cluster
  @cluster
end

#external_idString? (readonly)

An optional non-unique tag that identifies this task set in external systems.

If the task set is associated with a service discovery registry, the tasks in this task set will have the ECS_TASK_SET_EXTERNAL_ID AWS Cloud Map attribute set to the provided value.



76
77
78
# File 'ecs/cfn_task_set_props.rb', line 76

def external_id
  @external_id
end

#launch_typeString? (readonly)

The launch type that new tasks in the task set uses.

For more information, see Amazon ECS launch types in the Amazon Elastic Container Service Developer Guide .

If a launch_type is specified, the capacity_provider_strategy parameter must be omitted.



85
86
87
# File 'ecs/cfn_task_set_props.rb', line 85

def launch_type
  @launch_type
end

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

A load balancer object representing the load balancer to use with the task set.

The supported load balancer types are either an Application Load Balancer or a Network Load Balancer.



92
93
94
# File 'ecs/cfn_task_set_props.rb', line 92

def load_balancers
  @load_balancers
end

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

The network configuration for the task set.



97
98
99
# File 'ecs/cfn_task_set_props.rb', line 97

def network_configuration
  @network_configuration
end

#platform_versionString? (readonly)

The platform version that the tasks in the task set uses.

A platform version is specified only for tasks using the Fargate launch type. If one isn't specified, the LATEST platform version is used.



104
105
106
# File 'ecs/cfn_task_set_props.rb', line 104

def platform_version
  @platform_version
end

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

A floating-point percentage of your desired number of tasks to place and keep running in the task set.



109
110
111
# File 'ecs/cfn_task_set_props.rb', line 109

def scale
  @scale
end

#serviceString (readonly)

The short name or full Amazon Resource Name (ARN) of the service to create the task set in.



57
58
59
# File 'ecs/cfn_task_set_props.rb', line 57

def service
  @service
end

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

The details of the service discovery registries to assign to this task set.

For more information, see Service discovery .



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

def service_registries
  @service_registries
end

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

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

Each tag consists of a key and an optional value. You define both.

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: + - = . _ : /


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

def tags
  @tags
end

#task_definitionString (readonly)

The task definition for the tasks in the task set to use.

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



64
65
66
# File 'ecs/cfn_task_set_props.rb', line 64

def task_definition
  @task_definition
end

Class Method Details

.jsii_propertiesObject



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'ecs/cfn_task_set_props.rb', line 133

def self.jsii_properties
  {
    :cluster => "cluster",
    :service => "service",
    :task_definition => "taskDefinition",
    :capacity_provider_strategy => "capacityProviderStrategy",
    :external_id => "externalId",
    :launch_type => "launchType",
    :load_balancers => "loadBalancers",
    :network_configuration => "networkConfiguration",
    :platform_version => "platformVersion",
    :scale => "scale",
    :service_registries => "serviceRegistries",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'ecs/cfn_task_set_props.rb', line 150

def to_jsii
  result = {}
  result.merge!({
    "cluster" => @cluster,
    "service" => @service,
    "taskDefinition" => @task_definition,
    "capacityProviderStrategy" => @capacity_provider_strategy,
    "externalId" => @external_id,
    "launchType" => @launch_type,
    "loadBalancers" => @load_balancers,
    "networkConfiguration" => @network_configuration,
    "platformVersion" => @platform_version,
    "scale" => @scale,
    "serviceRegistries" => @service_registries,
    "tags" => @tags,
  })
  result.compact
end