Skip to content

aws lambda deploy-serverless command not updating Layer version when used with secrets manager #448

@awsimaya

Description

@awsimaya

When trying to update an existing Lambda function with a Lambda Layer using aws lambda deploy-serverless command, it fails to update the function with the latest layer version when the Layer ARN is fetched from AWS Secrets Manager. Creating a new function with the same command works fine. Issue is only when we do consecutive updates to the same function.

Scenario

  • Create a Lambda Function with Layer
  • Update the Layer using dotnet lambda publish-layer command.
  • Now run aws lambda deploy-serverless command by passing a serverless template. Example command below
dotnet lambda deploy-serverless -sb my-lambda-apps -t .\serverless.yaml -sn OrderProcessor
  • serverless.yaml command has the Layer settings as below. Layer ARN is stored as a key/value pair in AWS Secrets Manager.
Layers:
        - '{{resolve:secretsmanager:LambdaLayerSecretArn:SecretString:LambdaLayerSecretArn}}'
  • When the Layer ARN is directly given as plain text in the .yaml file, there is no issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions