I created an s3 bucket in terraform. However after creating this bucket, I am getting the error: error getting S3 Bucket Object Lock configuration: AccessDenied: Access Denied
I am using AWS academy so I do not have many permissions, however, there is a role in AWS academy that allows the user to do stuff with s3. Is there a way to attach this IAM role to the S3 bucket so access it via Terraform?
I would like to upload images to this bucket, however I can no longer deploy code due to Terraform trying to access the Object Lock Configuration which it does not have access to. Is there a way to tell terraform to not try to not try to get this information?
Here is my code
resource "aws_s3_bucket" "b" {
bucket = "my-tf-test-bucket"
acl = "private"
tags = {
Name = "My bucket"
Environment = "Dev"
}
}