https://pulumi.com logo
#general
Title
# general
c

cuddly-tailor-40542

09/23/2021, 1:16 AM
Hi folks! I'm using the EKS package and I'm trying to get the URL of the OIDC. I tried using the following code snippet but I ran into an issu.
Copy code
oidcProvider := cluster.Core.OidcProvider().ApplyT(func(oidcUrl string) string {
	return strings.Trim(oidcUrl, "https://")
})
The error is in the image below. Has anyone used this EKS package and did they find a workaround for this?
b

billowy-army-68599

09/23/2021, 1:19 AM
give this a try:
Copy code
oidcarn := cluster.Core.OidcProvider().ApplyT(func(oidcprovider *iam.OpenIdConnectProvider) pulumi.StringOutput {
	if oidcprovider == nil {
		return pulumi.String("").ToStringOutput()
	}
	return oidcprovider.Arn
}).ApplyT(func(v interface{}) string {
	return v.(string)
})
replace the
.Arn
with
.Url
if needed
c

cuddly-tailor-40542

09/23/2021, 1:50 AM
Omg! Thank you for this! Works like a charm
b

billowy-army-68599

09/23/2021, 1:57 AM
@white-balloon-205 helped me with the exact same thing eaelier today 🙂
c

cuddly-tailor-40542

09/23/2021, 11:08 AM
Oh well! I hope I'll be able to help someone too!
3 Views