Replies: 3 comments 1 reply
-
One idea is to be able to override specific settings explicitly: service: app-backend
provider:
name: aws
lift:
vpc:
az: 3
constructs:
# ...
db:
type: database/sql
instanceType: t3.xlarge
storage: 3000
# Map each stage to a "dev/prod mode"
stageMapping:
prod: prod
staging: prod
default: dev
# Override specific settings for "dev mode" only
dev:
lift:
vpc:
az: 1
nat:
type: instance
constructs:
db:
instanceType: t3.micro
storage: 20 I don't like this option, it's confusing and complex. But I thought it was worth mentioning 🤷 |
Beta Was this translation helpful? Give feedback.
-
Another idea is to simply not support the feature. Users would be able to solve that problem by having 2 config files with different settings:
# serverless.yml
service: app-backend
provider:
name: aws
lift:
vpc:
az: 3
constructs:
# ...
db:
type: database/sql
instanceType: t3.xlarge
storage: 3000
# serverless.dev.yml
service: app-backend
provider:
name: aws
lift:
vpc:
az: 1
nat:
type: instance
constructs:
# ...
db:
type: database/sql That solution is simple to implement (because there's nothing to do), and simple to understand for users. However it can involve a lot of duplicated config over those 2 files… |
Beta Was this translation helpful? Give feedback.
-
Iterating on the previous idea (duplicating everything), we could have an
# serverless.yml
service: app-backend
provider:
name: aws
lift:
vpc:
az: 3
constructs:
# ...
db:
type: database/sql
instanceType: t3.xlarge
storage: 3000
# serverless.dev.yml
extends: serverless.yml
lift:
vpc:
az: 1
nat:
type: instance
constructs:
db:
instanceType: t3.micro
storage: 20 Using the I expect that solution to be harder to implement (maybe it would make sense to actually do that in the Serverless Framework itself). But past the initial complexity to implement, it seems easy to understand for users. |
Beta Was this translation helpful? Give feedback.
-
A topic we wanted to cover from the start was helping users deploy applications with:
That "dev" mode is mostly about reducing costs.
For example, when deploying a database with a VPC, we don't want the same kind of instances, storage space and redundancy in prod and in dev.
Let's discuss some ideas here, as so far we haven't identified an ideal solution.
Since GitHub discussions allows response threads, let's open 1 response thread per idea. That way we can discuss each idea.
Beta Was this translation helpful? Give feedback.
All reactions