java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:46.707Z") @Stability(Stable) public class CfnAddon extends CfnResource implements IInspectable
A CloudFormation AWS::EKS::Addon.

Creates an Amazon EKS add-on.

Amazon EKS add-ons help to automate the provisioning and lifecycle management of common operational software for Amazon EKS clusters. For more information, see Amazon EKS add-ons in the Amazon EKS User Guide .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.eks.legacy.*;
 CfnAddon cfnAddon = CfnAddon.Builder.create(this, "MyCfnAddon")
         .addonName("addonName")
         .clusterName("clusterName")
         // the properties below are optional
         .addonVersion("addonVersion")
         .configurationValues("configurationValues")
         .preserveOnDelete(false)
         .resolveConflicts("resolveConflicts")
         .serviceAccountRoleArn("serviceAccountRoleArn")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnAddon

      protected CfnAddon(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnAddon

      protected CfnAddon(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnAddon

      @Stability(Stable) public CfnAddon(@NotNull Construct scope, @NotNull String id, @NotNull CfnAddonProps props)
      Create a new AWS::EKS::Addon.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The ARN of the add-on, such as arn:aws:eks:us-west-2:111122223333:addon/1-19/vpc-cni/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx .
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      The metadata that you apply to the add-on to assist with categorization and organization.

      Each tag consists of a key and an optional value, both of which you define. Add-on tags do not propagate to any other resources associated with the cluster.

    • getAddonName

      @Stability(Stable) @NotNull public String getAddonName()
      The name of the add-on.
    • setAddonName

      @Stability(Stable) public void setAddonName(@NotNull String value)
      The name of the add-on.
    • getClusterName

      @Stability(Stable) @NotNull public String getClusterName()
      The name of the cluster.
    • setClusterName

      @Stability(Stable) public void setClusterName(@NotNull String value)
      The name of the cluster.
    • getAddonVersion

      @Stability(Stable) @Nullable public String getAddonVersion()
      The version of the add-on.
    • setAddonVersion

      @Stability(Stable) public void setAddonVersion(@Nullable String value)
      The version of the add-on.
    • getConfigurationValues

      @Stability(Stable) @Nullable public String getConfigurationValues()
      The configuration values that you provided.
    • setConfigurationValues

      @Stability(Stable) public void setConfigurationValues(@Nullable String value)
      The configuration values that you provided.
    • getPreserveOnDelete

      @Stability(Stable) @Nullable public Object getPreserveOnDelete()
      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.

    • setPreserveOnDelete

      @Stability(Stable) public void setPreserveOnDelete(@Nullable Boolean value)
      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.

    • setPreserveOnDelete

      @Stability(Stable) public void setPreserveOnDelete(@Nullable IResolvable value)
      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.

    • getResolveConflicts

      @Stability(Stable) @Nullable public String getResolveConflicts()
      How to resolve field value conflicts for an Amazon EKS add-on.

      Conflicts are handled based on the value you choose:

      • None – If the self-managed version of the add-on is installed on your cluster, Amazon EKS doesn't change the value. Creation of the add-on might fail.
      • Overwrite – If the self-managed version of the add-on is installed on your cluster and the Amazon EKS default value is different than the existing value, Amazon EKS changes the value to the Amazon EKS default value.
      • Preserve – Not supported. You can set this value when updating an add-on though. For more information, see UpdateAddon .

      If you don't currently have the self-managed version of the add-on installed on your cluster, the Amazon EKS add-on is installed. Amazon EKS sets all values to default values, regardless of the option that you specify.

    • setResolveConflicts

      @Stability(Stable) public void setResolveConflicts(@Nullable String value)
      How to resolve field value conflicts for an Amazon EKS add-on.

      Conflicts are handled based on the value you choose:

      • None – If the self-managed version of the add-on is installed on your cluster, Amazon EKS doesn't change the value. Creation of the add-on might fail.
      • Overwrite – If the self-managed version of the add-on is installed on your cluster and the Amazon EKS default value is different than the existing value, Amazon EKS changes the value to the Amazon EKS default value.
      • Preserve – Not supported. You can set this value when updating an add-on though. For more information, see UpdateAddon .

      If you don't currently have the self-managed version of the add-on installed on your cluster, the Amazon EKS add-on is installed. Amazon EKS sets all values to default values, regardless of the option that you specify.

    • getServiceAccountRoleArn

      @Stability(Stable) @Nullable public String getServiceAccountRoleArn()
      The Amazon Resource Name (ARN) of an existing IAM role to bind to the add-on's service account.

      The role must be assigned the IAM permissions required by the add-on. If you don't specify an existing IAM role, then the add-on uses the permissions assigned to the node IAM role. For more information, see Amazon EKS node IAM role in the Amazon EKS User Guide .

      To specify an existing IAM role, you must have an IAM OpenID Connect (OIDC) provider created for your cluster. For more information, see Enabling IAM roles for service accounts on your cluster in the Amazon EKS User Guide .

    • setServiceAccountRoleArn

      @Stability(Stable) public void setServiceAccountRoleArn(@Nullable String value)
      The Amazon Resource Name (ARN) of an existing IAM role to bind to the add-on's service account.

      The role must be assigned the IAM permissions required by the add-on. If you don't specify an existing IAM role, then the add-on uses the permissions assigned to the node IAM role. For more information, see Amazon EKS node IAM role in the Amazon EKS User Guide .

      To specify an existing IAM role, you must have an IAM OpenID Connect (OIDC) provider created for your cluster. For more information, see Enabling IAM roles for service accounts on your cluster in the Amazon EKS User Guide .