Resolve AWS variables in Serverless when you don't want to actually make a call to AWS
npm install serverless-aws-resolverThis plugin allows CloudFormation and SSM variables to be used even totally offline. Normally these variables are fetched from AWS during the Serverless packaging stage, but when this plugin is enabled it will intercept the requests to AWS and return the values from your custom config.
This is useful when you want to build a stack in an environment that doesn't have access to AWS, such as test environments or environments which are completely offline.
yaml
plugins:
- serverless-aws-resolver # You'll probably want this at the top of plugins listcustom:
serverless-aws-resolver:
stages:
- dev # The stages where you want to enable this plugin
ssm: # SSM
/some-path/SOME_SSM_KEY: 'Your String Value' # The key and value you want to provide
cf: # Cloudformation
service-resources-dev: # The Cloudformation stack name
AlarmsSNSTopic: Foo # Key and value you want to provide
SomethingElse: Bar
aws:
accountId: 123456789012 # Currently only accountId is the only supported AWS variable
``