AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.11.0 published on Wednesday, Aug 17, 2022 by Pulumi

getCluster

Retrieve information about an EKS Cluster.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

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

    return new Dictionary<string, object?>
    {
        ["endpoint"] = example.Apply(getClusterResult => getClusterResult.Endpoint),
        ["kubeconfig-certificate-authority-data"] = example.Apply(getClusterResult => getClusterResult.CertificateAuthorities[0]?.Data),
        ["identity-oidc-issuer"] = example.Apply(getClusterResult => getClusterResult.Identities[0]?.Oidcs[0]?.Issuer),
    };
});
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 {
		example, err := eks.LookupCluster(ctx, &eks.LookupClusterArgs{
			Name: "example",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("endpoint", example.Endpoint)
		ctx.Export("kubeconfig-certificate-authority-data", example.CertificateAuthorities[0].Data)
		ctx.Export("identity-oidc-issuer", example.Identities[0].Oidcs[0].Issuer)
		return nil
	})
}
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.cloudhsmv2.inputs.GetClusterArgs;
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());

        ctx.export("endpoint", example.applyValue(getClusterResult -> getClusterResult.endpoint()));
        ctx.export("kubeconfig-certificate-authority-data", example.applyValue(getClusterResult -> getClusterResult.certificateAuthorities()[0].data()));
        ctx.export("identity-oidc-issuer", example.applyValue(getClusterResult -> getClusterResult.identities()[0].oidcs()[0].issuer()));
    }
}
import pulumi
import pulumi_aws as aws

example = aws.eks.get_cluster(name="example")
pulumi.export("endpoint", example.endpoint)
pulumi.export("kubeconfig-certificate-authority-data", example.certificate_authorities[0].data)
pulumi.export("identity-oidc-issuer", example.identities[0].oidcs[0].issuer)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

export = async () => {
    const example = await aws.eks.getCluster({
        name: "example",
    });
    const endpoint = example.endpoint;
    const kubeconfig_certificate_authority_data = example.certificateAuthorities?[0]?.data;
    const identity_oidc_issuer = example.identities?[0]?.oidcs?[0]?.issuer;
    return {
        endpoint: endpoint,
        "kubeconfig-certificate-authority-data": kubeconfig_certificate_authority_data,
        "identity-oidc-issuer": identity_oidc_issuer,
    };
}
variables:
  example:
    Fn::Invoke:
      Function: aws:eks:getCluster
      Arguments:
        name: example
outputs:
  endpoint: ${example.endpoint}
  kubeconfig-certificate-authority-data: ${example.certificateAuthorities[0].data}
  # Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019.
  identity-oidc-issuer: ${example.identities[0].oidcs[0].issuer}

Using getCluster

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 getCluster(args: GetClusterArgs, opts?: InvokeOptions): Promise<GetClusterResult>
function getClusterOutput(args: GetClusterOutputArgs, opts?: InvokeOptions): Output<GetClusterResult>
def get_cluster(name: Optional[str] = None,
                tags: Optional[Mapping[str, str]] = None,
                opts: Optional[InvokeOptions] = None) -> GetClusterResult
def get_cluster_output(name: Optional[pulumi.Input[str]] = None,
                tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetClusterResult]
func LookupCluster(ctx *Context, args *LookupClusterArgs, opts ...InvokeOption) (*LookupClusterResult, error)
func LookupClusterOutput(ctx *Context, args *LookupClusterOutputArgs, opts ...InvokeOption) LookupClusterResultOutput

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

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

The following arguments are supported:

Name string

The name of the 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\-_]+$).

Tags Dictionary<string, string>

Key-value map of resource tags.

Name string

The name of the 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\-_]+$).

Tags map[string]string

Key-value map of resource tags.

name String

The name of the 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\-_]+$).

tags Map<String,String>

Key-value map of resource tags.

name string

The name of the 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\-_]+$).

tags {[key: string]: string}

Key-value map of resource tags.

name str

The name of the 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\-_]+$).

tags Mapping[str, str]

Key-value map of resource tags.

name String

The name of the 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\-_]+$).

tags Map<String>

Key-value map of resource tags.

getCluster Result

The following output properties are available:

Arn string

The Amazon Resource Name (ARN) of the cluster.

CertificateAuthorities List<Pulumi.Aws.Eks.Outputs.GetClusterCertificateAuthority>

Nested attribute containing certificate-authority-data for your cluster.

CreatedAt string

