Class: AWSCDK::EKS::ClusterAttributes
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EKS::ClusterAttributes
- Defined in:
- eks/cluster_attributes.rb
Overview
Attributes for EKS clusters.
Instance Attribute Summary collapse
-
#awscli_layer ⇒ AWSCDK::Lambda::ILayerVersion?
readonly
An AWS Lambda layer that contains the
awsCLI. -
#cluster_certificate_authority_data ⇒ String?
readonly
The certificate-authority-data for your cluster.
-
#cluster_encryption_config_key_arn ⇒ String?
readonly
Amazon Resource Name (ARN) or alias of the customer master key (CMK).
-
#cluster_endpoint ⇒ String?
readonly
The API Server endpoint URL.
-
#cluster_handler_security_group_id ⇒ String?
readonly
A security group id to associate with the Cluster Handler's Lambdas.
-
#cluster_name ⇒ String
readonly
The physical name of the Cluster.
-
#cluster_security_group_id ⇒ String?
readonly
The cluster security group that was created by Amazon EKS for the cluster.
-
#ip_family ⇒ AWSCDK::EKS::IPFamily?
readonly
Specify which IP family is used to assign Kubernetes pod and service IP addresses.
-
#kubectl_environment ⇒ Hash{String => String}?
readonly
Environment variables to use when running
kubectlagainst this cluster. -
#kubectl_lambda_role ⇒ AWSCDK::IAM::IRole?
readonly
An IAM role that can perform kubectl operations against this cluster.
-
#kubectl_layer ⇒ AWSCDK::Lambda::ILayerVersion?
readonly
An AWS Lambda Layer which includes
kubectland Helm. -
#kubectl_memory ⇒ AWSCDK::Size?
readonly
Amount of memory to allocate to the provider's lambda function.
-
#kubectl_private_subnet_ids ⇒ Array<String>?
readonly
Subnets to host the
kubectlcompute resources. -
#kubectl_provider ⇒ AWSCDK::EKS::IKubectlProvider?
readonly
KubectlProvider for issuing kubectl commands.
-
#kubectl_role_arn ⇒ String?
readonly
An IAM role with cluster administrator and "system:masters" permissions.
-
#kubectl_security_group_id ⇒ String?
readonly
A security group to use for
kubectlexecution. -
#on_event_layer ⇒ AWSCDK::Lambda::ILayerVersion?
readonly
An AWS Lambda Layer which includes the NPM dependency
proxy-agent. -
#open_id_connect_provider ⇒ AWSCDK::IAM::IOpenIdConnectProvider?
readonly
An Open ID Connect provider for this cluster that can be used to configure service accounts.
-
#prune ⇒ Boolean?
readonly
Indicates whether Kubernetes resources added through
addManifest()can be automatically pruned. -
#security_group_ids ⇒ Array<String>?
readonly
Additional security groups associated with this cluster.
-
#vpc ⇒ AWSCDK::EC2::IVPC?
readonly
The VPC in which this Cluster was created.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cluster_name:, awscli_layer: nil, cluster_certificate_authority_data: nil, cluster_encryption_config_key_arn: nil, cluster_endpoint: nil, cluster_handler_security_group_id: nil, cluster_security_group_id: nil, ip_family: nil, kubectl_environment: nil, kubectl_lambda_role: nil, kubectl_layer: nil, kubectl_memory: nil, kubectl_private_subnet_ids: nil, kubectl_provider: nil, kubectl_role_arn: nil, kubectl_security_group_id: nil, on_event_layer: nil, open_id_connect_provider: nil, prune: nil, security_group_ids: nil, vpc: nil) ⇒ ClusterAttributes
constructor
A new instance of ClusterAttributes.
- #to_jsii ⇒ Object
Constructor Details
#initialize(cluster_name:, awscli_layer: nil, cluster_certificate_authority_data: nil, cluster_encryption_config_key_arn: nil, cluster_endpoint: nil, cluster_handler_security_group_id: nil, cluster_security_group_id: nil, ip_family: nil, kubectl_environment: nil, kubectl_lambda_role: nil, kubectl_layer: nil, kubectl_memory: nil, kubectl_private_subnet_ids: nil, kubectl_provider: nil, kubectl_role_arn: nil, kubectl_security_group_id: nil, on_event_layer: nil, open_id_connect_provider: nil, prune: nil, security_group_ids: nil, vpc: nil) ⇒ ClusterAttributes
Returns a new instance of ClusterAttributes.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'eks/cluster_attributes.rb', line 28 def initialize(cluster_name:, awscli_layer: nil, cluster_certificate_authority_data: nil, cluster_encryption_config_key_arn: nil, cluster_endpoint: nil, cluster_handler_security_group_id: nil, cluster_security_group_id: nil, ip_family: nil, kubectl_environment: nil, kubectl_lambda_role: nil, kubectl_layer: nil, kubectl_memory: nil, kubectl_private_subnet_ids: nil, kubectl_provider: nil, kubectl_role_arn: nil, kubectl_security_group_id: nil, on_event_layer: nil, open_id_connect_provider: nil, prune: nil, security_group_ids: nil, vpc: nil) @cluster_name = cluster_name Jsii::Type.check_type(@cluster_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clusterName") @awscli_layer = awscli_layer Jsii::Type.check_type(@awscli_layer, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklMYXllclZlcnNpb24ifQ==")), "awscliLayer") unless @awscli_layer.nil? @cluster_certificate_authority_data = Jsii::Type.check_type(@cluster_certificate_authority_data, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clusterCertificateAuthorityData") unless @cluster_certificate_authority_data.nil? @cluster_encryption_config_key_arn = cluster_encryption_config_key_arn Jsii::Type.check_type(@cluster_encryption_config_key_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clusterEncryptionConfigKeyArn") unless @cluster_encryption_config_key_arn.nil? @cluster_endpoint = cluster_endpoint Jsii::Type.check_type(@cluster_endpoint, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clusterEndpoint") unless @cluster_endpoint.nil? @cluster_handler_security_group_id = cluster_handler_security_group_id Jsii::Type.check_type(@cluster_handler_security_group_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clusterHandlerSecurityGroupId") unless @cluster_handler_security_group_id.nil? @cluster_security_group_id = cluster_security_group_id Jsii::Type.check_type(@cluster_security_group_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clusterSecurityGroupId") unless @cluster_security_group_id.nil? @ip_family = ip_family Jsii::Type.check_type(@ip_family, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLklwRmFtaWx5In0=")), "ipFamily") unless @ip_family.nil? @kubectl_environment = kubectl_environment Jsii::Type.check_type(@kubectl_environment, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "kubectlEnvironment") unless @kubectl_environment.nil? @kubectl_lambda_role = kubectl_lambda_role Jsii::Type.check_type(@kubectl_lambda_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "kubectlLambdaRole") unless @kubectl_lambda_role.nil? @kubectl_layer = kubectl_layer Jsii::Type.check_type(@kubectl_layer, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklMYXllclZlcnNpb24ifQ==")), "kubectlLayer") unless @kubectl_layer.nil? @kubectl_memory = kubectl_memory Jsii::Type.check_type(@kubectl_memory, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "kubectlMemory") unless @kubectl_memory.nil? @kubectl_private_subnet_ids = kubectl_private_subnet_ids Jsii::Type.check_type(@kubectl_private_subnet_ids, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "kubectlPrivateSubnetIds") unless @kubectl_private_subnet_ids.nil? @kubectl_provider = kubectl_provider Jsii::Type.check_type(@kubectl_provider, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLklLdWJlY3RsUHJvdmlkZXIifQ==")), "kubectlProvider") unless @kubectl_provider.nil? @kubectl_role_arn = kubectl_role_arn Jsii::Type.check_type(@kubectl_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "kubectlRoleArn") unless @kubectl_role_arn.nil? @kubectl_security_group_id = kubectl_security_group_id Jsii::Type.check_type(@kubectl_security_group_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "kubectlSecurityGroupId") unless @kubectl_security_group_id.nil? @on_event_layer = on_event_layer Jsii::Type.check_type(@on_event_layer, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklMYXllclZlcnNpb24ifQ==")), "onEventLayer") unless @on_event_layer.nil? @open_id_connect_provider = open_id_connect_provider Jsii::Type.check_type(@open_id_connect_provider, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklPcGVuSWRDb25uZWN0UHJvdmlkZXIifQ==")), "openIdConnectProvider") unless @open_id_connect_provider.nil? @prune = prune Jsii::Type.check_type(@prune, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "prune") unless @prune.nil? @security_group_ids = security_group_ids Jsii::Type.check_type(@security_group_ids, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "securityGroupIds") unless @security_group_ids.nil? @vpc = vpc Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc") unless @vpc.nil? end |
Instance Attribute Details
#awscli_layer ⇒ AWSCDK::Lambda::ILayerVersion? (readonly)
Default: - a default layer with the AWS CLI 1.x
An AWS Lambda layer that contains the aws CLI.
The handler expects the layer to include the following executables:
/opt/awscli/aws
87 88 89 |
# File 'eks/cluster_attributes.rb', line 87 def awscli_layer @awscli_layer end |
#cluster_certificate_authority_data ⇒ String? (readonly)
Default: - if not specified cluster.clusterCertificateAuthorityData will throw an error
The certificate-authority-data for your cluster.
92 93 94 |
# File 'eks/cluster_attributes.rb', line 92 def @cluster_certificate_authority_data end |
#cluster_encryption_config_key_arn ⇒ String? (readonly)
Default: - if not specified cluster.clusterEncryptionConfigKeyArn will throw an error
Amazon Resource Name (ARN) or alias of the customer master key (CMK).
97 98 99 |
# File 'eks/cluster_attributes.rb', line 97 def cluster_encryption_config_key_arn @cluster_encryption_config_key_arn end |
#cluster_endpoint ⇒ String? (readonly)
Default: - if not specified cluster.clusterEndpoint will throw an error.
The API Server endpoint URL.
102 103 104 |
# File 'eks/cluster_attributes.rb', line 102 def cluster_endpoint @cluster_endpoint end |
#cluster_handler_security_group_id ⇒ String? (readonly)
Default: - No security group.
A security group id to associate with the Cluster Handler's Lambdas.
The Cluster Handler's Lambdas are responsible for calling AWS's EKS API.
109 110 111 |
# File 'eks/cluster_attributes.rb', line 109 def cluster_handler_security_group_id @cluster_handler_security_group_id end |
#cluster_name ⇒ String (readonly)
The physical name of the Cluster.
76 77 78 |
# File 'eks/cluster_attributes.rb', line 76 def cluster_name @cluster_name end |
#cluster_security_group_id ⇒ String? (readonly)
Default: - if not specified cluster.clusterSecurityGroupId will throw an error
The cluster security group that was created by Amazon EKS for the cluster.
114 115 116 |
# File 'eks/cluster_attributes.rb', line 114 def cluster_security_group_id @cluster_security_group_id end |
#ip_family ⇒ AWSCDK::EKS::IPFamily? (readonly)
Default: - IpFamily.IP_V4
Specify which IP family is used to assign Kubernetes pod and service IP addresses.
120 121 122 |
# File 'eks/cluster_attributes.rb', line 120 def ip_family @ip_family end |
#kubectl_environment ⇒ Hash{String => String}? (readonly)
Default: - no additional variables
Environment variables to use when running kubectl against this cluster.
125 126 127 |
# File 'eks/cluster_attributes.rb', line 125 def kubectl_environment @kubectl_environment end |
#kubectl_lambda_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - if not specified, the default role created by a lambda function will be used.
An IAM role that can perform kubectl operations against this cluster.
The role should be mapped to the system:masters Kubernetes RBAC role.
This role is directly passed to the lambda handler that sends Kube Ctl commands to the cluster.
135 136 137 |
# File 'eks/cluster_attributes.rb', line 135 def kubectl_lambda_role @kubectl_lambda_role end |
#kubectl_layer ⇒ AWSCDK::Lambda::ILayerVersion? (readonly)
Default: - No default layer will be provided
An AWS Lambda Layer which includes kubectl and Helm.
This layer is used by the kubectl handler to apply manifests and install
helm charts. You must pick an appropriate releases of one of the
@aws-cdk/layer-kubectl-vXX packages, that works with the version of
Kubernetes you have chosen.
The handler expects the layer to include the following executables:
/opt/helm/helm
/opt/kubectl/kubectl
152 153 154 |
# File 'eks/cluster_attributes.rb', line 152 def kubectl_layer @kubectl_layer end |
#kubectl_memory ⇒ AWSCDK::Size? (readonly)
Default: Size.gibibytes(1)
Amount of memory to allocate to the provider's lambda function.
157 158 159 |
# File 'eks/cluster_attributes.rb', line 157 def kubectl_memory @kubectl_memory end |
#kubectl_private_subnet_ids ⇒ Array<String>? (readonly)
Default: - k8s endpoint is expected to be accessible publicly
Subnets to host the kubectl compute resources.
If not specified, the k8s endpoint is expected to be accessible publicly.
165 166 167 |
# File 'eks/cluster_attributes.rb', line 165 def kubectl_private_subnet_ids @kubectl_private_subnet_ids end |
#kubectl_provider ⇒ AWSCDK::EKS::IKubectlProvider? (readonly)
Default: - Default CDK provider
KubectlProvider for issuing kubectl commands.
170 171 172 |
# File 'eks/cluster_attributes.rb', line 170 def kubectl_provider @kubectl_provider end |
#kubectl_role_arn ⇒ String? (readonly)
Default: - if not specified, it not be possible to issue kubectl commands against an imported cluster.
An IAM role with cluster administrator and "system:masters" permissions.
175 176 177 |
# File 'eks/cluster_attributes.rb', line 175 def kubectl_role_arn @kubectl_role_arn end |
#kubectl_security_group_id ⇒ String? (readonly)
Default: - k8s endpoint is expected to be accessible publicly
A security group to use for kubectl execution.
If not specified, the k8s endpoint is expected to be accessible publicly.
183 184 185 |
# File 'eks/cluster_attributes.rb', line 183 def kubectl_security_group_id @kubectl_security_group_id end |
#on_event_layer ⇒ AWSCDK::Lambda::ILayerVersion? (readonly)
Default: - a layer bundled with this module.
An AWS Lambda Layer which includes the NPM dependency proxy-agent.
This layer is used by the onEvent handler to route AWS SDK requests through a proxy.
The handler expects the layer to include the following node_modules:
proxy-agent
195 196 197 |
# File 'eks/cluster_attributes.rb', line 195 def on_event_layer @on_event_layer end |
#open_id_connect_provider ⇒ AWSCDK::IAM::IOpenIdConnectProvider? (readonly)
Default: - if not specified cluster.openIdConnectProvider and cluster.addServiceAccount will throw an error.
An Open ID Connect provider for this cluster that can be used to configure service accounts.
You can either import an existing provider using iam.OpenIdConnectProvider.fromProviderArn,
or create a new provider using new eks.OpenIdConnectProvider
203 204 205 |
# File 'eks/cluster_attributes.rb', line 203 def open_id_connect_provider @open_id_connect_provider end |
#prune ⇒ Boolean? (readonly)
Default: true
Indicates whether Kubernetes resources added through addManifest() can be automatically pruned.
When this is enabled (default), prune labels will be
allocated and injected to each resource. These labels will then be used
when issuing the kubectl apply operation with the --prune switch.
212 213 214 |
# File 'eks/cluster_attributes.rb', line 212 def prune @prune end |
#security_group_ids ⇒ Array<String>? (readonly)
Default: - if not specified, no additional security groups will be considered in cluster.connections.
Additional security groups associated with this cluster.
217 218 219 |
# File 'eks/cluster_attributes.rb', line 217 def security_group_ids @security_group_ids end |
#vpc ⇒ AWSCDK::EC2::IVPC? (readonly)
Default: - if not specified cluster.vpc will throw an error
The VPC in which this Cluster was created.
222 223 224 |
# File 'eks/cluster_attributes.rb', line 222 def vpc @vpc end |
Class Method Details
.jsii_properties ⇒ Object
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'eks/cluster_attributes.rb', line 224 def self.jsii_properties { :cluster_name => "clusterName", :awscli_layer => "awscliLayer", :cluster_certificate_authority_data => "clusterCertificateAuthorityData", :cluster_encryption_config_key_arn => "clusterEncryptionConfigKeyArn", :cluster_endpoint => "clusterEndpoint", :cluster_handler_security_group_id => "clusterHandlerSecurityGroupId", :cluster_security_group_id => "clusterSecurityGroupId", :ip_family => "ipFamily", :kubectl_environment => "kubectlEnvironment", :kubectl_lambda_role => "kubectlLambdaRole", :kubectl_layer => "kubectlLayer", :kubectl_memory => "kubectlMemory", :kubectl_private_subnet_ids => "kubectlPrivateSubnetIds", :kubectl_provider => "kubectlProvider", :kubectl_role_arn => "kubectlRoleArn", :kubectl_security_group_id => "kubectlSecurityGroupId", :on_event_layer => "onEventLayer", :open_id_connect_provider => "openIdConnectProvider", :prune => "prune", :security_group_ids => "securityGroupIds", :vpc => "vpc", } end |
Instance Method Details
#to_jsii ⇒ Object
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'eks/cluster_attributes.rb', line 250 def to_jsii result = {} result.merge!({ "clusterName" => @cluster_name, "awscliLayer" => @awscli_layer, "clusterCertificateAuthorityData" => @cluster_certificate_authority_data, "clusterEncryptionConfigKeyArn" => @cluster_encryption_config_key_arn, "clusterEndpoint" => @cluster_endpoint, "clusterHandlerSecurityGroupId" => @cluster_handler_security_group_id, "clusterSecurityGroupId" => @cluster_security_group_id, "ipFamily" => @ip_family, "kubectlEnvironment" => @kubectl_environment, "kubectlLambdaRole" => @kubectl_lambda_role, "kubectlLayer" => @kubectl_layer, "kubectlMemory" => @kubectl_memory, "kubectlPrivateSubnetIds" => @kubectl_private_subnet_ids, "kubectlProvider" => @kubectl_provider, "kubectlRoleArn" => @kubectl_role_arn, "kubectlSecurityGroupId" => @kubectl_security_group_id, "onEventLayer" => @on_event_layer, "openIdConnectProvider" => @open_id_connect_provider, "prune" => @prune, "securityGroupIds" => @security_group_ids, "vpc" => @vpc, }) result.compact end |