Any reason that this code couldnt be easily extend...
# help
b
Any reason that this code couldnt be easily extended to allow you to specify multiple alternate domain names? https://github.com/serverless-stack/serverless-stack/blob/b798c92bbccc47b6be0dccb8e3bfddf2fc6b6956/packages/resources/src/StaticSite.ts#L477-L484 i.e., Right now it will always produce an array with length == 1 so there doesn't seem to be away to have more than one alternate domain name on a cloudfront distribution
f
Hey @brent, do you want these other domains to redirect to the main domain? ie.
<http://app-v2.tina.io|app-v2.tina.io>
redirects to
<http://app.tina.io|app.tina.io>
?
b
Sort of the opposite, but without a redirect. So I have an old distribution that was hosted at
<http://app.tina.io|app.tina.io>
, and I created a new distribution that is hosted at
<http://app-v2.tina.io|app-v2.tina.io>
. To get zero downtime I want
<http://app.tina.io|app.tina.io>
to be an URL that I can configure to point at any distribution by assigning it as an alternate domain name. So in the future I might create an
<http://app-v3.tina.io|app-v3.tina.io>
distribution and just swap where
<http://app.tina.io|app.tina.io>
to point at that distro.
Right now, I have this working by manually adding the alternate domain name in the aws console, but I need to remake that change every time I deploy.