Create a main.tf file as shown.
Run terraform init
Before running terraform apply
command, create and modify your IAM policy
Create policy as shown (zoom and check the path, if required)
Goto IAM --> Select the user associated --> Click Add permissions, select Create inline policy for the created policy.
Click on JSON
modify as shown --> click Next (ignore the warnings, if occurred)
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "*",
"Resource": "*"
}
]
}
Run terraform apply
Goto AWS console --> type S3.
Click On Buckets, and search for your new bucket.
we can see the access is public now.
Thank you so much for reading
Follow me on LinkedIn to see interesting posts like this : )
Β