Class: AWSCDK::EKSv2::AddonProps

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

Overview

Properties for creating an Amazon EKS Add-On.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(addon_name:, cluster:, addon_version: nil, configuration_values: nil, preserve_on_delete: nil, removal_policy: nil) ⇒ AddonProps

Returns a new instance of AddonProps.

Parameters:

  • addon_name (String)

    Name of the Add-On.

  • cluster (AWSCDK::EKSv2::ICluster)

    The EKS cluster the Add-On is associated with.

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

    Version of the Add-On.

  • configuration_values (Hash{String => Object}, nil) (defaults to: nil)

    The configuration values for the Add-on.

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

    Specifying this option preserves the add-on software on your cluster but Amazon EKS stops managing any settings for the add-on.

  • removal_policy (AWSCDK::RemovalPolicy, nil) (defaults to: nil)

    The removal policy applied to the EKS add-on.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'ek_sv2/addon_props.rb', line 13

def initialize(addon_name:, cluster:, addon_version: nil, configuration_values: nil, preserve_on_delete: nil, removal_policy: nil)
  @addon_name = addon_name
  Jsii::Type.check_type(@addon_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "addonName")
  @cluster = cluster
  Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLklDbHVzdGVyIn0=")), "cluster")
  @addon_version = addon_version
  Jsii::Type.check_type(@addon_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "addonVersion") unless @addon_version.nil?
  @configuration_values = configuration_values
  Jsii::Type.check_type(@configuration_values, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "configurationValues") unless @configuration_values.nil?
  @preserve_on_delete = preserve_on_delete
  Jsii::Type.check_type(@preserve_on_delete, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "preserveOnDelete") unless @preserve_on_delete.nil?
  @removal_policy = removal_policy
  Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil?
end

Instance Attribute Details

#addon_nameString (readonly)

Name of the Add-On.

Returns:

  • (String)


31
32
33
# File 'ek_sv2/addon_props.rb', line 31

def addon_name
  @addon_name
end

#addon_versionString? (readonly)

Note:

Default: the latest version.

Version of the Add-On.

You can check all available versions with describe-addon-versions. For example, this lists all available versions for the eks-pod-identity-agent addon: $ aws eks describe-addon-versions --addon-name eks-pod-identity-agent \ --query 'addons[].addonVersions[].addonVersion'

Returns:

  • (String, nil)


45
46
47
# File 'ek_sv2/addon_props.rb', line 45

def addon_version
  @addon_version
end

#clusterAWSCDK::EKSv2::ICluster (readonly)

The EKS cluster the Add-On is associated with.



35
36
37
# File 'ek_sv2/addon_props.rb', line 35

def cluster
  @cluster
end

#configuration_valuesHash{String => Object}? (readonly)

Note:

Default: - Use default configuration.

The configuration values for the Add-on.

Returns:

  • (Hash{String => Object}, nil)


50
51
52
# File 'ek_sv2/addon_props.rb', line 50

def configuration_values
  @configuration_values
end

#preserve_on_deleteBoolean? (readonly)

Note:

Default: true

Specifying this option preserves the add-on software on your cluster but Amazon EKS stops managing any settings for the add-on.

If an IAM account is associated with the add-on, it isn't removed.

Returns:

  • (Boolean, nil)


57
58
59
# File 'ek_sv2/addon_props.rb', line 57

def preserve_on_delete
  @preserve_on_delete
end

#removal_policyAWSCDK::RemovalPolicy? (readonly)

Note:

Default: RemovalPolicy.DESTROY

The removal policy applied to the EKS add-on.

The removal policy controls what happens to the resource if it stops being managed by CloudFormation. This can happen in one of three situations:

  • The resource is removed from the template, so CloudFormation stops managing it
  • A change to the resource is made that requires it to be replaced, so CloudFormation stops managing it
  • The stack is deleted, so CloudFormation stops managing all resources in it

Returns:



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

def removal_policy
  @removal_policy
end

Class Method Details

.jsii_propertiesObject



71
72
73
74
75
76
77
78
79
80
# File 'ek_sv2/addon_props.rb', line 71

def self.jsii_properties
  {
    :addon_name => "addonName",
    :cluster => "cluster",
    :addon_version => "addonVersion",
    :configuration_values => "configurationValues",
    :preserve_on_delete => "preserveOnDelete",
    :removal_policy => "removalPolicy",
  }
end

Instance Method Details

#to_jsiiObject



82
83
84
85
86
87
88
89
90
91
92
93
# File 'ek_sv2/addon_props.rb', line 82

def to_jsii
  result = {}
  result.merge!({
    "addonName" => @addon_name,
    "cluster" => @cluster,
    "addonVersion" => @addon_version,
    "configurationValues" => @configuration_values,
    "preserveOnDelete" => @preserve_on_delete,
    "removalPolicy" => @removal_policy,
  })
  result.compact
end