AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi
aws.eks.getClusterAuth
Explore with Pulumi AI
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",
});
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")
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
})
}
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",
});
});
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());
}
}
variables:
example:
fn::invoke:
Function: aws:eks:getCluster
Arguments:
name: example
exampleGetClusterAuth:
fn::invoke:
Function: aws:eks:getClusterAuth
Arguments:
name: example
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>
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]
func GetClusterAuth(ctx *Context, args *GetClusterAuthArgs, opts ...InvokeOption) (*GetClusterAuthResult, error)
func GetClusterAuthOutput(ctx *Context, args *GetClusterAuthOutputArgs, opts ...InvokeOption) GetClusterAuthResultOutput
> 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)
}
public static CompletableFuture<GetClusterAuthResult> getClusterAuth(GetClusterAuthArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:eks/getClusterAuth:getClusterAuth
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- Name of the cluster
- Name string
- Name of the cluster
- name String
- Name of the cluster
- name string
- Name of the cluster
- name str
- Name of the cluster
- name String
- Name of the cluster
getClusterAuth Result
The following output properties are available:
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.