Is it possible to have a customDomain setup so it ...
# sst
j
Is it possible to have a customDomain setup so it uses the [stage/prefix].apis.domain.com?
Copy code
customDomain: {
        domainName: "*.<http://apis.domain.com|apis.domain.com>",
would create ci.apis.domain.com or branch_name.apis.domain.com etc
f
if the branch_name is exposed as an env var in ur CI, can u do something like this?
Copy code
domain: `${process.env.BRANCH_NAME}.<http://apis.domain.com|apis.domain.com>`
j
thanks @Frank now getting "The certificate provided must be owned by the account creating the domain" when
customDomain: {
domainName:
${environment.id}.<http://api.domain.com|api.domain.com>
, hostedZone: "domain.com", path: "v2", certificate: Certificate.fromCertificateArn(this, "SstDentrCert", "arnawsacmus east 1[account_id]:certificate/[guid]"), },
f
Is the certificate in a different AWS account?
j
@Frank no not a different account, but different region. Switch to same region and got rid of that error now get
Copy code
Invalid domain name identifier specified (Service: AmazonApiGatewayV2; Status Code: 404; Error Code: NotFoundException;
if
customDomain.path="v2"
or
Copy code
An ApiMapping key may contain only letters, numbers anif d one of
if
customDomain.path="/v2"
Any pointers welcome!
f
Have you tried it without specifying the
certificate
?
Copy code
customDomain: {
  domainName: `${environment.id}.<http://api.domain.com|api.domain.com>`,
  hostedZone: "<http://domain.com|domain.com>",
  path: "v2",
},
j
Issue fixed Things to note for those having the issue: •
customDomain.domainName
has to be lowercase •
customDomain.path
should not contain
/
("/v2" will error, "v2" will work) •
customDomain.certificate
when using
Certificate.fromCertificateArn
the
certArn
of the certificate needs to be the same AWS region as the deployment target
f
Thanks @Jack Fraser. Let me take a look at these issues, and see what SST can do to auto-detect them.
Quick up: added a
domainName
lowercase check in the new release v0.17.0