diff --git a/examples/cluster-py/__main__.py b/examples/cluster-py/__main__.py index cb4d75873..5731ff316 100644 --- a/examples/cluster-py/__main__.py +++ b/examples/cluster-py/__main__.py @@ -71,11 +71,15 @@ ### EKS Addons ### ########################## +coredns_version = aws.eks.get_addon_version_output(addon_name="coredns", + kubernetes_version=cluster3.eks_cluster.version, + most_recent=True) + coredns = eks.Addon( f"{project_name}-cluster3-coredns", cluster=cluster3, addon_name="coredns", - addon_version="v1.11.1-eksbuild.9", + addon_version=coredns_version.version, resolve_conflicts_on_update="PRESERVE", configuration_values={ "replicaCount": 4, diff --git a/examples/cluster/index.ts b/examples/cluster/index.ts index 0739466f3..0327a2ec3 100644 --- a/examples/cluster/index.ts +++ b/examples/cluster/index.ts @@ -1,4 +1,5 @@ import * as pulumi from "@pulumi/pulumi"; +import * as aws from "@pulumi/aws"; import * as awsx from "@pulumi/awsx"; import * as eks from "@pulumi/eks"; @@ -62,11 +63,17 @@ const cluster4 = new eks.Cluster(`${projectName}-4`, { /// EKS Addons /// ////////////////////////// +const corednsVersion = aws.eks.getAddonVersionOutput({ + addonName: "coredns", + kubernetesVersion: cluster3.eksCluster.version, + mostRecent: true, +}); + // Test that we can create a coredns addon within cluster3. const coredns = new eks.Addon("coredns", { cluster: cluster3, addonName: "coredns", - addonVersion: "v1.11.1-eksbuild.9", + addonVersion: corednsVersion.version, resolveConflictsOnUpdate: "PRESERVE", configurationValues: { replicaCount: 4, diff --git a/examples/cluster/package.json b/examples/cluster/package.json index fef1ff9a6..92768862a 100644 --- a/examples/cluster/package.json +++ b/examples/cluster/package.json @@ -7,6 +7,7 @@ "dependencies": { "@pulumi/pulumi": "^3.0.0", "@pulumi/awsx": "^2.0.2", + "@pulumi/aws": "^6.56.0", "@pulumi/eks": "latest" }, "scripts": {