Skip to content

Instantly share code, notes, and snippets.

@stympy
Created October 15, 2020 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stympy/9783ca118c724a4e0f23019f631e87c3 to your computer and use it in GitHub Desktop.
Save stympy/9783ca118c724a4e0f23019f631e87c3 to your computer and use it in GitHub Desktop.
Creating resources in only one region when deploying to multiple regions with the serverless framework
service: hook-relay
provider:
name: aws
custom:
resources:
us-east-1: ${file(./resources/timestream.yml)} # The resources that should be created in just one region
resources:
- ${file(./resources/main.yml)} # All the resources that should be created in each region, like queues, etc.
- ${self:custom.resources.${self:provider.region}, ''}
Resources:
tsdb:
Type: AWS::Timestream::Database
Properties:
DatabaseName: "hook-relay-${self:custom.stage}"
tsdeliveries:
Type: AWS::Timestream::Table
Properties:
DatabaseName: !Ref tsdb
TableName: deliveries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment