AddonProps

class aws_cdk.aws_eks_v2.AddonProps(*, addon_name, cluster, addon_version=None, configuration_values=None, preserve_on_delete=None, removal_policy=None)

Bases: object

Properties for creating an Amazon EKS Add-On.

Parameters:
  • addon_name (str) – Name of the Add-On.

  • cluster (ICluster) – The EKS cluster the Add-On is associated with.

  • addon_version (Optional[str]) – 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’ Default: the latest version.

  • configuration_values (Optional[Mapping[str, Any]]) – The configuration values for the Add-on. Default: - Use default configuration.

  • preserve_on_delete (Optional[bool]) – 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. Default: true

  • removal_policy (Optional[RemovalPolicy]) – 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 Default: RemovalPolicy.DESTROY

ExampleMetadata:

infused

Example:

# cluster: eks.Cluster


eks.Addon(self, "Addon",
    cluster=cluster,
    addon_name="coredns",
    addon_version="v1.11.4-eksbuild.2",
    # whether to preserve the add-on software on your cluster but Amazon EKS stops managing any settings for the add-on.
    preserve_on_delete=False,
    configuration_values={
        "replica_count": 2
    }
)

Attributes

addon_name

Name of the Add-On.

addon_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’

Default:

the latest version.

cluster

The EKS cluster the Add-On is associated with.

configuration_values

The configuration values for the Add-on.

Default:
  • Use default configuration.

preserve_on_delete

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.

Default:

true

removal_policy

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

Default:

RemovalPolicy.DESTROY