Closed electronicalias closed 3 months ago
Hi @electronicalias , thank you for submitting this. We are making changes that are aligned with security best practices which will help all customers. Unfortunately, custom logic in post-push scripts will need to be updated or removed like you have outlined. In the meantime, 12.12.4 will continue to work for you
Closing the issue, do reach out if you require any further assistance on this.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
How did you install the Amplify CLI?
npm install -g @aws-amplify/cli
If applicable, what version of Node.js are you using?
the latest
Amplify CLI Version
v12.12.5
What operating system are you using?
Ubuntu
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
Deployment of the Amplify project started failing after 12.12.5 was released. No manual changes, but we do apply a post-push.js script to set the buckets to SSL only (because this wasn't a native feature).
Last successful run appears to be prior to the release (10 hours ago), whereas the release was 8 hours ago. The standard output of our jobs doesn't check the version of the Amplify CLI, so I can't tell you whether it was successful the first time.
Can see in CloudFormation that a Bucket Policy does not exist ont the main stack, so we assume it does NOT work if there is a pre-defined policy on the bucket.
Describe the bug
Updated version tries to create a bucket policy. If one already exists (as in our case) we get: CREATE_FAILED DeploymentBucketBlockHTTP AWS::S3::BucketPolicy Fri Aug 02 2024 08:21:18 GMT+0000 (Coordinated Universal Time) The bucket policy already exists on bucket amplify--deployment.
Expected behavior
Technically, I would expect it to check before deployment, but I doubt this is possible and we'll need to refactor our post-push.js scripts for about 30 applications. Manually remove the policy, then update to this version and redeploy.
Reproduction steps
jsonData
: team-provider-info.jsonregion
: the region we're running inparameters
: pulled from jsonData['ourenvname'].cloudformationawsConfig
: SDK credentials configuration objectNOTE: You can keep it simple, ultimately we find the deployment bucket name in this way and then apply the policy to it.
Project Identifier
No response
Log output
Additional information
Meanwhile we've reverted to 12.12.4 and the pipeline is working again.
Before submitting, please confirm: