How to associate an AWS Lambda alias with an API Gateway
Lambda is $LATEST is up-to-date and can be versioned. In addition, there are aliases.
If you want to version your current Lambda, press “Publish new version”.
Name it “version2” or something appropriate.
Next, press the “Create Alias” button.
Create it with the name “dev”.
On the API Gateway side, set the backend Lambda as “alias:lambda name” as in “aliastestlambda:dev”.
${stageVariables.alias}
You can also write “dev” as a bare string, or you can use stage variables by specifying ${stageVariables.alias}. Write the backend Lambda as “aliastestlambda:${stageVariables.alias}”.
Now you can associate the stage variable with the name “alias” and the value “dev” and it is OK. Finally, you can deploy and confirm that Lambda is executed.
コメント