It shouldn't be painful. The records parameter of an
aws.route53.Record
is of type
pulumi.Input<pulumi.Input<string>[]>
, so you can put the Output<string> directly into the array.
l
lemon-machine-35564
02/04/2021, 10:18 PM
The problem is that Crosswalk exports
url
for API Gateway which includes the protocol and path, etc. A DNS record will just want the hostname, so I need to do string operations to get that out of there.
l
little-cartoon-10569
02/04/2021, 10:32 PM
You can use something like this:
Copy code
new aws.route53.Route(name, {
records: [ url.apply((url) => getFqdnFromUri(url)) ]
}
You'll need to write the function yourself.
I'm slightly surprised that Route53 doesn't have better integration with apigateway. The alb package targets lambdas, instances etc. very nicely. Maybe they expect ALBs to sit between route53 and apigateways...
l
lemon-machine-35564
02/04/2021, 10:42 PM
Gotcha yeah, a colleague was able to write a couple of functions to make it work.
It only seems to tightly integrate if you go the Edge Optimized API Gateway route which includes a CloudFront distro, and CloudFront distros DO export the hostname directly for use.
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.