AddonProps Struct
Properties for creating an Amazon EKS Add-On.
Example
ts
declare const cluster: eks.Cluster;
new eks.Addon(this, 'Addon', {
cluster,
addonName: 'coredns',
addonVersion: '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.
preserveOnDelete: false,
configurationValues: {
replicaCount: 2,
},
});
python
# 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
}
)
java
Cluster cluster;
Addon.Builder.create(this, "Addon")
.cluster(cluster)
.addonName("coredns")
.addonVersion("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.
.preserveOnDelete(false)
.configurationValues(Map.of(
"replicaCount", 2))
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Cluster cluster;
new Addon(this, "Addon", new AddonProps {
Cluster = cluster,
AddonName = "coredns",
AddonVersion = "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.
PreserveOnDelete = false,
ConfigurationValues = new Dictionary<string, object> {
{ "replicaCount", 2 }
}
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var cluster Cluster
eks.NewAddon(this, jsii.String("Addon"), &AddonProps{
Cluster: Cluster,
AddonName: jsii.String("coredns"),
AddonVersion: jsii.String("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.
PreserveOnDelete: jsii.Boolean(false),
ConfigurationValues: map[string]interface{}{
"replicaCount": jsii.Number(2),
},
})
Properties
Name of the Add-On.
addonVersionoptionalstringaddon_versionoptionalstraddonVersionoptionalStringAddonVersionoptionalstringAddonVersionoptional*string#Version of the Add-On.
Default: the latest version.
notes
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'
The EKS cluster the Add-On is associated with.
configurationValuesoptional{ [key: string]: any }configuration_valuesoptionaltyping.Mapping[str, Any]configurationValuesoptionalMap<String, Object>ConfigurationValuesoptionalIDictionary<string, object>ConfigurationValuesoptional*map[string]interface{}#The configuration values for the Add-on.
Default: Use default configuration.
preserveOnDeleteoptionalbooleanpreserve_on_deleteoptionalboolpreserveOnDeleteoptionalBooleanPreserveOnDeleteoptionalboolPreserveOnDeleteoptional*bool= 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.
removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.DESTROY#The removal policy applied to the EKS add-on.
notes
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