components
components copied to clipboard
alternative cloudfront domains wiped on each deploy
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?
Anyone got any thoughts? Thinking I could write a script to add the cnames to cloudfront after sls deploy
?
Solved this issue by just creating a new CloudFront instance for all the alternative domains which pointed to the same s3 bucket.