breezy-laptop-42679
08/04/2022, 2:05 PM[6:11 PM] /*
* s3 public access block
*/
const bucketNameList = ["prod-nueve-media-9184fce"]
const bucketIdList: pulumi.Output<string>[] = []
bucketNameList.forEach(bucketName => {
// Create an AWS resource (S3 Bucket)
const bucket = new aws.s3.Bucket(bucketName, {});
bucketIdList.push(bucket.id)
});
for (let index = 0; index < bucketIdList.length; index++) {
new aws.s3.BucketPublicAccessBlock(`${bucketNameList[index]}-publicAccessBlock`, {
bucket: bucketIdList[index],
blockPublicAcls: true,
blockPublicPolicy: true,
});
}
little-cartoon-10569
08/04/2022, 8:40 PMpulumi import
or add the import
opt, and you almost certainly wouldn't do it in a loop.breezy-laptop-42679
08/05/2022, 11:27 AMlittle-cartoon-10569
08/06/2022, 10:58 PMrestrictPublicBuckets
and ignorePublicAcls
properties, too.