hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.84k stars 9.19k forks source link

[Bug]: aws_s3_object fails without access to GetObjectTagging #27867

Open dsypniewski opened 2 years ago

dsypniewski commented 2 years ago

Terraform Core Version

1.3.3

AWS Provider Version

4.39.0

Affected Resource(s)

data aws_s3_object

Expected Behavior

When trying to get an object (not under my control) with only GetObject permission available the call should succeed while ignoring not being able to read tags. One solution I can think of would be to add an additional option to the data source that would skip retrieving tags in such cases.

Actual Behavior

The call fails because of missing permissions.

Relevant Error/Panic Output Snippet

Error: error listing tags for S3 Bucket (redacted) Object (redacted): AccessDenied: Access Denied

Terraform Configuration Files

data "aws_s3_object" "test" {
  bucket = "bucket"
  key    = "key"
}

Steps to Reproduce

Read any object without permission to list that objects' tags

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No response

github-actions[bot] commented 2 years ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 4 days ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!