https://pulumi.com logo
Title
c

crooked-lunch-29479

04/25/2023, 6:20 PM
https://www.pulumi.com/registry/packages/aws/api-docs/eks/getcluster/
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
	})
}
c

crooked-lunch-29479

04/25/2023, 6:54 PM
@billowy-army-68599 okay let me try that out. Also looks like the following field is no longer available:
CreateOidcProvider: pulumi.Bool(true),
If this would work then I wouldn’t even need the issuer url
b

billowy-army-68599

04/25/2023, 6:54 PM
you still need it? are you saying it’s not available on the EKS package?
c

crooked-lunch-29479

04/25/2023, 6:55 PM
Yeah its giving me an compiler error
Its not a valid Cluster Arg
b

billowy-army-68599

04/25/2023, 6:56 PM
can you share your code?
c

crooked-lunch-29479

04/25/2023, 6:59 PM
Yeah hold on pushing
Theres a bunch going on there but it seems like I’m using a different package ?
b

billowy-army-68599

04/25/2023, 7:02 PM
you are using the AWS resource for EKS, not the EKS component package. if you want to use the EKS package from AWS, you’te going to have to do a lot of building for OIDC
"<http://github.com/pulumi/pulumi-aws/sdk/v5/go/aws/eks|github.com/pulumi/pulumi-aws/sdk/v5/go/aws/eks>"
Is the EKS package from AWS
"<http://github.com/pulumi/pulumi-eks/sdk/go/eks|github.com/pulumi/pulumi-eks/sdk/go/eks>"
Which abstracts away a lot of the pain of building an EKS cluster, including adding nodes and creating the OIDC provider
c

crooked-lunch-29479

04/25/2023, 7:03 PM
So I should be able to still use the EKS package for my AWS deployment ?
b

billowy-army-68599

04/25/2023, 7:04 PM
if you want an easy deployment yes
c

crooked-lunch-29479

04/25/2023, 7:05 PM
Alright then I’m gonna play around this a little more then 😄 Would I need to do anything extra to make it work on AWS. I just assumed the EKS package was primarily for local kubernates deployments and not for AWS.
b

billowy-army-68599

04/25/2023, 7:06 PM
you’d need to do quite a bit, here’s an old example: https://github.com/jaxxstorm/iac-in-go/blob/master/eks/main.go
c

crooked-lunch-29479

04/25/2023, 7:09 PM
This example uses AWS/go/eks package. and not the EKS package. I followed your example (more or less) to setup the EKS in my code.
b

billowy-army-68599

04/25/2023, 7:18 PM
sorry i’m not following
c

crooked-lunch-29479

04/25/2023, 7:18 PM
I’m testing out your code
I’ll need a little time to test it 😄
b

billowy-army-68599

04/25/2023, 7:19 PM
which one?
c

crooked-lunch-29479

04/25/2023, 7:19 PM
The old example you’ve sent, it seems like this version of the code allows me to automatically create an OIDC