1. Packages
  2. AWS
  3. API Docs
  4. eks
  5. getClusterAuth
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.eks.getClusterAuth

Explore with Pulumi AI

AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

Get an authentication token to communicate with an EKS cluster.

Uses IAM credentials from the AWS provider to generate a temporary token that is compatible with AWS IAM Authenticator authentication. This can be used to authenticate to an EKS cluster or to a cluster that has the AWS IAM Authenticator server configured.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = aws.eks.getCluster({
    name: "example",
});
const exampleGetClusterAuth = aws.eks.getClusterAuth({
    name: "example",
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.eks.get_cluster(name="example")
example_get_cluster_auth = aws.eks.get_cluster_auth(name="example")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/eks"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := eks.LookupCluster(ctx, &eks.LookupClusterArgs{
			Name: "example",
		}, nil)
		if err != nil {
			return err
		}
		_, err = eks.GetClusterAuth(ctx, &eks.GetClusterAuthArgs{
			Name: "example",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = Aws.Eks.GetCluster.Invoke(new()
    {
        Name = "example",
    });

    var exampleGetClusterAuth = Aws.Eks.GetClusterAuth.Invoke(new()
    {
        Name = "example",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.eks.EksFunctions;
import com.pulumi.aws.eks.inputs.GetClusterArgs;
import com.pulumi.aws.eks.inputs.GetClusterAuthArgs;
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) {
        final var example = EksFunctions.getCluster(GetClusterArgs.builder()
            .name("example")
            .build());

        final var exampleGetClusterAuth = EksFunctions.getClusterAuth(GetClusterAuthArgs.builder()
            .name("example")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: aws:eks:getCluster
      arguments:
        name: example
  exampleGetClusterAuth:
    fn::invoke:
      function: aws:eks:getClusterAuth
      arguments:
        name: example
Copy

Using getClusterAuth

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 getClusterAuth(args: GetClusterAuthArgs, opts?: InvokeOptions): Promise<GetClusterAuthResult>
function getClusterAuthOutput(args: GetClusterAuthOutputArgs, opts?: InvokeOptions): Output<GetClusterAuthResult>
Copy
def get_cluster_auth(name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetClusterAuthResult
def get_cluster_auth_output(name: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetClusterAuthResult]
Copy
func GetClusterAuth(ctx *Context, args *GetClusterAuthArgs, opts ...InvokeOption) (*GetClusterAuthResult, error)
func GetClusterAuthOutput(ctx *Context, args *GetClusterAuthOutputArgs, opts ...InvokeOption) GetClusterAuthResultOutput
Copy

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

public static class GetClusterAuth 
{
    public static Task<GetClusterAuthResult> InvokeAsync(GetClusterAuthArgs args, InvokeOptions? opts = null)
    public static Output<GetClusterAuthResult> Invoke(GetClusterAuthInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetClusterAuthResult> getClusterAuth(GetClusterAuthArgs args, InvokeOptions options)
public static Output<GetClusterAuthResult> getClusterAuth(GetClusterAuthArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:eks/getClusterAuth:getClusterAuth
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Name of the cluster
Name This property is required. string
Name of the cluster
name This property is required. String
Name of the cluster
name This property is required. string
Name of the cluster
name This property is required. str
Name of the cluster
name This property is required. String
Name of the cluster

getClusterAuth Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Name string
Token string
Token to use to authenticate with the cluster.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Token string
Token to use to authenticate with the cluster.
id String
The provider-assigned unique ID for this managed resource.
name String
token String
Token to use to authenticate with the cluster.
id string
The provider-assigned unique ID for this managed resource.
name string
token string
Token to use to authenticate with the cluster.
id str
The provider-assigned unique ID for this managed resource.
name str
token str
Token to use to authenticate with the cluster.
id String
The provider-assigned unique ID for this managed resource.
name String
token String
Token to use to authenticate with the cluster.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi