Open
Description
Description
When using sam deploy
with the AutoPublishAlias
property in the template it always returns the error:
Error: Failed to create changeset for the stack: stack-name, ex: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state: For expression "Status" we matched expected path: "FAILED" Status: FAILED. Reason: Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [DocumentLoaderFunction] is invalid. 'AutoPublishAlias' must be a string or a Ref to a template parameter
Note 1: This happens wether I use a string directly or a !Ref to a Template Parameter
Note 2: This fails in macOS, but for example when running in a Github Action it works correctly.
Steps to reproduce
Use the following template:
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
Sample
Globals:
Function:
Timeout: 30
Resources:
SomeFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: function/
Handler: app.lambdaHandler
Runtime: nodejs20.x
MemorySize: 512
Timeout: 60
FunctionName: SomeFunction
AutoPublishAlias: DEV
Architectures:
- x86_64
Role: arn:aws:iam::XXXXXX:role/SomeRole
Metadata: # Manage esbuild properties
BuildMethod: esbuild
BuildProperties:
Minify: true
Target: "es2020"
Sourcemap: true
EntryPoints:
- app.ts
Run
sam deploy
Observed result
Error: Failed to create changeset for the stack: stack-name, ex: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state: For expression "Status" we matched expected path: "FAILED" Status: FAILED. Reason: Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [DocumentLoaderFunction] is invalid. 'AutoPublishAlias' must be a string or a Ref to a template parameter
Expected result
A success full deploy
Additional environment details
- OS: macOS 15.3 (Sequoia)
- If using the SAM CLI,
sam --version
: 1.133.0 - AWS region: eu-central-1