Replies: 1 comment 3 replies
-
|
I would recommend to use stage parameters: https://www.serverless.com/framework/docs/guides/parameters#stage-parameters |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi maintainers,
First, I want to thank you for the excellent work on the serverless-lift plugin. It has significantly streamlined our serverless deployments.
I have a question regarding the configuration of stage-based domain names using the server-side-website construct. Specifically, I'm looking to set up different domains based on the deployment stage. Here's the scenario I'm trying to achieve:
Stage: prod
Domain: example.com
Stage: dev
Domain: dev.example.com
Stage: abc
Doamin: abc.example.com
Here is an example of my current serverless.yml configuration:
service: my-service
provider:
name: aws
region: us-west-2
stage: ${opt:stage, 'dev'}
runtime: provided.al2
plugins:
custom:
baseDomain: example.com
domain:
'Fn::If':
- IsProd
- ${self:custom.baseDomain}
- ${self:provider.stage}.${self:custom.baseDomain}
constructs:
website:
type: server-side-website
assets:
'/assets/*': public/assets
domain: ${self:custom.domain}
certificate: arn:aws:acm:region:account-id:certificate/certificate-id
resources:
Conditions:
IsProd:
Fn::Equals:
- ${self:provider.stage}
- prod
Unfortunately, this configuration results in an invalid format error. Is there a recommended approach to dynamically set domain names based on the stage using the server-side-website construct in serverless-lift?
I appreciate any guidance or examples you can provide. Thanks in advance for your assistance!
Best regards,
Beta Was this translation helpful? Give feedback.
All reactions