Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sst.vercel.dns fails to set apex domain record #4388

Closed
klaemo opened this issue Jul 23, 2024 · 3 comments
Closed

sst.vercel.dns fails to set apex domain record #4388

klaemo opened this issue Jul 23, 2024 · 3 comments
Assignees

Comments

@klaemo
Copy link
Contributor

klaemo commented Jul 23, 2024

I wanted to assign a domain to my production deployment, but it failed with the following error:

Error creating DNS Record: Could not create DNS Record, unexpected error: invalid_name - Please specify a name or use an ALIAS Record instead, if you're attempting to set a CNAME value for the apex domain.

Makes sense because it generated the following record. Vercel's DNS doesn't like that:

{
  domain: 'my-domain.de',
  type: 'CNAME',
  name: '',
  value: 'd34xxxxxxxbev.cloudfront.net',
  teamId: undefined,
  ttl: 60
}

A transform to an ALIAS record fixed it.

domain: {
  name: "my-domain.de",
  dns: sst.vercel.dns({
    domain: "my-domain.de",
    transform: {
      record(record) {
        if (record.name === "" && record.type === "CNAME") {
          record.type = "ALIAS"
        }
      },
    },
  }),
}

I think this could/should be done by default in sst.vercel.dns when record.name === args.domain.

@fwang
Copy link
Contributor

fwang commented Aug 11, 2024

Fixed sst/ion@55524f5

@fwang fwang closed this as completed Aug 11, 2024
@klaemo
Copy link
Contributor Author

klaemo commented Aug 12, 2024

I'm not sure this is fixed. I removed the transform I had in place, deployed and now the ALIAS record is gone and my site is broken.

SST ❍ ion 0.1.93

It looked like it created an alias record, but it doesn't exist in the my vercel dns records

|  Created     Frontend sst:aws:Remix → FrontendCdnALIASRecordMyDomainde vercel:index:DnsRecord
|  Deleted     Frontend sst:aws:Remix → FrontendCdnCNAMERecordMyDomainde vercel:index:DnsRecord

@klaemo
Copy link
Contributor Author

klaemo commented Aug 12, 2024

Okay, so I removed the custom domain from the sst config and deployed. Then re-added it, but first got the following error:

✕  Failed
   Frontend sst:aws:Remix → FrontendCdnDistribution aws:cloudfront:Distribution
   updating urn:pulumi:production::neugekocht::sst:aws:Remix$sst:aws:CDN$aws:cloudfront/distribution:Distribution::FrontendCdnDistribution: 1 error occurred:
                                                                                                                             
   CloudFront: UpdateDistribution, https response error StatusCode: 400, RequestID: dcb78a2b-c18b-432c-95ea-17c81c45c9c1, IllegalUpdate: Only one viewer certificate change may be in progress at a time.

Ran it again a little while later and it worked. The ALIAS record got created. So, I guess it is working after all?!

@thdxr thdxr transferred this issue from sst/ion Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants