I would like to know if it is possible to invoke a lambda function with an alias from a Step Function?
I currently have a few Lambda functions setup to work with alias. (one for each environment, such as DEV, UAT etc). This is convenient as it means I don't need to deploy separate Lambda functions for each environment.
I would like to achieve the same thing with Step Functions and start execution on the state machine with a value that represents the executing environment (Alias).
I would then like to use that value within the State Machine Language to pass that into the arn of the Lambda function.
Something like this.
"Comment": "DEV Send Email Notification",
"StartAt": "Send Email Through Mandrill",
"States": {
"Send Email Through Mandrill": {
"Type": "Task",
"Resource": "arn:aws:states:::lambda:invoke",
"Parameters": {
"FunctionName": "arn:aws:lambda:{region}:{accountId}:function:Email-Notification:DEV",
"Payload": {
"Input.$": "$"
}
},
...
Instead of using arn:aws:lambda:{region}:{accountId}:function:Email-Notification:DEV as the FunctionName, can I use values from the state machine input such as
"FunctionName": "arn:aws:lambda:{region}:{accountId}:function:Email-Notification:$.Alias"
or can I use other "Parameters" for alias?
I am trying to avoid setting up the same Step Function per environment.