The Unix epoch time stamp in seconds for when the cluster was created.

EnabledClusterLogTypes List<string>

The enabled control plane logs.

Endpoint string

The endpoint for your Kubernetes API server.

Id string

The provider-assigned unique ID for this managed resource.

Identities List<Pulumi.Aws.Eks.Outputs.GetClusterIdentity>

Nested attribute containing identity provider information for your cluster. Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. For an example using this information to enable IAM Roles for Service Accounts, see the aws.eks.Cluster resource documentation.

KubernetesNetworkConfigs List<Pulumi.Aws.Eks.Outputs.GetClusterKubernetesNetworkConfig>

Nested list containing Kubernetes Network Configuration.

Name string
PlatformVersion string

The platform version for the cluster.

RoleArn string

The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.

Status string

The status of the EKS cluster. One of CREATING, ACTIVE, DELETING, FAILED.

Tags Dictionary<string, string>

Key-value map of resource tags.

Version string

The Kubernetes server version for the cluster.

VpcConfig Pulumi.Aws.Eks.Outputs.GetClusterVpcConfig

Nested list containing VPC configuration for the cluster.

Arn string

The Amazon Resource Name (ARN) of the cluster.

CertificateAuthorities []GetClusterCertificateAuthority

Nested attribute containing certificate-authority-data for your cluster.

CreatedAt string

The Unix epoch time stamp in seconds for when the cluster was created.

EnabledClusterLogTypes []string

The enabled control plane logs.

Endpoint string

The endpoint for your Kubernetes API server.

Id string

The provider-assigned unique ID for this managed resource.

Identities []GetClusterIdentity

Nested attribute containing identity provider information for your cluster. Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. For an example using this information to enable IAM Roles for Service Accounts, see the aws.eks.Cluster resource documentation.

KubernetesNetworkConfigs []GetClusterKubernetesNetworkConfig

Nested list containing Kubernetes Network Configuration.

Name string
PlatformVersion string

The platform version for the cluster.

RoleArn string

The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.

Status string

The status of the EKS cluster. One of CREATING, ACTIVE, DELETING, FAILED.

Tags map[string]string

Key-value map of resource tags.

Version string

The Kubernetes server version for the cluster.

VpcConfig GetClusterVpcConfig

Nested list containing VPC configuration for the cluster.

arn String

The Amazon Resource Name (ARN) of the cluster.

certificateAuthorities List<GetClusterCertificateAuthority>

Nested attribute containing certificate-authority-data for your cluster.

createdAt String

The Unix epoch time stamp in seconds for when the cluster was created.

enabledClusterLogTypes List<String>

The enabled control plane logs.

endpoint String

The endpoint for your Kubernetes API server.

id String

The provider-assigned unique ID for this managed resource.

identities List<GetClusterIdentity>

Nested attribute containing identity provider information for your cluster. Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. For an example using this information to enable IAM Roles for Service Accounts, see the aws.eks.Cluster resource documentation.

kubernetesNetworkConfigs List<GetClusterKubernetesNetworkConfig>

Nested list containing Kubernetes Network Configuration.

name String
platformVersion String

The platform version for the cluster.

roleArn String

The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.

status String

The status of the EKS cluster. One of CREATING, ACTIVE, DELETING, FAILED.

tags Map<String,String>

Key-value map of resource tags.

version String

The Kubernetes server version for the cluster.

vpcConfig GetClusterVpcConfig

Nested list containing VPC configuration for the cluster.

arn string

The Amazon Resource Name (ARN) of the cluster.

certificateAuthorities GetClusterCertificateAuthority[]

Nested attribute containing certificate-authority-data for your cluster.

createdAt string

The Unix epoch time stamp in seconds for when the cluster was created.

enabledClusterLogTypes string[]

The enabled control plane logs.

endpoint string

The endpoint for your Kubernetes API server.

id string

The provider-assigned unique ID for this managed resource.

identities GetClusterIdentity[]

Nested attribute containing identity provider information for your cluster. Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. For an example using this information to enable IAM Roles for Service Accounts, see the aws.eks.Cluster resource documentation.

kubernetesNetworkConfigs GetClusterKubernetesNetworkConfig[]

Nested list containing Kubernetes Network Configuration.

name string
platformVersion string

The platform version for the cluster.

roleArn string

The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.

status string

The status of the EKS cluster. One of CREATING, ACTIVE, DELETING, FAILED.

tags {[key: string]: string}

Key-value map of resource tags.

