Skip to content

fix: added support for generating S3 permissions using Bucket references #648

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danrivett
Copy link
Contributor

Resolves #647

Note: I'll add unit tests if the proposed solution in this PR is correct. This solution works for me, but I wasn't sure if there was a better way to fix this issue.

`arn:aws:s3:::${bucket}/*`,
],
resource: resolveS3BucketReferences(bucket, [
`arn:aws:s3:::\${bucket}`,
Copy link
Contributor Author

@danrivett danrivett Apr 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to keep the strings as template literals and just escape the ${bucket} so it wasn't interpolated here, but in the resolveS3BucketReferences() function.

This is because other affected strings below uses other variables such as ${prefix} and ${key} and so they needed to remain template literals to have those interpolated correctly.

So I decided for consistency I would keep them all as template literals and uniformly escape the ${bucket} references.

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

Successfully merging this pull request may close these issues.

Incorrect IAM Permissions generated when S3 Bucket Reference used
1 participant