AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.4.0 published on Wednesday, May 4, 2022 by Pulumi

getAddonVersion

Retrieve information about a specific EKS add-on version compatible with an EKS cluster version.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultAddonVersion = Output.Create(Aws.Eks.GetAddonVersion.InvokeAsync(new Aws.Eks.GetAddonVersionArgs
        {
            AddonName = "vpc-cni",
            KubernetesVersion = aws_eks_cluster.Example.Version,
        }));
        var latestAddonVersion = Output.Create(Aws.Eks.GetAddonVersion.InvokeAsync(new Aws.Eks.GetAddonVersionArgs
        {
            AddonName = "vpc-cni",
            KubernetesVersion = aws_eks_cluster.Example.Version,
            MostRecent = true,
        }));
        var vpcCni = new Aws.Eks.Addon("vpcCni", new Aws.Eks.AddonArgs
        {
            ClusterName = aws_eks_cluster.Example.Name,
            AddonName = "vpc-cni",
            AddonVersion = latestAddonVersion.Apply(latestAddonVersion => latestAddonVersion.Version),
        });
        this.Default = defaultAddonVersion.Apply(defaultAddonVersion => defaultAddonVersion.Version);
        this.Latest = latestAddonVersion.Apply(latestAddonVersion => latestAddonVersion.Version);
    }

    [Output("default")]
    public Output<string> Default { get; set; }
    [Output("latest")]
    public Output<string> Latest { get; set; }
}
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 {
		defaultAddonVersion, err := eks.GetAddonVersion(ctx, &eks.GetAddonVersionArgs{
			AddonName:         "vpc-cni",
			KubernetesVersion: aws_eks_cluster.Example.Version,
		}, nil)
		if err != nil {
			return err
		}
		latestAddonVersion, err := eks.GetAddonVersion(ctx, &eks.GetAddonVersionArgs{
			AddonName:         "vpc-cni",
			KubernetesVersion: aws_eks_cluster.Example.Version,
			MostRecent:        pulumi.BoolRef(true),
		}, nil)
		if err != nil {
			return err
		}
		_, err = eks.NewAddon(ctx, "vpcCni", &eks.AddonArgs{
			ClusterName:  pulumi.Any(aws_eks_cluster.Example.Name),
			AddonName:    pulumi.String("vpc-cni"),
			AddonVersion: pulumi.String(latestAddonVersion.Version),
		})
		if err != nil {
			return err
		}
		ctx.Export("default", defaultAddonVersion.Version)
		ctx.Export("latest", latestAddonVersion.Version)
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var defaultAddonVersion = Output.of(EksFunctions.getAddonVersion(GetAddonVersionArgs.builder()
            .addonName("vpc-cni")
            .kubernetesVersion(aws_eks_cluster.getExample().getVersion())
            .build()));

        final var latestAddonVersion = Output.of(EksFunctions.getAddonVersion(GetAddonVersionArgs.builder()
            .addonName("vpc-cni")
            .kubernetesVersion(aws_eks_cluster.getExample().getVersion())
            .mostRecent(true)
            .build()));

        var vpcCni = new Addon("vpcCni", AddonArgs.builder()        
            .clusterName(aws_eks_cluster.getExample().getName())
            .addonName("vpc-cni")
            .addonVersion(latestAddonVersion.apply(getAddonVersionResult -> getAddonVersionResult.getVersion()))
            .build());

        ctx.export("default", defaultAddonVersion.apply(getAddonVersionResult -> getAddonVersionResult.getVersion()));
        ctx.export("latest", latestAddonVersion.apply(getAddonVersionResult -> getAddonVersionResult.getVersion()));
        }
}
import pulumi
import pulumi_aws as aws

default_addon_version = aws.eks.get_addon_version(addon_name="vpc-cni",
    kubernetes_version=aws_eks_cluster["example"]["version"])
latest_addon_version = aws.eks.get_addon_version(addon_name="vpc-cni",
    kubernetes_version=aws_eks_cluster["example"]["version"],
    most_recent=True)
vpc_cni = aws.eks.Addon("vpcCni",
    cluster_name=aws_eks_cluster["example"]["name"],
    addon_name="vpc-cni",
    addon_version=latest_addon_version.version)
pulumi.export("default", default_addon_version.version)
pulumi.export("latest", latest_addon_version.version)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

