sticky-bear-14421
06/20/2023, 9:54 AMnew aws.s3.BucketPolicy("pulumi-infrastructure-bucket-policy", {
bucket: bucket.bucket,
policy:
`
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Statement1",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::infrastructure.pulumi.dev",
"arn:aws:s3:::infrastructure.pulumi.dev/*"
],
"Condition": {
"Bool": {
"aws:SecureTransport": "false"
}
}
}
]
}`,
});
I would like to make those two Resource definitions dynamic, but when I switch to the ${bucket.arn}
notation I get an error that my string literal contains a \n
somehow. Even though I am inside a backticks backed string.echoing-dinner-19531
06/20/2023, 10:06 AMarn
is an output, you can't use that with backtick formatting. Look at the docs at https://www.pulumi.com/docs/concepts/inputs-outputs/#outputs-and-strings and for JSON policies like this https://www.pulumi.com/docs/concepts/inputs-outputs/#outputs-and-jsonsticky-bear-14421
06/21/2023, 7:30 AMconst main = async () => {} …
construct and made the wrong assumption that a const bucket = await new aws.s3.bucket()
would resolve the Promise/Output.echoing-dinner-19531
06/21/2023, 7:39 AMsticky-bear-14421
06/21/2023, 12:34 PM