version string

The Kubernetes server version for the cluster.

vpcConfig GetClusterVpcConfig

Nested list containing VPC configuration for the cluster.

arn str

The Amazon Resource Name (ARN) of the cluster.

certificate_authorities Sequence[GetClusterCertificateAuthority]

Nested attribute containing certificate-authority-data for your cluster.

created_at str

The Unix epoch time stamp in seconds for when the cluster was created.

enabled_cluster_log_types Sequence[str]

The enabled control plane logs.

endpoint str

The endpoint for your Kubernetes API server.

id str

The provider-assigned unique ID for this managed resource.

identities Sequence[GetClusterIdentity]

Nested attribute containing identity provider information for your cluster. Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. For an example using this information to enable IAM Roles for Service Accounts, see the aws.eks.Cluster resource documentation.

kubernetes_network_configs Sequence[GetClusterKubernetesNetworkConfig]

Nested list containing Kubernetes Network Configuration.

name str
platform_version str

The platform version for the cluster.

role_arn str

The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.

status str

The status of the EKS cluster. One of CREATING, ACTIVE, DELETING, FAILED.

tags Mapping[str, str]

Key-value map of resource tags.

version str

The Kubernetes server version for the cluster.

vpc_config GetClusterVpcConfig

Nested list containing VPC configuration for the cluster.

arn String

The Amazon Resource Name (ARN) of the cluster.

certificateAuthorities List<Property Map>

Nested attribute containing certificate-authority-data for your cluster.

createdAt String

The Unix epoch time stamp in seconds for when the cluster was created.

enabledClusterLogTypes List<String>

The enabled control plane logs.

endpoint String

The endpoint for your Kubernetes API server.

id String

The provider-assigned unique ID for this managed resource.

identities List<Property Map>

Nested attribute containing identity provider information for your cluster. Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. For an example using this information to enable IAM Roles for Service Accounts, see the aws.eks.Cluster resource documentation.

kubernetesNetworkConfigs List<Property Map>

Nested list containing Kubernetes Network Configuration.

name String
platformVersion String

The platform version for the cluster.

roleArn String

The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.

status String

The status of the EKS cluster. One of CREATING, ACTIVE, DELETING, FAILED.

tags Map<String>

Key-value map of resource tags.

version String

The Kubernetes server version for the cluster.

vpcConfig Property Map

Nested list containing VPC configuration for the cluster.

Supporting Types

GetClusterCertificateAuthority

Data string

The base64 encoded certificate data required to communicate with your cluster. Add this to the certificate-authority-data section of the kubeconfig file for your cluster.

Data string

The base64 encoded certificate data required to communicate with your cluster. Add this to the certificate-authority-data section of the kubeconfig file for your cluster.

data String

The base64 encoded certificate data required to communicate with your cluster. Add this to the certificate-authority-data section of the kubeconfig file for your cluster.

data string

The base64 encoded certificate data required to communicate with your cluster. Add this to the certificate-authority-data section of the kubeconfig file for your cluster.

data str

The base64 encoded certificate data required to communicate with your cluster. Add this to the certificate-authority-data section of the kubeconfig file for your cluster.

data String

The base64 encoded certificate data required to communicate with your cluster. Add this to the certificate-authority-data section of the kubeconfig file for your cluster.

GetClusterIdentity

Oidcs List<Pulumi.Aws.Eks.Inputs.GetClusterIdentityOidc>

Nested attribute containing OpenID Connect identity provider information for the cluster.

Oidcs []GetClusterIdentityOidc

Nested attribute containing OpenID Connect identity provider information for the cluster.

oidcs List<GetClusterIdentityOidc>

Nested attribute containing OpenID Connect identity provider information for the cluster.

oidcs GetClusterIdentityOidc[]

Nested attribute containing OpenID Connect identity provider information for the cluster.

oidcs Sequence[GetClusterIdentityOidc]

Nested attribute containing OpenID Connect identity provider information for the cluster.

oidcs List<Property Map>

Nested attribute containing OpenID Connect identity provider information for the cluster.

GetClusterIdentityOidc

Issuer string

Issuer URL for the OpenID Connect identity provider.

Issuer string

Issuer URL for the OpenID Connect identity provider.

issuer String

Issuer URL for the OpenID Connect identity provider.

issuer string

Issuer URL for the OpenID Connect identity provider.

issuer str

Issuer URL for the OpenID Connect identity provider.

issuer String

