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

Intermittent failures with aws_s3_bucket_policy [Bug]: #33678

Closed
miguelhar opened this issue Sep 28, 2023 · 4 comments
Closed

Intermittent failures with aws_s3_bucket_policy [Bug]: #33678

miguelhar opened this issue Sep 28, 2023 · 4 comments
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service.

Comments

@miguelhar
Copy link

miguelhar commented Sep 28, 2023

Terraform Core Version

1.4.6

AWS Provider Version

5.18.1

Affected Resource(s)

5.17, 5.18

Expected Behavior

Should not fail

Actual Behavior

Fails to attach policy to bucket

Relevant Error/Panic Output Snippet

Error: reading S3 Bucket (****) Policy: couldn't find resource
2023-09-28 22:06:11,172 - 
2023-09-28 22:06:11,172 -   with aws_s3_bucket_policy.buckets_policies["*****"],
### Terraform Configuration Files

locals {
 s3_buckets = {
    fancy = {
      bucket_name = aws_s3_bucket.fancy.bucket
      id          = aws_s3_bucket.fancy.id
      policy_json = data.aws_iam_policy_document.fancy.json
      arn         = aws_s3_bucket.fancy.arn
    }
    shiny = {
      bucket_name = aws_s3_bucket.shiny.bucket
      id          = aws_s3_bucket.shiny.id
      policy_json = data.aws_iam_policy_document.shiny.json
      arn         = aws_s3_bucket.shiny.arn
    }
   
  }
}

resource "aws_s3_bucket_policy" "buckets_policies" {
  for_each = local.s3_buckets
  bucket   = each.value.id
  policy   = each.value.policy_json
}

Steps to Reproduce

Its intermittent.

Debug Output

No response

Panic Output

No response

Important Factoids

We started noticing after update to 5.18.1, from 5.16.

References

No response

Would you like to implement a fix?

None

@miguelhar miguelhar added the bug Addresses a defect in current functionality. label Sep 28, 2023
@github-actions github-actions bot added the service/s3 Issues and PRs that pertain to the s3 service. label Sep 28, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Sep 28, 2023
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Sep 29, 2023
@ewbankkit
Copy link
Contributor

@miguelhar Thanks for raising this issue.
It has already been noticed in #33569. I'm going to close this one as a duplicate so that we can concentrate discussion in the linked issue.
Please add any additional comments there.

@ewbankkit
Copy link
Contributor

Addressed in v5.19.0 via #33537.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
Development

No branches or pull requests

2 participants