serverless / components

The Serverless Framework's new infrastructure provisioning technology — Build, compose, & deploy serverless apps in seconds...
https://www.serverless.com
Apache License 2.0
2.31k stars 181 forks source link

alternative cloudfront domains wiped on each deploy #1008

Open tomyates opened 2 years ago

tomyates commented 2 years ago

I have the following serverless.yaml:

component: website               # (required) name of the component. In that case, it's website.
name: sa-front                   # (required) name of your website component instance.
app: sa-front                    # (optional) serverless dashboard app. default is the same as the name property.
stage: dev                       # (optional) serverless dashboard stage. default is dev.

inputs:
  domain: uat.domainname.com   # (optional) domain name. this could also be a subdomain.
  region: eu-west-1              # (optional) aws region to deploy to. default is us-east-1.
  src:
    src: ./src
    hook: npm run build
    dist: ./build

When I run sls deploy it wipes any alternative domains I've added in cloudfront and I have to re-add them manually. Is there a way of setting this alternative domains in the serverless.yaml file?

tomyates commented 2 years ago

Anyone got any thoughts? Thinking I could write a script to add the cnames to cloudfront after sls deploy?

tomyates commented 2 years ago

Solved this issue by just creating a new CloudFront instance for all the alternative domains which pointed to the same s3 bucket.