Class: AWSCDK::EKSv2::ClusterAttributes

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ek_sv2/cluster_attributes.rb

Overview

Attributes for EKS clusters.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cluster_name:, cluster_certificate_authority_data: nil, cluster_encryption_config_key_arn: nil, cluster_endpoint: nil, cluster_security_group_id: nil, ip_family: nil, kubectl_provider: nil, kubectl_provider_options: nil, open_id_connect_provider: nil, prune: nil, security_group_ids: nil, vpc: nil) ⇒ ClusterAttributes

Returns a new instance of ClusterAttributes.

Parameters:

  • cluster_name (String)

    The physical name of the Cluster.

  • cluster_certificate_authority_data (String, nil) (defaults to: nil)

    The certificate-authority-data for your cluster.

  • cluster_encryption_config_key_arn (String, nil) (defaults to: nil)

    Amazon Resource Name (ARN) or alias of the customer master key (CMK).

  • cluster_endpoint (String, nil) (defaults to: nil)

    The API Server endpoint URL.

  • cluster_security_group_id (String, nil) (defaults to: nil)

    The cluster security group that was created by Amazon EKS for the cluster.

  • ip_family (AWSCDK::EKSv2::IPFamily, nil) (defaults to: nil)

    Specify which IP family is used to assign Kubernetes pod and service IP addresses.

  • kubectl_provider (AWSCDK::EKSv2::IKubectlProvider, nil) (defaults to: nil)

    KubectlProvider for issuing kubectl commands.

  • kubectl_provider_options (AWSCDK::EKSv2::KubectlProviderOptions, nil) (defaults to: nil)

    Options for creating the kubectl provider - a lambda function that executes kubectl and helm against the cluster.

  • open_id_connect_provider (AWSCDK::IAM::IOpenIdConnectProvider, nil) (defaults to: nil)

    An Open ID Connect provider for this cluster that can be used to configure service accounts.

  • prune (Boolean, nil) (defaults to: nil)

    Indicates whether Kubernetes resources added through addManifest() can be automatically pruned.

  • security_group_ids (Array<String>, nil) (defaults to: nil)

    Additional security groups associated with this cluster.

  • vpc (AWSCDK::EC2::IVPC, nil) (defaults to: nil)

    The VPC in which this Cluster was created.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'ek_sv2/cluster_attributes.rb', line 19