Issuer URL for the OpenID Connect identity provider.

GetClusterKubernetesNetworkConfig

IpFamily string
ServiceIpv4Cidr string

The CIDR block to assign Kubernetes service IP addresses from.

IpFamily string
ServiceIpv4Cidr string

The CIDR block to assign Kubernetes service IP addresses from.

ipFamily String
serviceIpv4Cidr String

The CIDR block to assign Kubernetes service IP addresses from.

ipFamily string
serviceIpv4Cidr string

The CIDR block to assign Kubernetes service IP addresses from.

ip_family str
service_ipv4_cidr str

The CIDR block to assign Kubernetes service IP addresses from.

ipFamily String
serviceIpv4Cidr String

The CIDR block to assign Kubernetes service IP addresses from.

GetClusterVpcConfig

ClusterSecurityGroupId string

The cluster security group that was created by Amazon EKS for the cluster.

EndpointPrivateAccess bool

Indicates whether or not the Amazon EKS private API server endpoint is enabled.

EndpointPublicAccess bool

Indicates whether or not the Amazon EKS public API server endpoint is enabled.

PublicAccessCidrs List<string>

List of CIDR blocks. Indicates which CIDR blocks can access the Amazon EKS public API server endpoint.

SecurityGroupIds List<string>

List of security group IDs

SubnetIds List<string>

List of subnet IDs

VpcId string

The VPC associated with your cluster.

ClusterSecurityGroupId string

The cluster security group that was created by Amazon EKS for the cluster.

EndpointPrivateAccess bool

Indicates whether or not the Amazon EKS private API server endpoint is enabled.

EndpointPublicAccess bool

Indicates whether or not the Amazon EKS public API server endpoint is enabled.

PublicAccessCidrs []string

List of CIDR blocks. Indicates which CIDR blocks can access the Amazon EKS public API server endpoint.

SecurityGroupIds []string

List of security group IDs

SubnetIds []string

List of subnet IDs

VpcId string

The VPC associated with your cluster.

clusterSecurityGroupId String

The cluster security group that was created by Amazon EKS for the cluster.

endpointPrivateAccess Boolean

Indicates whether or not the Amazon EKS private API server endpoint is enabled.

endpointPublicAccess Boolean

Indicates whether or not the Amazon EKS public API server endpoint is enabled.

publicAccessCidrs List<String>

List of CIDR blocks. Indicates which CIDR blocks can access the Amazon EKS public API server endpoint.

securityGroupIds List<String>

List of security group IDs

subnetIds List<String>

List of subnet IDs

vpcId String

The VPC associated with your cluster.

clusterSecurityGroupId string

The cluster security group that was created by Amazon EKS for the cluster.

endpointPrivateAccess boolean

Indicates whether or not the Amazon EKS private API server endpoint is enabled.

endpointPublicAccess boolean

Indicates whether or not the Amazon EKS public API server endpoint is enabled.

publicAccessCidrs string[]

List of CIDR blocks. Indicates which CIDR blocks can access the Amazon EKS public API server endpoint.

securityGroupIds string[]

List of security group IDs

subnetIds string[]

List of subnet IDs

vpcId string

The VPC associated with your cluster.

cluster_security_group_id str

The cluster security group that was created by Amazon EKS for the cluster.

endpoint_private_access bool

Indicates whether or not the Amazon EKS private API server endpoint is enabled.

endpoint_public_access bool

Indicates whether or not the Amazon EKS public API server endpoint is enabled.

public_access_cidrs Sequence[str]

List of CIDR blocks. Indicates which CIDR blocks can access the Amazon EKS public API server endpoint.

security_group_ids Sequence[str]

List of security group IDs

subnet_ids Sequence[str]

List of subnet IDs

vpc_id str

The VPC associated with your cluster.

clusterSecurityGroupId String

The cluster security group that was created by Amazon EKS for the cluster.

endpointPrivateAccess Boolean

Indicates whether or not the Amazon EKS private API server endpoint is enabled.

endpointPublicAccess Boolean

Indicates whether or not the Amazon EKS public API server endpoint is enabled.

publicAccessCidrs List<String>

List of CIDR blocks. Indicates which CIDR blocks can access the Amazon EKS public API server endpoint.

securityGroupIds List<String>

List of security group IDs

subnetIds List<String>

List of subnet IDs

vpcId String

The VPC associated with your cluster.

Package Details

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

This Pulumi package is based on the aws Terraform Provider.