User is not authorized to perform: s3:PutBucketPolicy on resource: “arn:aws:s3:::marc12345” because public policies are blocked by the BlockPublicPolicy block public access setting.
The terraform resource either need to be run in order or depends_on meta arg needs to be supplied to the resources to set the order
Create a Static S3 Website Using Terraform
Learn how to create and configure a static S3 website using only Terraform. This lab does not grant access to the AWS console, encouraging both least privilege and using Infrastructure as Code (IaC) to manage cloud infrastructure instead of ClickOps.
Launch this lab with a free account
Build practical, real-world skills in a cloud environment.
- Real cloud environments, not simulations
- One click to deploy, nothing to install
- We cover the cloud costs and risks so you can focus on learning
7 comments
Hello, I had this issue too, but it is a quick fix:
Paste the code in Step 3 before the code in Step 2.
> Step 3’s code takes care of the Block_Public_Policy by setting it to false.
>And then Step 2’s code runs smoothly as it now has public access.
That was pretty cool. I deployed it successfully 100!
Thanks man!Instructor
Nice work! Isn’t it so satisfying when it works? Lol
Really interesting stuff! I have gone through all the free foundational labs (this one the last one) before diving it the red and blue team paths, and they all have been amazing.
Instructor
Glad to hear you’ve been enjoying the labs! Wait til you try some of the premium ones, they’re awesome ;)!
Insightful
Comments are currently read-only while we migrate to our new platform. In the meantime, ask questions in Discord.