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

green-musician-49057

10/05/2021, 12:28 AM
Has anyone done AWS ACM cert validation in Golang? There isn't an example in the docs, I'm scratching my head as to how to iterate over DomainValidationOptions: https://www.pulumi.com/docs/reference/pkg/aws/acm/certificatevalidation/
My understanding is that we should not create resources inside an
ApplyT()
, so it's not clear how one might create multiple route53 records from this array output object
Looks like the
.Index()
+
.Elem()
combo is the way to go here -- and then also to determine the number of validation options without relying on the output value
g

gentle-diamond-70147

10/05/2021, 1:30 AM
I have an example for you. It's definitely a little tricky given the types in Go. Let me find it...
g

green-musician-49057

10/05/2021, 1:38 AM
but I'm certainly open to learning a better way 🙂
g

gentle-diamond-70147

10/05/2021, 1:57 AM
Yep, that looks close to mine. Sorry, it took a while to dig it up.
Note: there are two ways to do it in that example - one if the number of records is known beforehand, and a second if that is not true.
g

green-musician-49057

10/05/2021, 3:34 PM
Thank you! That's a great gist 🙂
Are the docs strictly auto-generated, or could I open a PR to add a Golang example for the cert validation?
g

gentle-diamond-70147

10/05/2021, 4:06 PM
A PR at https://github.com/pulumi/examples would be more than welcome!
The examples in-line in the docs are all auto-generated I believe.
5 Views