Open RyanTheAllmighty opened 3 months ago
@RyanTheAllmighty can you set domain name to *.example.com
directly?
new sst.aws.Nextjs('App', {
domain: {
name: "*.example.com",
dns: sst.cloudflare.dns(),
},
});
@RyanTheAllmighty can you set domain name to
*.example.com
directly?new sst.aws.Nextjs('App', { domain: { name: "*.example.com", dns: sst.cloudflare.dns(), }, });
@fwang It will work yes as there are no conflicting names/records, but *.example.com
doesn't cover example.com
so there's no cert or DNS record generated for the apex domain. If you need me to confirm that I can, just will take some time, but from my OP it wouldn't seem to be an issue
ah that makes sense.. lemme take a look
I'm also seeing this on AWS
+1 to facing this on AWS.
Even sst dev
won't work, throwing the same error.
What I've tried:
sst remove
& sst refresh
Currently I have a Nextjs application that I'm deploying and using CloudFlare as a DNS provider:
Doing that, ACM will request 2 validations, one for the root domain and then one for the wildcard, but they will both have the same record name:
This ends up failing a deploy with the below
Because the
resourceRecordName
is used as part of the name, it fails due to not being unique.The same also happens when it tries to create the actual DNS record pointing to the CloudFront distribution:
Seems like when it's creating the names for those, it's running through
sanitizeToPascalCase
and then stripping the*.
so the names end up being the same as seen at https://github.com/sst/ion/blob/dev/pkg/platform/src/components/cloudflare/dns.ts#L70I'm not sure of the correct fix, but for me I'm currently applying the below changes in my GitHub workflow to get around this issue for now and it works for me by deduplicating the DNS records for validation, and then in the CloudFlare DNS provider, changing the name suffix to explicitly change
*
tostar
which definitely feels a bit icky, but for now works to unblock me:https://github.com/sst/ion/blob/dev/pkg/platform/src/components/aws/dns-validated-certificate.ts#L56-L71
https://github.com/sst/ion/blob/dev/pkg/platform/src/components/cloudflare/dns.ts#L70