Class: AWSCDK::ECS::ClusterAttributes
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ECS::ClusterAttributes
- Defined in:
- ecs/cluster_attributes.rb
Overview
The properties to import from the ECS cluster.
Instance Attribute Summary collapse
-
#autoscaling_group ⇒ AWSCDK::Autoscaling::IAutoScalingGroup?
readonly
Autoscaling group added to the cluster if capacity is added.
-
#cluster_arn ⇒ String?
readonly
The Amazon Resource Name (ARN) that identifies the cluster.
-
#cluster_name ⇒ String
readonly
The name of the cluster.
-
#default_cloud_map_namespace ⇒ AWSCDK::ServiceDiscovery::INamespace?
readonly
The AWS Cloud Map namespace to associate with the cluster.
-
#execute_command_configuration ⇒ AWSCDK::ECS::ExecuteCommandConfiguration?
readonly
The execute command configuration for the cluster.
-
#has_ec2_capacity ⇒ Boolean?
readonly
Specifies whether the cluster has EC2 instance capacity.
-
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>?
readonly
The security groups associated with the container instances registered to the cluster.
-
#vpc ⇒ AWSCDK::EC2::IVPC
readonly
The VPC associated with the cluster.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cluster_name:, vpc:, autoscaling_group: nil, cluster_arn: nil, default_cloud_map_namespace: nil, execute_command_configuration: nil, has_ec2_capacity: nil, security_groups: nil) ⇒ ClusterAttributes
constructor
A new instance of ClusterAttributes.
- #to_jsii ⇒ Object
Constructor Details
#initialize(cluster_name:, vpc:, autoscaling_group: nil, cluster_arn: nil, default_cloud_map_namespace: nil, execute_command_configuration: nil, has_ec2_capacity: nil, security_groups: nil) ⇒ ClusterAttributes
Returns a new instance of ClusterAttributes.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'ecs/cluster_attributes.rb', line 15 def initialize(cluster_name:, vpc:, autoscaling_group: nil, cluster_arn: nil, default_cloud_map_namespace: nil, execute_command_configuration: nil, has_ec2_capacity: nil, security_groups: nil) @cluster_name = cluster_name Jsii::Type.check_type(@cluster_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clusterName") @vpc = vpc Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc") @autoscaling_group = autoscaling_group Jsii::Type.check_type(@autoscaling_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuSUF1dG9TY2FsaW5nR3JvdXAifQ==")), "autoscalingGroup") unless @autoscaling_group.nil? @cluster_arn = cluster_arn Jsii::Type.check_type(@cluster_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clusterArn") unless @cluster_arn.nil? @default_cloud_map_namespace = default_cloud_map_namespace Jsii::Type.check_type(@default_cloud_map_namespace, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VydmljZWRpc2NvdmVyeS5JTmFtZXNwYWNlIn0=")), "defaultCloudMapNamespace") unless @default_cloud_map_namespace.nil? @execute_command_configuration = execute_command_configuration.is_a?(Hash) ? ::AWSCDK::ECS::ExecuteCommandConfiguration.new(**execute_command_configuration.transform_keys(&:to_sym)) : execute_command_configuration Jsii::Type.check_type(@execute_command_configuration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkV4ZWN1dGVDb21tYW5kQ29uZmlndXJhdGlvbiJ9")), "executeCommandConfiguration") unless @execute_command_configuration.nil? @has_ec2_capacity = has_ec2_capacity Jsii::Type.check_type(@has_ec2_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "hasEc2Capacity") unless @has_ec2_capacity.nil? @security_groups = security_groups Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups") unless @security_groups.nil? end |
Instance Attribute Details
#autoscaling_group ⇒ AWSCDK::Autoscaling::IAutoScalingGroup? (readonly)
Default: - No default autoscaling group
Autoscaling group added to the cluster if capacity is added.
46 47 48 |
# File 'ecs/cluster_attributes.rb', line 46 def autoscaling_group @autoscaling_group end |
#cluster_arn ⇒ String? (readonly)
Default: Derived from clusterName
The Amazon Resource Name (ARN) that identifies the cluster.
51 52 53 |
# File 'ecs/cluster_attributes.rb', line 51 def cluster_arn @cluster_arn end |
#cluster_name ⇒ String (readonly)
The name of the cluster.
37 38 39 |
# File 'ecs/cluster_attributes.rb', line 37 def cluster_name @cluster_name end |
#default_cloud_map_namespace ⇒ AWSCDK::ServiceDiscovery::INamespace? (readonly)
Default: - No default namespace
The AWS Cloud Map namespace to associate with the cluster.
56 57 58 |
# File 'ecs/cluster_attributes.rb', line 56 def default_cloud_map_namespace @default_cloud_map_namespace end |
#execute_command_configuration ⇒ AWSCDK::ECS::ExecuteCommandConfiguration? (readonly)
Default: - none.
The execute command configuration for the cluster.
61 62 63 |
# File 'ecs/cluster_attributes.rb', line 61 def execute_command_configuration @execute_command_configuration end |
#has_ec2_capacity ⇒ Boolean? (readonly)
Default: true
Specifies whether the cluster has EC2 instance capacity.
66 67 68 |
# File 'ecs/cluster_attributes.rb', line 66 def has_ec2_capacity @has_ec2_capacity end |
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>? (readonly)
Default: - no security groups
The security groups associated with the container instances registered to the cluster.
71 72 73 |
# File 'ecs/cluster_attributes.rb', line 71 def security_groups @security_groups end |
#vpc ⇒ AWSCDK::EC2::IVPC (readonly)
The VPC associated with the cluster.
41 42 43 |
# File 'ecs/cluster_attributes.rb', line 41 def vpc @vpc end |
Class Method Details
.jsii_properties ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'ecs/cluster_attributes.rb', line 73 def self.jsii_properties { :cluster_name => "clusterName", :vpc => "vpc", :autoscaling_group => "autoscalingGroup", :cluster_arn => "clusterArn", :default_cloud_map_namespace => "defaultCloudMapNamespace", :execute_command_configuration => "executeCommandConfiguration", :has_ec2_capacity => "hasEc2Capacity", :security_groups => "securityGroups", } end |
Instance Method Details
#to_jsii ⇒ Object
86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'ecs/cluster_attributes.rb', line 86 def to_jsii result = {} result.merge!({ "clusterName" => @cluster_name, "vpc" => @vpc, "autoscalingGroup" => @autoscaling_group, "clusterArn" => @cluster_arn, "defaultCloudMapNamespace" => @default_cloud_map_namespace, "executeCommandConfiguration" => @execute_command_configuration, "hasEc2Capacity" => @has_ec2_capacity, "securityGroups" => @security_groups, }) result.compact end |