chalice
chalice copied to clipboard
"The domain name you provided already exists" Continuous Deployment (CD) + Custom Domain Names
After following both the Continuous Deployment (CD) and Custom Domain Names guides in the documentations. I'm not able to deploy by pushing to Github. The Beta stage is created but it fails with the message:
"The domain name you provided already exists"
Long version:
Logical ID: ApiGatewayCustomDomain
Status: CREATE_FAILED
Status Reason: Resource handler returned message: "The domain name you provided already exists. (Service: ApiGateway, Status Code: 400, Request ID: a1f7ccd0-706f-4276-b5d2-a678276c793b, Extended Request ID: null)" (RequestToken: d5adf486-d4a1-721c-de04-c1bda238ee7d, HandlerErrorCode: AlreadyExists)
For clarification, I was able to properly deploy my app with the custom domain using chalice deploy
, it's only when I push to Github and that triggers the cloud formation deploy that it fails, because the beta app is trying to use the same domain I'm already using. Is there a way to have this two "stages" use different domains?
I have the exact same issue. @leonelgalan did you find a fix?
I have the exact same issue. @leonelgalan did you find a fix?
No, I just stopped using Chalice. I'm using CDK and Lambda Powertools Python instead.
@eliyaba IDK if you still facing this problem, but I did some initial tests keeping the zip file generated right after I add the domain as an empty file (same name.zip but empty) and it worked fine. This is of course a huge workaround that worked fine to me.
For example, after add my custom host, the .chalice
looks like this:
.chalice/deployments/<some_hash>.zip
If you open this zip, delete all the content and then zip it again as an empty folder chalice will recognize it. So you can keep deploying with custom domains without any other problem.
That makes me think that we have a bug inside chalice code that make conditional we have the previous deployments to execute the deployment correctly. Anyways, that worked to me even don't being what I expected as perfect solution.