I'm new to AWS and SAM, so this may be an obvious question, but I just can't find an answer to it. I'm trying to construct a SAM template that allows the user to inject a parameter that will affect the names of all resources within. Specifically, an "environment" parameter can be passed in, which will then be used to qualify all resource names:
AWSTemplateFormatVersion: "2010-09-09"
Transform: "AWS::Serverless-2016-10-31"
Parameters:
EnvironmentParameter:
Type: "String"
Default: "default"
Resources:
GetTermsAndConditionsFunction:
Type: "AWS::Serverless::Function"
Properties:
# TODO: prepend the environment somehow so I get "$ENVIRONMENT_MyFunction" instead
FunctionName: "MyFunction"
Handler: "..."
...
How can I dynamically construct a FunctionName
using EnvironmentParameter
?