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

cuddly-tailor-40542

10/30/2021, 12:28 AM
Hi everyone! Is it possible to convert variable of type pulumi.StringOutput to string... I think it's with ApplyT but I'm running into errors trying to manipulate that.
b

bored-table-20691

10/30/2021, 1:39 AM
Can you give an example that you are getting errors with? ApplyT is indeed the right way
c

cuddly-tailor-40542

11/01/2021, 2:47 PM
Copy code
ingressURL := ingress.Status.ApplyT(
		func(status interface{}) string {
			return *status.(*networkingv1.IngressStatus).LoadBalancer.Ingress[0].Hostname
		}).(pulumi.StringOutput)
However @bored-table-20691, I'm not sure how to get the Hostname as just a string...
b

bored-table-20691

11/01/2021, 4:32 PM
You can’t - it is not known deterministically, so you can only access it inside the ApplyT (and then use it elsewhere as an Output).
What are you trying to do?
c

cuddly-tailor-40542

11/03/2021, 12:56 AM
I found out how to solve that. Route53 zone IDs never change so I defined those in pulumi config file
3 Views