def initialize(cluster_name:, cluster_certificate_authority_data: nil, cluster_encryption_config_key_arn: nil, cluster_endpoint: nil, cluster_security_group_id: nil, ip_family: nil, kubectl_provider: nil, kubectl_provider_options: 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")
  @cluster_certificate_authority_data = 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_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("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLklwRmFtaWx5In0=")), "ipFamily") unless @ip_family.nil?
  @kubectl_provider = kubectl_provider
  Jsii::Type.check_type(@kubectl_provider, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLklLdWJlY3RsUHJvdmlkZXIifQ==")), "kubectlProvider") unless @kubectl_provider.nil?
  @kubectl_provider_options = kubectl_provider_options.is_a?(Hash) ? ::AWSCDK::EKSv2::KubectlProviderOptions.new(**kubectl_provider_options.transform_keys(&:to_sym)) : kubectl_provider_options
  Jsii::Type.check_type(@kubectl_provider_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLkt1YmVjdGxQcm92aWRlck9wdGlvbnMifQ==")), "kubectlProviderOptions") unless @kubectl_provider_options.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

#cluster_certificate_authority_dataString? (readonly)

Note:

Default: - if not specified cluster.clusterCertificateAuthorityData will throw an error

The certificate-authority-data for your cluster.

Returns:

  • (String, nil)


54
55
56
# File 'ek_sv2/cluster_attributes.rb', line 54

def cluster_certificate_authority_data
  @cluster_certificate_authority_data
end

#cluster_encryption_config_key_arnString? (readonly)

Note:

Default: - if not specified cluster.clusterEncryptionConfigKeyArn will throw an error

Amazon Resource Name (ARN) or alias of the customer master key (CMK).

Returns:

  • (String, nil)


59
60
61
# File 'ek_sv2/cluster_attributes.rb', line 59

def cluster_encryption_config_key_arn
  @cluster_encryption_config_key_arn
end

#cluster_endpointString? (readonly)

Note:

Default: - if not specified cluster.clusterEndpoint will throw an error.

The API Server endpoint URL.

Returns:

  • (String, nil)


64
65
66
# File 'ek_sv2/cluster_attributes.rb', line 64

def cluster_endpoint
  @cluster_endpoint
end

#cluster_nameString (readonly)

The physical name of the Cluster.

Returns:

  • (String)


49
50
51
# File 'ek_sv2/cluster_attributes.rb', line 49

def cluster_name
  @cluster_name
end

#cluster_security_group_idString? (readonly)

Note:

Default: - if not specified cluster.clusterSecurityGroupId will throw an error

The cluster security group that was created by Amazon EKS for the cluster.

Returns:

  • (String, nil)


69
70
71
# File 'ek_sv2/cluster_attributes.rb', line 69

def cluster_security_group_id
  @cluster_security_group_id
end

#ip_familyAWSCDK::EKSv2::IPFamily? (readonly)

Note:

Default: - IpFamily.IP_V4

Specify which IP family is used to assign Kubernetes pod and service IP addresses.



75
76
77
# File 'ek_sv2/cluster_attributes.rb', line 75

def ip_family
  @ip_family
end

#kubectl_providerAWSCDK::EKSv2::IKubectlProvider? (readonly)

Note:

Default: - Default CDK provider

KubectlProvider for issuing kubectl commands.



80
81
82
# File 'ek_sv2/cluster_attributes.rb', line 80

def kubectl_provider
  @kubectl_provider
end

#kubectl_provider_optionsAWSCDK::EKSv2::KubectlProviderOptions? (readonly)

Note:

Default: - kubectl provider will not be created by default.

Options for creating the kubectl provider - a lambda function that executes kubectl and helm against the cluster.

If defined, kubectl_layer is a required property.



87
88
89
# File 'ek_sv2/cluster_attributes.rb', line 87

def kubectl_provider_options
  @kubectl_provider_options
end

#open_id_connect_providerAWSCDK::IAM::IOpenIdConnectProvider? (readonly)

Note:

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



95
96
97
# File 'ek_sv2/cluster_attributes.rb', line 95

def open_id_connect_provider
  @open_id_connect_provider
end

#pruneBoolean? (readonly)

Note:

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.

Returns:

  • (Boolean, nil)


104
105
106
# File 'ek_sv2/cluster_attributes.rb', line 104

def prune
  @prune
end

#security_group_idsArray<String>? (readonly)

Note:

Default: - if not specified, no additional security groups will be considered in cluster.connections.

Additional security groups associated with this cluster.

Returns:

  • (Array<String>, nil)


109
110
111
# File 'ek_sv2/cluster_attributes.rb', line 109

def security_group_ids
  @security_group_ids
end

#vpcAWSCDK::EC2::IVPC? (readonly)

Note:

Default: - if not specified cluster.vpc will throw an error

The VPC in which this Cluster was created.

Returns:



114
115
116
# File 'ek_sv2/cluster_attributes.rb', line 114

def vpc
  @vpc
end

Class Method Details

.jsii_propertiesObject



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'ek_sv2/cluster_attributes.rb', line 116

def self.jsii_properties
  {
    :cluster_name => "clusterName",
    :cluster_certificate_authority_data => "clusterCertificateAuthorityData",
    :cluster_encryption_config_key_arn => "clusterEncryptionConfigKeyArn",
    :cluster_endpoint => "clusterEndpoint",
    :cluster_security_group_id => "clusterSecurityGroupId",
    :ip_family => "ipFamily",
    :kubectl_provider => "kubectlProvider",
    :kubectl_provider_options => "kubectlProviderOptions",
    :open_id_connect_provider => "openIdConnectProvider",
    :prune => "prune",
    :security_group_ids => "securityGroupIds",
    :vpc => "vpc",
  }
end

Instance Method Details

#to_jsiiObject



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'ek_sv2/cluster_attributes.rb', line 133

def to_jsii
  result = {}
  result.merge!({
    "clusterName" => @cluster_name,
    "clusterCertificateAuthorityData" => @cluster_certificate_authority_data,
    "clusterEncryptionConfigKeyArn" => @cluster_encryption_config_key_arn,
    "clusterEndpoint" => @cluster_endpoint,
    "clusterSecurityGroupId" => @cluster_security_group_id,
    "ipFamily" => @ip_family,
    "kubectlProvider" => @kubectl_provider,
    "kubectlProviderOptions" => @kubectl_provider_options,
    "openIdConnectProvider" => @open_id_connect_provider,
    "prune" => @prune,
    "securityGroupIds" => @security_group_ids,
    "vpc" => @vpc,
  })
  result.compact
end