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

S3 ARNs are too bucket centric #185

Closed
michael-k opened this issue Jun 15, 2021 · 1 comment · Fixed by #186
Closed

S3 ARNs are too bucket centric #185

michael-k opened this issue Jun 15, 2021 · 1 comment · Fixed by #186

Comments

@michael-k
Copy link
Contributor

awacs.s3.ARN sets account to the empty string.

awacs/awacs/s3.py

Lines 18 to 21 in aba4018

class ARN(BaseARN):
def __init__(self, resource: str = "", region: str = "", account: str = "") -> None:
# account is empty for S3
super().__init__(service=prefix, resource=resource, region=region, account="")

@michael-k
Copy link
Contributor Author

It could also set the region to the empty string.

Oh, I see that's done in BaseARN and is also not correct for access points, jobs, and storage lens configurations. I just tried to deploy an access point (with BaseARN to mitigate the missing account) and it always failed with Policy has invalid resource. Somehow I didn't notice the missing region and only figured it out after switching from BaseARN to a plain string¹.

¹ Sub("arn:${AWS::Partition}:s3:${AWS::Region}:${AWS::AccountId}:accesspoint/<access_point_name>/object/*")

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

Successfully merging a pull request may close this issue.

1 participant