export = async () => {
    const defaultAddonVersion = await aws.eks.getAddonVersion({
        addonName: "vpc-cni",
        kubernetesVersion: aws_eks_cluster.example.version,
    });
    const latestAddonVersion = await aws.eks.getAddonVersion({
        addonName: "vpc-cni",
        kubernetesVersion: aws_eks_cluster.example.version,
        mostRecent: true,
    });
    const vpcCni = new aws.eks.Addon("vpcCni", {
        clusterName: aws_eks_cluster.example.name,
        addonName: "vpc-cni",
        addonVersion: latestAddonVersion.version,
    });
    const _default = defaultAddonVersion.version;
    const latest = latestAddonVersion.version;
    return {
        "default": _default,
        latest: latest,
    };
}
resources:
  vpcCni:
    type: aws:eks:Addon
    properties:
      clusterName: ${aws_eks_cluster.example.name}
      addonName: vpc-cni
      addonVersion: ${latestAddonVersion.version}
variables:
  defaultAddonVersion:
    Fn::Invoke:
      Function: aws:eks:getAddonVersion
      Arguments:
        addonName: vpc-cni
        kubernetesVersion: ${aws_eks_cluster.example.version}
  latestAddonVersion:
    Fn::Invoke:
      Function: aws:eks:getAddonVersion
      Arguments:
        addonName: vpc-cni
        kubernetesVersion: ${aws_eks_cluster.example.version}
        mostRecent: true
outputs:
  default: ${defaultAddonVersion.version}
  latest: ${latestAddonVersion.version}

Using getAddonVersion

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getAddonVersion(args: GetAddonVersionArgs, opts?: InvokeOptions): Promise<GetAddonVersionResult>
function getAddonVersionOutput(args: GetAddonVersionOutputArgs, opts?: InvokeOptions): Output<GetAddonVersionResult>
def get_addon_version(addon_name: Optional[str] = None,
                      kubernetes_version: Optional[str] = None,
                      most_recent: Optional[bool] = None,
                      opts: Optional[InvokeOptions] = None) -> GetAddonVersionResult
def get_addon_version_output(addon_name: Optional[pulumi.Input[str]] = None,
                      kubernetes_version: Optional[pulumi.Input[str]] = None,
                      most_recent: Optional[pulumi.Input[bool]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetAddonVersionResult]
func GetAddonVersion(ctx *Context, args *GetAddonVersionArgs, opts ...InvokeOption) (*GetAddonVersionResult, error)
func GetAddonVersionOutput(ctx *Context, args *GetAddonVersionOutputArgs, opts ...InvokeOption) GetAddonVersionResultOutput

> Note: This function is named GetAddonVersion in the Go SDK.

public static class GetAddonVersion 
{
    public static Task<GetAddonVersionResult> InvokeAsync(GetAddonVersionArgs args, InvokeOptions? opts = null)
    public static Output<GetAddonVersionResult> Invoke(GetAddonVersionInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAddonVersionResult> getAddonVersion(GetAddonVersionArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:eks/getAddonVersion:getAddonVersion
  Arguments:
    # Arguments dictionary

The following arguments are supported:

AddonName string

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

KubernetesVersion string

Version 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\-_]+$).

MostRecent bool

Determines if the most recent or default version of the addon should be returned.

AddonName string

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

KubernetesVersion string

Version 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\-_]+$).

MostRecent bool

Determines if the most recent or default version of the addon should be returned.

addonName String

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

kubernetesVersion String

Version 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\-_]+$).

mostRecent Boolean

Determines if the most recent or default version of the addon should be returned.

addonName string

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

kubernetesVersion string

Version 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\-_]+$).

mostRecent boolean

Determines if the most recent or default version of the addon should be returned.

addon_name str

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

kubernetes_version str

Version 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\-_]+$).

most_recent bool

Determines if the most recent or default version of the addon should be returned.

addonName String

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

kubernetesVersion String

Version 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\-_]+$).

mostRecent Boolean

Determines if the most recent or default version of the addon should be returned.

getAddonVersion Result

The following output properties are available:

AddonName string
Id string

The provider-assigned unique ID for this managed resource.

KubernetesVersion string
Version string

The version of the EKS add-on.

MostRecent bool
AddonName string
Id string

The provider-assigned unique ID for this managed resource.

KubernetesVersion string
Version string

The version of the EKS add-on.

MostRecent bool
addonName String
id String

The provider-assigned unique ID for this managed resource.

kubernetesVersion String
version String

The version of the EKS add-on.

mostRecent Boolean
addonName string
id string

The provider-assigned unique ID for this managed resource.

kubernetesVersion string
version string

The version of the EKS add-on.

mostRecent boolean
addon_name str
id str

The provider-assigned unique ID for this managed resource.

kubernetes_version str
version str

The version of the EKS add-on.

most_recent bool
addonName String
id String

The provider-assigned unique ID for this managed resource.

kubernetesVersion String
version String

The version of the EKS add-on.

mostRecent Boolean

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.