getlift / lift

Expanding Serverless Framework beyond functions using the AWS CDK
MIT License
912 stars 109 forks source link

Add the extension AWS::S3::BucketPolicy #354

Open speed0ne opened 11 months ago

speed0ne commented 11 months ago

I want to add this extension AWS::S3::BucketPolicy so we can override the pre-created BucketPolicy. This make an issue in my case that forced me to not use the storage construct and create a bucket from scratch.

nadar commented 11 months ago

Maybe we have the same problem, i am not deep into the lift and serverless, but if we deploy an application which uses lift constructs we get:

CREATE_FAILED: websiteAssetsPolicyFDAAA9C0 (AWS::S3::BucketPolicy)
Resource handler returned message: "Bucket Policy Already Exists" (RequestToken: 1fea716b-3cf5-0165-7c69-aa25a60bfe5c, HandlerErrorCode: AlreadyExists)

Is that the same error @speed0ne ?

speed0ne commented 11 months ago

Yes! I did not receive the error, but my AWS::S3::BucketPolicy it is overwrites by the lift construct storage. I checked in S3 console and I saw only the lift BucketPolicy.

Another solution in my opinion is merge the policy.

On 18 Aug 2023, at 12:28, nadar @.***> wrote:

Maybe we have the same problem, i am not deep into the lift and serverless, but if we deploy an application which uses lift constructs we get:

CREATE_FAILED: websiteAssetsPolicyFDAAA9C0 (AWS::S3::BucketPolicy) Resource handler returned message: "Bucket Policy Already Exists" (RequestToken: 1fea716b-3cf5-0165-7c69-aa25a60bfe5c, HandlerErrorCode: AlreadyExists) Is that the same error @speed0ne https://github.com/speed0ne ?

— Reply to this email directly, view it on GitHub https://github.com/getlift/lift/issues/354#issuecomment-1683705680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUZRTK4LSB3LSZVEJOYHG6LXV47VPANCNFSM6AAAAAA3T7OGB4. You are receiving this because you were mentioned.

nadar commented 11 months ago

So you could somehow handle the error? Could you please give me a hint how to debug and fix that issue? would be great

speed0ne commented 11 months ago

I didn’t use lift for storage. I write under the Resources section the Cloudformation code the bucket and the policy

On 18 Aug 2023, at 12:59, nadar @.***> wrote:

So you could somehow handle the error? Could you please give me a hint how to debug and fix that issue? would be great

— Reply to this email directly, view it on GitHub https://github.com/getlift/lift/issues/354#issuecomment-1683744841, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUZRTKYBYDZY5OPWET6MPJDXV5DJTANCNFSM6AAAAAA3T7OGB4. You are receiving this because you were mentioned.