Class: AWSCDK::ECS::CfnCapacityProviderProps

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

Overview

Properties for defining a CfnCapacityProvider.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auto_scaling_group_provider: nil, cluster_name: nil, managed_instances_provider: nil, name: nil, tags: nil) ⇒ CfnCapacityProviderProps

Returns a new instance of CfnCapacityProviderProps.

Parameters:



14
15
16
17
18
19
20
21
22
23
24
25
# File 'ecs/cfn_capacity_provider_props.rb', line 14

def initialize(auto_scaling_group_provider: nil, cluster_name: nil, managed_instances_provider: nil, name: nil, tags: nil)
  @auto_scaling_group_provider = auto_scaling_group_provider.is_a?(Hash) ? ::AWSCDK::ECS::CfnCapacityProvider::AutoScalingGroupProviderProperty.new(**auto_scaling_group_provider.transform_keys(&:to_sym)) : auto_scaling_group_provider
  Jsii::Type.check_type(@auto_scaling_group_provider, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuQ2FwYWNpdHlQcm92aWRlci5BdXRvU2NhbGluZ0dyb3VwUHJvdmlkZXJQcm9wZXJ0eSJ9XX19")), "autoScalingGroupProvider") unless @auto_scaling_group_provider.nil?
  @cluster_name = cluster_name
  Jsii::Type.check_type(@cluster_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clusterName") unless @cluster_name.nil?
  @managed_instances_provider = managed_instances_provider.is_a?(Hash) ? ::AWSCDK::ECS::CfnCapacityProvider::ManagedInstancesProviderProperty.new(**managed_instances_provider.transform_keys(&:to_sym)) : managed_instances_provider
  Jsii::Type.check_type(@managed_instances_provider, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuQ2FwYWNpdHlQcm92aWRlci5NYW5hZ2VkSW5zdGFuY2VzUHJvdmlkZXJQcm9wZXJ0eSJ9XX19")), "managedInstancesProvider") unless @managed_instances_provider.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.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

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

The Auto Scaling group settings for the capacity provider.



31
32
33
# File 'ecs/cfn_capacity_provider_props.rb', line 31

def auto_scaling_group_provider
  @auto_scaling_group_provider
end

#cluster_nameString? (readonly)

The cluster that this capacity provider is associated with.

Managed instances capacity providers are cluster-scoped, meaning they can only be used within their associated cluster.

This is required for Managed instances.



40
41
42
# File 'ecs/cfn_capacity_provider_props.rb', line 40

def cluster_name
  @cluster_name
end

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

The configuration for the Amazon ECS Managed Instances provider.

This includes the infrastructure role, the launch template configuration, and tag propagation settings.



47
48
49
# File 'ecs/cfn_capacity_provider_props.rb', line 47

def managed_instances_provider
  @managed_instances_provider
end

#nameString? (readonly)

The name of the capacity provider.

If a name is specified, it cannot start with aws , ecs , or fargate . If no name is specified, a default name in the CFNStackName-CFNResourceName-RandomString format is used.



54
55
56
# File 'ecs/cfn_capacity_provider_props.rb', line 54

def name
  @name
end

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

The metadata that you apply to the capacity provider to help you categorize and organize it.

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


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

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



71
72
73
74
75
76
77
78
79
# File 'ecs/cfn_capacity_provider_props.rb', line 71

def self.jsii_properties
  {
    :auto_scaling_group_provider => "autoScalingGroupProvider",
    :cluster_name => "clusterName",
    :managed_instances_provider => "managedInstancesProvider",
    :name => "name",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



81
82
83
84
85
86
87
88
89
90
91
# File 'ecs/cfn_capacity_provider_props.rb', line 81

def to_jsii
  result = {}
  result.merge!({
    "autoScalingGroupProvider" => @auto_scaling_group_provider,
    "clusterName" => @cluster_name,
    "managedInstancesProvider" => @managed_instances_provider,
    "name" => @name,
    "tags" => @tags,
  })
  result.compact
end