Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform resource aws_s3_bucket_policy generated incorrect output #320

Open
rorourke-iot opened this issue May 17, 2023 · 1 comment
Open

Comments

@rorourke-iot
Copy link

rorourke-iot commented May 17, 2023

The resources for an S3 bucket were generated as

resource "aws_s3_bucket" "S3Bucket" {
    bucket = "my-bucket-XXX"
}

resource "aws_s3_bucket_policy" "S3BucketPolicy" {
    bucket = "my-bucket-XXX"
    policy = "{\"Version\":\"2008-10-17\",\"Statement\":[{\"Effect\":\"Deny\",\"Principal\":\"*\",\"Action\":\"s3:GetObject\",\"Resource\":\"arn:aws:s3:::my-bucket-XXX/*\",\"Condition\":{\"Bool\":{\"aws:SecureTransport\":\"false\"}}}]}"
}

According to the docs, aws_s3_bucket_policy.bucket should be the id of the bucket. Use aws_s3_bucket.S3Bucket.id instead.

iann0036 added a commit that referenced this issue May 19, 2023
@iann0036
Copy link
Owner

Hi @rorourke-iot,

Thanks for raising! As per the other issues comment, I've added the mapping for this specific instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants