Addon

class Addon : KotlinCustomResource

Manages an EKS add-on.

Note: Amazon EKS add-on can only be used with Amazon EKS Clusters running version 1.18 with platform version eks.3 or later because add-ons rely on the Server-side Apply Kubernetes feature, which is only available in Kubernetes 1.18 and later.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.eks.Addon;
import com.pulumi.aws.eks.AddonArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Addon("example", AddonArgs.builder()
.clusterName(aws_eks_cluster.example().name())
.addonName("vpc-cni")
.build());
}
}

Example Update add-on usage with resolve_conflicts and PRESERVE

resolve_conflicts with PRESERVE can be used to retain the config changes applied to the add-on with kubectl while upgrading to a newer version of the add-on.

Note: resolve_conflicts with PRESERVE can only be used for upgrading the add-ons but not during the creation of add-on.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.eks.Addon("example", {
clusterName: aws_eks_cluster.example.name,
addonName: "coredns",
addonVersion: "v1.8.7-eksbuild.3",
resolveConflicts: "PRESERVE",
});
import pulumi
import pulumi_aws as aws
example = aws.eks.Addon("example",
cluster_name=aws_eks_cluster["example"]["name"],
addon_name="coredns",
addon_version="v1.8.7-eksbuild.3",
resolve_conflicts="PRESERVE")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Eks.Addon("example", new()
{
ClusterName = aws_eks_cluster.Example.Name,
AddonName = "coredns",
AddonVersion = "v1.8.7-eksbuild.3",
ResolveConflicts = "PRESERVE",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/eks"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := eks.NewAddon(ctx, "example", &eks.AddonArgs{
ClusterName: pulumi.Any(aws_eks_cluster.Example.Name),
AddonName: pulumi.String("coredns"),
AddonVersion: pulumi.String("v1.8.7-eksbuild.3"),
ResolveConflicts: pulumi.String("PRESERVE"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.eks.Addon;
import com.pulumi.aws.eks.AddonArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Addon("example", AddonArgs.builder()
.clusterName(aws_eks_cluster.example().name())
.addonName("coredns")
.addonVersion("v1.8.7-eksbuild.3")
.resolveConflicts("PRESERVE")
.build());
}
}
resources:
example:
type: aws:eks:Addon
properties:
clusterName: ${aws_eks_cluster.example.name}
addonName: coredns
addonVersion: v1.8.7-eksbuild.3
#e.g., previous version v1.8.7-eksbuild.2 and the new version is v1.8.7-eksbuild.3
resolveConflicts: PRESERVE

Example add-on usage with custom configuration_values

Custom add-on configuration can be passed using configuration_values as a single JSON string while creating or updating the add-on.

Note: configuration_values is a single JSON string should match the valid JSON schema for each add-on with specific version. To find the correct JSON schema for each add-on can be extracted using describe-addon-configuration call. This below is an example for extracting the configuration_values schema for coredns.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;
return await Deployment.RunAsync(() =>
{
});
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
}
}
{}

Example to create a coredns managed addon with custom configuration_values.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.eks.Addon("example", {
addonName: "coredns",
addonVersion: "v1.8.7-eksbuild.3",
clusterName: "mycluster",
configurationValues: "{\"replicaCount\":4,\"resources\":{\"limits\":{\"cpu\":\"100m\",\"memory\":\"150Mi\"},\"requests\":{\"cpu\":\"100m\",\"memory\":\"150Mi\"}}}",
resolveConflicts: "OVERWRITE",
});
import pulumi
import pulumi_aws as aws
example = aws.eks.Addon("example",
addon_name="coredns",
addon_version="v1.8.7-eksbuild.3",
cluster_name="mycluster",
configuration_values="{\"replicaCount\":4,\"resources\":{\"limits\":{\"cpu\":\"100m\",\"memory\":\"150Mi\"},\"requests\":{\"cpu\":\"100m\",\"memory\":\"150Mi\"}}}",
resolve_conflicts="OVERWRITE")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Eks.Addon("example", new()
{
AddonName = "coredns",
AddonVersion = "v1.8.7-eksbuild.3",
ClusterName = "mycluster",
ConfigurationValues = "{\"replicaCount\":4,\"resources\":{\"limits\":{\"cpu\":\"100m\",\"memory\":\"150Mi\"},\"requests\":{\"cpu\":\"100m\",\"memory\":\"150Mi\"}}}",
ResolveConflicts = "OVERWRITE",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/eks"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := eks.NewAddon(ctx, "example", &eks.AddonArgs{
AddonName: pulumi.String("coredns"),
AddonVersion: pulumi.String("v1.8.7-eksbuild.3"),
ClusterName: pulumi.String("mycluster"),
ConfigurationValues: pulumi.String("{\"replicaCount\":4,\"resources\":{\"limits\":{\"cpu\":\"100m\",\"memory\":\"150Mi\"},\"requests\":{\"cpu\":\"100m\",\"memory\":\"150Mi\"}}}"),
ResolveConflicts: pulumi.String("OVERWRITE"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.eks.Addon;
import com.pulumi.aws.eks.AddonArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Addon("example", AddonArgs.builder()
.addonName("coredns")
.addonVersion("v1.8.7-eksbuild.3")
.clusterName("mycluster")
.configurationValues("{\"replicaCount\":4,\"resources\":{\"limits\":{\"cpu\":\"100m\",\"memory\":\"150Mi\"},\"requests\":{\"cpu\":\"100m\",\"memory\":\"150Mi\"}}}")
.resolveConflicts("OVERWRITE")
.build());
}
}
resources:
example:
type: aws:eks:Addon
properties:
addonName: coredns
addonVersion: v1.8.7-eksbuild.3
clusterName: mycluster
configurationValues: '{"replicaCount":4,"resources":{"limits":{"cpu":"100m","memory":"150Mi"},"requests":{"cpu":"100m","memory":"150Mi"}}}'
resolveConflicts: OVERWRITE

Import

EKS add-on can be imported using the cluster_name and addon_name separated by a colon (:), e.g.,

$ pulumi import aws:eks/addon:Addon my_eks_addon my_cluster_name:my_addon_name

Properties

Link copied to clipboard
val addonName: Output<String>

Name of the EKS add-on. The name must match one of the names returned by describe-addon-versions.

Link copied to clipboard
val addonVersion: Output<String>

The version of the EKS add-on. The version must match one of the versions returned by describe-addon-versions.

Link copied to clipboard
val arn: Output<String>

Amazon Resource Name (ARN) of the EKS add-on.

Link copied to clipboard
val clusterName: Output<String>

Name of the EKS Cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (^[0-9A-Za-z][A-Za-z0-9\-_]+$). The following arguments are optional:

Link copied to clipboard

custom configuration values for addons with single JSON string. This JSON string value must match the JSON schema derived from describe-addon-configuration.

Link copied to clipboard
val createdAt: Output<String>

Date and time in RFC3339 format that the EKS add-on was created.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val modifiedAt: Output<String>

Date and time in RFC3339 format that the EKS add-on was updated.

Link copied to clipboard
val preserve: Output<Boolean>?

Indicates if you want to preserve the created resources when deleting the EKS add-on.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resolveConflicts: Output<String>?

Define how to resolve parameter value conflicts when migrating an existing add-on to an Amazon EKS add-on or when applying version updates to the add-on. Valid values are NONE, OVERWRITE and PRESERVE. For more details check UpdateAddon API Docs.

Link copied to clipboard

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.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

(Optional) Key-value map of resource tags, including those inherited from the provider default_tags configuration block.

Link copied to clipboard
val urn: Output<String>