```/* * s3 public access block */ const bu...
# general
b
Copy code
/*
   *   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,
  });
}