Hello, when I update my lambda and I have AutoPublishAlias activated. Api Gateway does not deploy to update the version of the target lambda.
what am I doing wrong?
my code: https://github.com/fjanuszewski/demo_aws_apigateway_lambda_dynamo
(i'm using swagger)
Globals:
Function:
Runtime: nodejs14.x
AutoPublishAlias: live
Resources:
CommonsLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName:
Fn::Sub: ${AWS::StackName}-CommonsLayer
Description: "Commons Libs"
ContentUri: ./layers/commons
LicenseInfo: Available under the MIT-0 license.
CompatibleRuntimes:
- nodejs14.x
Metadata:
BuildMethod: nodejs14.x
ServerlessRestApi:
Type: AWS::Serverless::Api
Properties:
Name:
Fn::Sub: ${AWS::StackName}-ApiGateway
StageName:
Ref: Environment
Variables:
Environment:
Ref: Environment
DefinitionBody:
Fn::Transform:
Name: AWS::Include
Parameters:
Location: ./swagger.yaml
GetItem:
Type: AWS::Serverless::Function
Properties:
Handler: app.handler
Timeout: 30
MemorySize: 128
CodeUri: ./functions/getItem
FunctionName:
Fn::Sub: ${AWS::StackName}-GetItem
Layers:
- Ref: CommonsLayer
Environment:
Variables:
ENV:
Ref: Environment
EXAMPLE_TABLE:
Ref: ExampleTable
Policies:
- AWSLambdaExecute
- AWSXRayDaemonWriteAccess
- Statement:
- Effect: Allow
Action:
- "dynamodb:GetItem"
Resource:
Fn::GetAtt: ExampleTable.Arn
Events:
HttpEvent:
Type: HttpApi
Properties:
Path: /items/{idItem}
Method: GET
ApiId:
Ref: ServerlessRestApi