I'm going through the guide, and when deploying to...
# help
p
I'm going through the guide, and when deploying to prod, I'm getting this error:
Copy code
prod-ww3-api failed: The domain name you provided already exists. (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException; Request ID: 04242074-0225-44bc-a8d1-a1cf94aef985; Proxy: null)
It is correct that the domain name already exists, it's handled by CDK, it has many more entries (email, and other things). The frontend didn't have a problem with the domain existing though, it just injected the records into it.
f
Hi @Pablo Fernandez, to use a domain in your Route 53 account, you’d have to add that domain to API Gateway. SST does this for you automatically.
The error suggests that you have another API Gateway project using the same domain, and the domain has already been added to API Gateway.
p
Yeah, I switched it from api.example.com to api2.example.com and it worked.
f
ah yeah
p
But I'm not using api.example.com anywhere.
Or... rather... anywhere that I can find.
Checked API Gateways and CloudFront distributions.
I only have this project in this AWS account plus CDK stacks that create the Route53 zones with a few records setting MX and things like that.
I notice that it creates the CNAME for DNS verification to create the certificate for api.example.com, but it fails to create the certificate.
Or rather, there's no certificate.
f
If you go into ur API Gateway console > select
Custom domain names
on the left, what does it show?
p
(I just deleted the api stack that created api2.example.com)
f
I see. Can you try using
<http://api.example.com|api.example.com>
again? That should work now 🤔
p
Give me a sec while I run deploy.
Got the error again:
Copy code
prod-ww3-api | UPDATE_FAILED | AWS::ApiGatewayV2::DomainName | ApiDomainNameAC93F744 | The domain name you provided already exists. (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException; Request ID: 40cf6d9f-8c05-4305-b1ae-b7046e117ac6; Proxy: null)
j
@Frank just bringing this up again.
f
Hey @Pablo Fernandez, hmm maybe check switch to other regions and other AWS accounts you might have used, and see if the domain exists in the API Gateway console.
If it’s not there, the only thing i can think of would be to contact AWS support and see if something is cached on their end.
p
@Frank I'm putting everything in a single region exactly to avoid this sort of problem. And I use the Tag Editor to search cross-region and make sure I don't get resources on other regions.
f
hmm.. are you able to create the domain manually in API Gateway console?
p
No, I get the same error.
Or I did, the last time I tried.
f
I see. Yeah if you get the same error in the API Gateway console, and its not in one of your account/region, you might’ve to contact AWS support to get help.