You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 28, 2025. It is now read-only.
Describe the bug
You will get a CNAMEAlreadyExists: One or more of the CNAMEs you provided are already associated with a different resource. when you are doing a fresh deploy (one without the .serverless folder with existing config info) and the lambda already exists. Serverless docs say you shouldnt commit your .serverless folder but in this case you would have to or else it will create a new cloudfront distribution and try to assign that new one to your domain and you get the error. Normal SLS avoids these issues because it uses cloudformation?
The text was updated successfully, but these errors were encountered:
I believe this plugin needs to use new version of Serverless Components: #415 (comment) to sync the state, though it needs to be upgraded as per the issue.
You can commit the .serverless folder each time but will be hard to manage while in a CI/CD pipeline, especially if you have multiple deployment stages (test, prod, etc.). If you have a single stage, you can do something like the following:
# Before running serverless fetch remotely stored folders
aws s3 sync "s3://my-serverless-state-bucket/my-component/${STAGE}/.serverless" .serverless
serverless
# After running serverless sync it's folders back to S3 bucket
aws s3 sync .serverless "s3://my-serverless-state-bucket/my-component/${STAGE}/.serverless"
This is the solution from: #328 (comment). If you have multiple stages it might be useful to create a custom deployment script that will sync to different S3 buckets/paths based on stage (you would also need to programmatically generate different serverless.yml files for each stage).
Describe the bug
You will get a
CNAMEAlreadyExists: One or more of the CNAMEs you provided are already associated with a different resource.
when you are doing a fresh deploy (one without the .serverless folder with existing config info) and the lambda already exists. Serverless docs say you shouldnt commit your .serverless folder but in this case you would have to or else it will create a new cloudfront distribution and try to assign that new one to your domain and you get the error. Normal SLS avoids these issues because it uses cloudformation?The text was updated successfully, but these errors were encountered: