github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/eks/getCluster.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package eks 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Retrieve information about an EKS Cluster. 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/eks" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // example, err := eks.LookupCluster(ctx, &eks.LookupClusterArgs{ 32 // Name: "example", 33 // }, nil) 34 // if err != nil { 35 // return err 36 // } 37 // ctx.Export("endpoint", example.Endpoint) 38 // ctx.Export("kubeconfig-certificate-authority-data", example.CertificateAuthorities[0].Data) 39 // ctx.Export("identity-oidc-issuer", example.Identities[0].Oidcs[0].Issuer) 40 // return nil 41 // }) 42 // } 43 // 44 // ``` 45 // <!--End PulumiCodeChooser --> 46 func LookupCluster(ctx *pulumi.Context, args *LookupClusterArgs, opts ...pulumi.InvokeOption) (*LookupClusterResult, error) { 47 opts = internal.PkgInvokeDefaultOpts(opts) 48 var rv LookupClusterResult 49 err := ctx.Invoke("aws:eks/getCluster:getCluster", args, &rv, opts...) 50 if err != nil { 51 return nil, err 52 } 53 return &rv, nil 54 } 55 56 // A collection of arguments for invoking getCluster. 57 type LookupClusterArgs struct { 58 // Name of the cluster. 59 Name string `pulumi:"name"` 60 // Key-value map of resource tags. 61 Tags map[string]string `pulumi:"tags"` 62 } 63 64 // A collection of values returned by getCluster. 65 type LookupClusterResult struct { 66 // Configuration block for access config. 67 AccessConfigs []GetClusterAccessConfig `pulumi:"accessConfigs"` 68 // ARN of the cluster. 69 Arn string `pulumi:"arn"` 70 // Nested attribute containing `certificate-authority-data` for your cluster. 71 CertificateAuthorities []GetClusterCertificateAuthority `pulumi:"certificateAuthorities"` 72 // The ID of your local Amazon EKS cluster on the AWS Outpost. This attribute isn't available for an AWS EKS cluster on AWS cloud. 73 ClusterId string `pulumi:"clusterId"` 74 // Unix epoch time stamp in seconds for when the cluster was created. 75 CreatedAt string `pulumi:"createdAt"` 76 // The enabled control plane logs. 77 EnabledClusterLogTypes []string `pulumi:"enabledClusterLogTypes"` 78 // Endpoint for your Kubernetes API server. 79 Endpoint string `pulumi:"endpoint"` 80 // The provider-assigned unique ID for this managed resource. 81 Id string `pulumi:"id"` 82 // 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 `eks.Cluster` resource documentation. 83 Identities []GetClusterIdentity `pulumi:"identities"` 84 // Nested list containing Kubernetes Network Configuration. 85 KubernetesNetworkConfigs []GetClusterKubernetesNetworkConfig `pulumi:"kubernetesNetworkConfigs"` 86 Name string `pulumi:"name"` 87 // Contains Outpost Configuration. 88 OutpostConfigs []GetClusterOutpostConfig `pulumi:"outpostConfigs"` 89 // Platform version for the cluster. 90 PlatformVersion string `pulumi:"platformVersion"` 91 // ARN of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. 92 RoleArn string `pulumi:"roleArn"` 93 // Status of the EKS cluster. One of `CREATING`, `ACTIVE`, `DELETING`, `FAILED`. 94 Status string `pulumi:"status"` 95 // Key-value map of resource tags. 96 Tags map[string]string `pulumi:"tags"` 97 // Kubernetes server version for the cluster. 98 Version string `pulumi:"version"` 99 // Nested list containing VPC configuration for the cluster. 100 VpcConfig GetClusterVpcConfig `pulumi:"vpcConfig"` 101 } 102 103 func LookupClusterOutput(ctx *pulumi.Context, args LookupClusterOutputArgs, opts ...pulumi.InvokeOption) LookupClusterResultOutput { 104 return pulumi.ToOutputWithContext(context.Background(), args). 105 ApplyT(func(v interface{}) (LookupClusterResult, error) { 106 args := v.(LookupClusterArgs) 107 r, err := LookupCluster(ctx, &args, opts...) 108 var s LookupClusterResult 109 if r != nil { 110 s = *r 111 } 112 return s, err 113 }).(LookupClusterResultOutput) 114 } 115 116 // A collection of arguments for invoking getCluster. 117 type LookupClusterOutputArgs struct { 118 // Name of the cluster. 119 Name pulumi.StringInput `pulumi:"name"` 120 // Key-value map of resource tags. 121 Tags pulumi.StringMapInput `pulumi:"tags"` 122 } 123 124 func (LookupClusterOutputArgs) ElementType() reflect.Type { 125 return reflect.TypeOf((*LookupClusterArgs)(nil)).Elem() 126 } 127 128 // A collection of values returned by getCluster. 129 type LookupClusterResultOutput struct{ *pulumi.OutputState } 130 131 func (LookupClusterResultOutput) ElementType() reflect.Type { 132 return reflect.TypeOf((*LookupClusterResult)(nil)).Elem() 133 } 134 135 func (o LookupClusterResultOutput) ToLookupClusterResultOutput() LookupClusterResultOutput { 136 return o 137 } 138 139 func (o LookupClusterResultOutput) ToLookupClusterResultOutputWithContext(ctx context.Context) LookupClusterResultOutput { 140 return o 141 } 142 143 // Configuration block for access config. 144 func (o LookupClusterResultOutput) AccessConfigs() GetClusterAccessConfigArrayOutput { 145 return o.ApplyT(func(v LookupClusterResult) []GetClusterAccessConfig { return v.AccessConfigs }).(GetClusterAccessConfigArrayOutput) 146 } 147 148 // ARN of the cluster. 149 func (o LookupClusterResultOutput) Arn() pulumi.StringOutput { 150 return o.ApplyT(func(v LookupClusterResult) string { return v.Arn }).(pulumi.StringOutput) 151 } 152 153 // Nested attribute containing `certificate-authority-data` for your cluster. 154 func (o LookupClusterResultOutput) CertificateAuthorities() GetClusterCertificateAuthorityArrayOutput { 155 return o.ApplyT(func(v LookupClusterResult) []GetClusterCertificateAuthority { return v.CertificateAuthorities }).(GetClusterCertificateAuthorityArrayOutput) 156 } 157 158 // The ID of your local Amazon EKS cluster on the AWS Outpost. This attribute isn't available for an AWS EKS cluster on AWS cloud. 159 func (o LookupClusterResultOutput) ClusterId() pulumi.StringOutput { 160 return o.ApplyT(func(v LookupClusterResult) string { return v.ClusterId }).(pulumi.StringOutput) 161 } 162 163 // Unix epoch time stamp in seconds for when the cluster was created. 164 func (o LookupClusterResultOutput) CreatedAt() pulumi.StringOutput { 165 return o.ApplyT(func(v LookupClusterResult) string { return v.CreatedAt }).(pulumi.StringOutput) 166 } 167 168 // The enabled control plane logs. 169 func (o LookupClusterResultOutput) EnabledClusterLogTypes() pulumi.StringArrayOutput { 170 return o.ApplyT(func(v LookupClusterResult) []string { return v.EnabledClusterLogTypes }).(pulumi.StringArrayOutput) 171 } 172 173 // Endpoint for your Kubernetes API server. 174 func (o LookupClusterResultOutput) Endpoint() pulumi.StringOutput { 175 return o.ApplyT(func(v LookupClusterResult) string { return v.Endpoint }).(pulumi.StringOutput) 176 } 177 178 // The provider-assigned unique ID for this managed resource. 179 func (o LookupClusterResultOutput) Id() pulumi.StringOutput { 180 return o.ApplyT(func(v LookupClusterResult) string { return v.Id }).(pulumi.StringOutput) 181 } 182 183 // 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 `eks.Cluster` resource documentation. 184 func (o LookupClusterResultOutput) Identities() GetClusterIdentityArrayOutput { 185 return o.ApplyT(func(v LookupClusterResult) []GetClusterIdentity { return v.Identities }).(GetClusterIdentityArrayOutput) 186 } 187 188 // Nested list containing Kubernetes Network Configuration. 189 func (o LookupClusterResultOutput) KubernetesNetworkConfigs() GetClusterKubernetesNetworkConfigArrayOutput { 190 return o.ApplyT(func(v LookupClusterResult) []GetClusterKubernetesNetworkConfig { return v.KubernetesNetworkConfigs }).(GetClusterKubernetesNetworkConfigArrayOutput) 191 } 192 193 func (o LookupClusterResultOutput) Name() pulumi.StringOutput { 194 return o.ApplyT(func(v LookupClusterResult) string { return v.Name }).(pulumi.StringOutput) 195 } 196 197 // Contains Outpost Configuration. 198 func (o LookupClusterResultOutput) OutpostConfigs() GetClusterOutpostConfigArrayOutput { 199 return o.ApplyT(func(v LookupClusterResult) []GetClusterOutpostConfig { return v.OutpostConfigs }).(GetClusterOutpostConfigArrayOutput) 200 } 201 202 // Platform version for the cluster. 203 func (o LookupClusterResultOutput) PlatformVersion() pulumi.StringOutput { 204 return o.ApplyT(func(v LookupClusterResult) string { return v.PlatformVersion }).(pulumi.StringOutput) 205 } 206 207 // ARN of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. 208 func (o LookupClusterResultOutput) RoleArn() pulumi.StringOutput { 209 return o.ApplyT(func(v LookupClusterResult) string { return v.RoleArn }).(pulumi.StringOutput) 210 } 211 212 // Status of the EKS cluster. One of `CREATING`, `ACTIVE`, `DELETING`, `FAILED`. 213 func (o LookupClusterResultOutput) Status() pulumi.StringOutput { 214 return o.ApplyT(func(v LookupClusterResult) string { return v.Status }).(pulumi.StringOutput) 215 } 216 217 // Key-value map of resource tags. 218 func (o LookupClusterResultOutput) Tags() pulumi.StringMapOutput { 219 return o.ApplyT(func(v LookupClusterResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 220 } 221 222 // Kubernetes server version for the cluster. 223 func (o LookupClusterResultOutput) Version() pulumi.StringOutput { 224 return o.ApplyT(func(v LookupClusterResult) string { return v.Version }).(pulumi.StringOutput) 225 } 226 227 // Nested list containing VPC configuration for the cluster. 228 func (o LookupClusterResultOutput) VpcConfig() GetClusterVpcConfigOutput { 229 return o.ApplyT(func(v LookupClusterResult) GetClusterVpcConfig { return v.VpcConfig }).(GetClusterVpcConfigOutput) 230 } 231 232 func init() { 233 pulumi.RegisterOutputType(LookupClusterResultOutput{}) 234 }