examples
examples copied to clipboard
How to reference variable from environment variable and fallback to default value as a ref one?
Provider: AWS I have the following resource in serverless.yml
resources:
Resources:
MyQueue:
Type: AWS::SQS::Queue
Properties:
QueueName:${self:provider.stage}_my_queue
What I need to do is to reference an environment variable from .env file and fallback to ref MyQueue if .env file is missing that key.
referencing a resource is like this
MY_QUEUE: { Ref: MyQueue }
how we can do it like this
MY_QUEUE: ${env:MY_QUEUE, {Ref: MyQueue} } # this not valid one