quiet-restaurant-29133
11/26/2020, 5:04 AMpulumi.StringOutout
to a string
?, the applyString
is just a transformer. I have templates that need outputs from a pulumi resource
output that takes in a string
onlyclever-byte-21551
11/26/2020, 6:40 AMpulumi.Sprintf
?quiet-restaurant-29133
11/26/2020, 6:41 AMpulumi.StringOutput
important-appointment-55126
11/27/2020, 4:54 PMApplyT
to wait for them to resolve and then renders a Go template from that… i’ll clean it up a bit and push it to Github// Grant Cloudfront access to the content bucket
_, err = s3.NewBucketPolicy(ctx, "staticSitePolicy-"+host, &s3.BucketPolicyArgs{
Bucket: bucket.Bucket.Bucket,
Policy: pulutil.JSONTemplate(map[string]interface{}{
"BucketARN": bucket.BucketArn,
"IdentityARN": identity.IamArn,
}, `{
"Version": "2012-10-17",
"Id": "PolicyForCloudFrontPrivateContent",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "{{ .IdentityARN }}"
},
"Action": "s3:GetObject",
"Resource": "{{ .BucketARN }}/*"
}
]
}`),
})
JSONTemplate
just does an additional check at the end to make sure the output is valid JSON before handing it off to Pulumi; get more useful error messages that wayquiet-restaurant-29133
11/27/2020, 5:25 PMApplyT
important-appointment-55126
11/29/2020, 4:21 PM