Class: AWSCDK::EKS::CommonClusterOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EKS::CommonClusterOptions
- Defined in:
- eks/common_cluster_options.rb
Overview
Options for configuring an EKS cluster.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cluster_name ⇒ String?
readonly
Name for the cluster.
-
#output_cluster_name ⇒ Boolean?
readonly
Determines whether a CloudFormation output with the name of the cluster will be synthesized.
-
#output_config_command ⇒ Boolean?
readonly
Determines whether a CloudFormation output with the
aws eks update-kubeconfigcommand will be synthesized. -
#role ⇒ AWSCDK::IAM::IRole?
readonly
Role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.
-
#security_group ⇒ AWSCDK::EC2::ISecurityGroup?
readonly
Security Group to use for Control Plane ENIs.
-
#version ⇒ AWSCDK::EKS::KubernetesVersion
readonly
The Kubernetes version to run in the cluster.
-
#vpc ⇒ AWSCDK::EC2::IVPC?
readonly
The VPC in which to create the Cluster.
-
#vpc_subnets ⇒ Array<AWSCDK::EC2::SubnetSelection>?
readonly
Where to place EKS Control Plane ENIs.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(version:, cluster_name: nil, output_cluster_name: nil, output_config_command: nil, role: nil, security_group: nil, vpc: nil, vpc_subnets: nil) ⇒ CommonClusterOptions
constructor
A new instance of CommonClusterOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(version:, cluster_name: nil, output_cluster_name: nil, output_config_command: nil, role: nil, security_group: nil, vpc: nil, vpc_subnets: nil) ⇒ CommonClusterOptions
Returns a new instance of CommonClusterOptions.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'eks/common_cluster_options.rb', line 15 def initialize(version:, cluster_name: nil, output_cluster_name: nil, output_config_command: nil, role: nil, security_group: nil, vpc: nil, vpc_subnets: nil) @version = version Jsii::Type.check_type(@version, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkt1YmVybmV0ZXNWZXJzaW9uIn0=")), "version") @cluster_name = cluster_name Jsii::Type.check_type(@cluster_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clusterName") unless @cluster_name.nil? @output_cluster_name = output_cluster_name Jsii::Type.check_type(@output_cluster_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "outputClusterName") unless @output_cluster_name.nil? @output_config_command = output_config_command Jsii::Type.check_type(@output_config_command, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "outputConfigCommand") unless @output_config_command.nil? @role = role Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil? @security_group = security_group Jsii::Type.check_type(@security_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklTZWN1cml0eUdyb3VwIn0=")), "securityGroup") unless @security_group.nil? @vpc = vpc Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc") unless @vpc.nil? @vpc_subnets = vpc_subnets.is_a?(Array) ? vpc_subnets.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : vpc_subnets Jsii::Type.check_type(@vpc_subnets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuU3VibmV0U2VsZWN0aW9uIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "vpcSubnets") unless @vpc_subnets.nil? end |
Instance Attribute Details
#cluster_name ⇒ String? (readonly)
Default: - Automatically generated name
Name for the cluster.
42 43 44 |
# File 'eks/common_cluster_options.rb', line 42 def cluster_name @cluster_name end |
#output_cluster_name ⇒ Boolean? (readonly)
Default: false
Determines whether a CloudFormation output with the name of the cluster will be synthesized.
47 48 49 |
# File 'eks/common_cluster_options.rb', line 47 def output_cluster_name @output_cluster_name end |
#output_config_command ⇒ Boolean? (readonly)
Default: true
Determines whether a CloudFormation output with the aws eks update-kubeconfig command will be synthesized.
This command will include the cluster name and the ARN of the masters IAM role.
Note: If mastersRole is not specified, this property will be ignored and no config command will be emitted.
58 59 60 |
# File 'eks/common_cluster_options.rb', line 58 def output_config_command @output_config_command end |
#role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - A role is automatically created for you
Role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.
63 64 65 |
# File 'eks/common_cluster_options.rb', line 63 def role @role end |
#security_group ⇒ AWSCDK::EC2::ISecurityGroup? (readonly)
Default: - A security group is automatically created
Security Group to use for Control Plane ENIs.
68 69 70 |
# File 'eks/common_cluster_options.rb', line 68 def security_group @security_group end |
#version ⇒ AWSCDK::EKS::KubernetesVersion (readonly)
The Kubernetes version to run in the cluster.
37 38 39 |
# File 'eks/common_cluster_options.rb', line 37 def version @version end |
#vpc ⇒ AWSCDK::EC2::IVPC? (readonly)
Default: - a VPC with default configuration will be created and can be accessed through cluster.vpc.
The VPC in which to create the Cluster.
73 74 75 |
# File 'eks/common_cluster_options.rb', line 73 def vpc @vpc end |
#vpc_subnets ⇒ Array<AWSCDK::EC2::SubnetSelection>? (readonly)
Default: - All public and private subnets
Where to place EKS Control Plane ENIs.
For example, to only select private subnets, supply the following:
vpcSubnets: [{ subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }]
82 83 84 |
# File 'eks/common_cluster_options.rb', line 82 def vpc_subnets @vpc_subnets end |
Class Method Details
.jsii_properties ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'eks/common_cluster_options.rb', line 84 def self.jsii_properties { :version => "version", :cluster_name => "clusterName", :output_cluster_name => "outputClusterName", :output_config_command => "outputConfigCommand", :role => "role", :security_group => "securityGroup", :vpc => "vpc", :vpc_subnets => "vpcSubnets", } end |
Instance Method Details
#to_jsii ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'eks/common_cluster_options.rb', line 97 def to_jsii result = {} result.merge!({ "version" => @version, "clusterName" => @cluster_name, "outputClusterName" => @output_cluster_name, "outputConfigCommand" => @output_config_command, "role" => @role, "securityGroup" => @security_group, "vpc" => @vpc, "vpcSubnets" => @vpc_subnets, }) result.compact end |