[aws-s3] Bucket.fromBucketArn does not behave as expected #10638
Labels
@aws-cdk/aws-s3
Related to Amazon S3
guidance
Question that needs advice or information.
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
❓ General Issue
The Question
I am working on a construct, I want to allow a bucket ARN to be used if they prefer. I thought simple enough, we have this:
The issue I am experiencing is that I want to add a policy to the bucket.
When I create the bucket, this works as expected. When I am using an ARN, I have an empty template.
This leads me to believe that:
a.
Bucket.fromBucketArn
cannot be used like a bucket, then what's the point of it?b. This is a bug
Before I attempt to go the policy route and attach to a bucket (if even possible), e.g.:
I wanted to see if this is expected behavior. I for one, find this to be very limiting as this severely limits what I can do with existing resources.
Is it not possible to attach bucket policies this way? If not, is there a concern for policies being removed this way? Just trying to understand why this doesn't work and what the correct approach would be.
My only other option would be to remove support for bucketArn but this has me worried about other constructs I plan to write as this is something I can see being necessary.
Environment
The text was updated successfully, but these errors were encountered: