Articles → AWS → Use AWS API Gateway Stage Variables To Call Specific Lambda Aliases
Use AWS API Gateway Stage Variables To Call Specific Lambda Aliases
Create A Lambda Function
Create The Lambda Function Alias
Create The Staging Variable
Specifying The Staging Variable In API Gateway
${stageVariables.[staging_variable_name]}
Executing Script On CLI
aws lambda add-permission --function-name "arn:aws:lambda:ap-south-1:462618770999:function:lambafunc:myalias" --source-arn "arn:aws:execute-api:ap-south-1:462618770999:iv8s88eaw7/*/GET/" --principal apigateway.amazonaws.com --statement-id 0c3f20ef-7652-411c-b82c-8ca69d0fbf70 --action lambda:InvokeFunction
Output