serverless-domain-manager icon indicating copy to clipboard operation
serverless-domain-manager copied to clipboard

serverless create-domain results in "unable to create domain..." no matter what domain was supplied.

Open ChrisMcHarvey opened this issue 4 years ago • 15 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Bug Report

Error Description Running the command, "serverless create-domain" results in "unable to create domain..." no matter what domain was supplied.

Command Run sls create_domain

Console Output Error --------------------------------------------------

Error: Error: Unable to create domain api.highmynameis.com at ServerlessCustomDomain. (/Users/charvey/Dev/ucann-rest/hmni-serverless/node_modules/serverless-domain-manager/dist/index.js:80:27) at Generator.throw () at rejected (/Users/charvey/Dev/ucann-rest/hmni-serverless/node_modules/serverless-domain-manager/dist/index.js:5:65) at processTicksAndRejections (internal/process/task_queues.js:97:5)

 For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Issues: forum.serverless.com

Your Environment Information --------------------------- Operating System: darwin Node Version: 12.16.1 Framework Version: 1.71.3 Plugin Version: 3.6.12 SDK Version: 2.3.1 Components Version: 2.30.11

Domain Manager Configuration Replace this with your own serverless.yml file (anonymized, of course) to help us better resolve your issue.

custom:
  customDomain:
    domainName: api.{goDaddy domain}.com
    basepath: api
    createRoute53Record: false

Versions

  • Node/npm version: Node 12/npm 6.14.5
  • Serverless Version: v1.71.1
  • Lambda Code: Javascript

ChrisMcHarvey avatar Jun 01 '20 01:06 ChrisMcHarvey

having the same issue

corydorning avatar Jun 25 '20 13:06 corydorning

@ChrisHarveyHub are you able to provide the output from "SLS_DEBUG=*" ?

cbschuld avatar Jun 25 '20 21:06 cbschuld

Was struggling with this. The following seemed to work for me.

  1. The certificate I was using was in a different region
  2. Provided the hostedZoneId to the configuration. This ensures explicit discovery.
custom:
  customDomain:
    domainName: api.domain.com
    basePath: api
    certificateName: *.domain.com,
    hostedZoneId: <hostedZoneId>
    createRoute53Record: true
    endpointType: regional
    securityPolicy: tls_1_2
    apiType: rest

sharmashobhit avatar Jul 14 '20 14:07 sharmashobhit

@sharmashobhit i have the same issue, now m trying your fix.

shardulsrivastava avatar Jul 16 '20 12:07 shardulsrivastava

I had the same issue but adding the certificateArn explicitly worked for me.

leoalbin avatar Jul 30 '20 00:07 leoalbin

I had the same issue I tried to fix it by migrating DNS Service From Godaddy to Route53 while allowed the server less-domain-manager to add records in the hosted zone.

RounakTadvi avatar Sep 23 '20 12:09 RounakTadvi

echoing with https://github.com/sharmashobhit

the 2 key elements in case you generated certificates with wilcards

certificateName: "*.domain.com"
hostedZoneId: ${opt:HOSTED_ZONE_ID}

devadyuti avatar Nov 10 '20 19:11 devadyuti

@leoalbin following your advice, certificateArn worked for me as well. Thanks.

lazyexpert avatar Jan 18 '21 17:01 lazyexpert

Using the below configuration, solved this particular issue for me:

domainName: ${self:custom.domains.${self:custom.stage}}
stage: "${self:custom.stage}"
basePath: "basePath"
certificateName: '*.yourdomain.com'
createRoute53Record: true
endpointType: 'endpointType'
securityPolicy: securityPolicy
hostedZoneId: ${opt:HOSTED_ZONE_ID}
certificateArn: 'domainCertificateArn'

RounakTadvi avatar Jan 23 '21 11:01 RounakTadvi

customDomain: domainName: 'your domain' basePath: 'v1' stage: ${self:provider.stage} certificateName: 'your domain' createRoute53Record: true

Above configuration only helped to create the custom domain name, I think the ACM Certificate should only be created either in North Virginia (us-east-1) or North California (us-west-1). Also add 'TAG' as your 'domain name' while creating the certificate.

ashrujitpal avatar May 23 '21 17:05 ashrujitpal

customDomain: domainName: 'your domain' basePath: 'v1' stage: ${self:provider.stage} certificateName: 'your domain' createRoute53Record: true

Above configuration only helped to create the custom domain name, I think the ACM Certificate should only be created either in North Virginia (us-east-1) or North California (us-west-1). Also add 'TAG' as your 'domain name' while creating the certificate.

that's not correct. for endpointType: edge the certificate needs to be issued in us-east-1 for endpointType: regional the certificate can be issued in the region (provided API gateway is supported by AWS in that) where you want to deploy your APIs

devadyuti avatar May 23 '21 17:05 devadyuti

Adding the certificateArn to custom domain and also adding region to provider solved the issue.

Sam-Sundar avatar Jul 21 '21 10:07 Sam-Sundar

customDomain: domainName: 'your domain' basePath: 'v1' stage: ${self:provider.stage} certificateName: 'your domain' createRoute53Record: true

Above configuration only helped to create the custom domain name, I think the ACM Certificate should only be created either in North Virginia (us-east-1) or North California (us-west-1). Also add 'TAG' as your 'domain name' while creating the certificate.

Hey @ashrujitpal,

No, we can create Cert. in any regions and provide the ARN and region to serverless via serverless.yaml file.

Sam-Sundar avatar Jul 21 '21 10:07 Sam-Sundar

Struggled also a while with this. Note that: endpointType: regional seemed crucial in my case to solve it (except for ARN etc.)

orfisko avatar Oct 26 '21 12:10 orfisko

I encountered the same issue and turn out the ACM certificate is expired. Do take a look at it.

VardyNg avatar May 10 '22 06:05 VardyNg

Hi @ChrisMcHarvey

Hope you have solved that issue.

We are not supporting version 3.x anymore. Please try our latest 6.x version and let us know in case of any issues

rddimon avatar Feb 06 '23 20:02 rddimon