freezing-sugar-24066
12/06/2021, 11:45 PMacm.getCertificate()z
for the only purpose of using the arn
to create a CloudFront distribution with an cloudfront.DistributionViewerCertificate
object, but would like the class creating the cloudfront distribution to accept either just a static string arn: string
or an arn: Output<string>
, what’s the cleanest way to go about that? (I believe one can pass in strings to Output<string> but am only 92% sure).
I think I’ve got it right that I can do this so that Pulumi understands the dependency graph:
const gcResult = await acm.getCertificateOutput({ domain })
new aws.cloudfront.Distribution('api-cloudfront', {
...
viewerCertificate: gdResult.apply(r => ({
acmCertificateArn: r.arn
})),
...
})
But how do I wrap the new()
in a class that accepts Input<string>
instead of Input<acm.GetCertificateResult>
, since I don’t need to depend on the whole object and don’t want to write a class that requires passing in an object with all the properties of acm.GetCertificateResult
?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.
Powered by