Class: AWSCDK::ECS::CfnClusterProps

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

Overview

Properties for defining a CfnCluster.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(capacity_providers: nil, cluster_name: nil, cluster_settings: nil, configuration: nil, default_capacity_provider_strategy: nil, service_connect_defaults: nil, tags: nil) ⇒ CfnClusterProps

Returns a new instance of CfnClusterProps.

Parameters:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'ecs/cfn_cluster_props.rb', line 16

def initialize(capacity_providers: nil, cluster_name: nil, cluster_settings: nil, configuration: nil, default_capacity_provider_strategy: nil, service_connect_defaults: nil, tags: nil)
  @capacity_providers = capacity_providers
  Jsii::Type.check_type(@capacity_providers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InVuaW9uIjp7InR5cGVzIjpbeyJwcmltaXRpdmUiOiJzdHJpbmcifSx7ImZxbiI6ImF3cy1jZGstbGliLmludGVyZmFjZXMuYXdzX2Vjcy5JQ2FwYWNpdHlQcm92aWRlclJlZiJ9XX19LCJraW5kIjoiYXJyYXkifX0=")), "capacityProviders") unless @capacity_providers.nil?
  @cluster_name = cluster_name
  Jsii::Type.check_type(@cluster_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clusterName") unless @cluster_name.nil?
  @cluster_settings = cluster_settings
  Jsii::Type.check_type(@cluster_settings, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmbkNsdXN0ZXIuQ2x1c3RlclNldHRpbmdzUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "clusterSettings") unless @cluster_settings.nil?
  @configuration = configuration.is_a?(Hash) ? ::AWSCDK::ECS::CfnCluster::ClusterConfigurationProperty.new(**configuration.transform_keys(&:to_sym)) : configuration
  Jsii::Type.check_type(@configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuQ2x1c3Rlci5DbHVzdGVyQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "configuration") unless @configuration.nil?
  @default_capacity_provider_strategy = default_capacity_provider_strategy
  Jsii::Type.check_type(@default_capacity_provider_strategy, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmbkNsdXN0ZXIuQ2FwYWNpdHlQcm92aWRlclN0cmF0ZWd5SXRlbVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "defaultCapacityProviderStrategy") unless @default_capacity_provider_strategy.nil?
  @service_connect_defaults = service_connect_defaults.is_a?(Hash) ? ::AWSCDK::ECS::CfnCluster::ServiceConnectDefaultsProperty.new(**service_connect_defaults.transform_keys(&:to_sym)) : service_connect_defaults
  Jsii::Type.check_type(@service_connect_defaults, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuQ2x1c3Rlci5TZXJ2aWNlQ29ubmVjdERlZmF1bHRzUHJvcGVydHkifV19fQ==")), "serviceConnectDefaults") unless @service_connect_defaults.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_providersArray<String, AWSCDK::Interfaces::AWSECS::ICapacityProviderRef>? (readonly)

The short name of one or more capacity providers to associate with the cluster.

A capacity provider must be associated with a cluster before it can be included as part of the default capacity provider strategy of the cluster or used in a capacity provider strategy when calling the CreateService or RunTask actions.

If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must be created but not associated with another cluster. New Auto Scaling group capacity providers can be created with the CreateCapacityProvider API operation.

To use a AWS Fargate capacity provider, specify either the FARGATE or FARGATE_SPOT capacity providers. The AWS Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used.

The PutCapacityProvider API operation is used to update the list of available capacity providers for a cluster after the cluster is created.



45
46
47
# File 'ecs/cfn_cluster_props.rb', line 45

def capacity_providers
  @capacity_providers
end

#cluster_nameString? (readonly)

A user-generated string that you use to identify your cluster.

If you don't specify a name, AWS CloudFormation generates a unique physical ID for the name.



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

def cluster_name
  @cluster_name
end

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

The settings to use when creating a cluster.

This parameter is used to turn on CloudWatch Container Insights with enhanced observability or CloudWatch Container Insights for a cluster.

Container Insights with enhanced observability provides all the Container Insights metrics, plus additional task and container metrics. This version supports enhanced observability for Amazon ECS clusters using the Amazon EC2 and Fargate launch types. After you configure Container Insights with enhanced observability on Amazon ECS, Container Insights auto-collects detailed infrastructure telemetry from the cluster level down to the container level in your environment and displays these critical performance data in curated dashboards removing the heavy lifting in observability set-up.

For more information, see Monitor Amazon ECS containers using Container Insights with enhanced observability in the Amazon Elastic Container Service Developer Guide .



63
64
65
# File 'ecs/cfn_cluster_props.rb', line 63

def cluster_settings
  @cluster_settings
end

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

The execute command and managed storage configuration for the cluster.



68
69
70
# File 'ecs/cfn_cluster_props.rb', line 68

def configuration
  @configuration
end

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

The default capacity provider strategy for the cluster.

When services or tasks are run in the cluster with no launch type or capacity provider strategy specified, the default capacity provider strategy is used.



75
76
77
# File 'ecs/cfn_cluster_props.rb', line 75

def default_capacity_provider_strategy
  @default_capacity_provider_strategy
end

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

Use this parameter to set a default Service Connect namespace.

After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the enabled parameter to true in the ServiceConnectConfiguration . You can set the namespace of each service individually in the ServiceConnectConfiguration to override this default parameter.

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 .



84
85
86
# File 'ecs/cfn_cluster_props.rb', line 84

def service_connect_defaults
  @service_connect_defaults
end

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

The metadata that you apply to the cluster 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: + - = . _ : /


99
100
101
# File 'ecs/cfn_cluster_props.rb', line 99

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



101
102
103
104
105
106
107
108
109
110
111
# File 'ecs/cfn_cluster_props.rb', line 101

def self.jsii_properties
  {
    :capacity_providers => "capacityProviders",
    :cluster_name => "clusterName",
    :cluster_settings => "clusterSettings",
    :configuration => "configuration",
    :default_capacity_provider_strategy => "defaultCapacityProviderStrategy",
    :service_connect_defaults => "serviceConnectDefaults",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'ecs/cfn_cluster_props.rb', line 113

def to_jsii
  result = {}
  result.merge!({
    "capacityProviders" => @capacity_providers,
    "clusterName" => @cluster_name,
    "clusterSettings" => @cluster_settings,
    "configuration" => @configuration,
    "defaultCapacityProviderStrategy" => @default_capacity_provider_strategy,
    "serviceConnectDefaults" => @service_connect_defaults,
    "tags" => @tags,
  })
  result.compact
end