Skip to content

Lambda with AutoPublishAlias and AutoPublishAliasAllProperties does not create a new version when the referenced Parameter value changes #3820

Open

Description

@daniel-afana

Description

In my AWS::Serverless::Function Environment section, I have the Parameter referenced.
When the parameter value changes and I run sam deploy, a new Lambda version is not created.

Steps to reproduce

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Parameters:
  TestParameter:
    Type: String

Resources:
  HelloWorldFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: hello_world/
      Handler: app.lambda_handler
      Environment:
        Variables:
          TEST_PARAMETER: !Ref TestParameter
      AutoPublishAlias: live
      AutoPublishAliasAllProperties: true
      Runtime: python3.12
      Architectures:
        - x86_64
sam build --template-file template.yaml --parameter-overrides TestParameter='3'
sam deploy --config-file samconfig.toml --template-file template.yaml --debug --parameter-overrides TestParameter='3'

Observed result

No new Lambda version is created

2025-09-30 19:30:57,747 | Config file location: .../LambdaVersions/samconfig.toml            
2025-09-30 19:30:57,748 | Loading configuration values from [default.['deploy'].parameters] (env.command_name.section) in config file at  '.../LambdaVersions/samconfig.toml'...                                                       
2025-09-30 19:30:57,748 | Configuration values successfully loaded.                                                                       
2025-09-30 19:30:57,749 | Configuration values are: {'stack_name': 'LambdaVersions', 'template': 'template.yaml', 'capabilities':         
'CAPABILITY_IAM', 'confirm_changeset': True, 'no_resolve_s3': True, 's3_bucket': '...', 's3-prefix':  '...'}                                                                                                         
2025-09-30 19:30:57,763 | Using config file: samconfig.toml, config environment: default                                                  
2025-09-30 19:30:57,764 | Expand command line arguments to:                                                                               
2025-09-30 19:30:57,764 | --template_file=.../LambdaVersions/template.yaml                   
--parameter_overrides={'TestParameter': '3'} --fail_on_empty_changeset --confirm_changeset --on_failure=ROLLBACK --max_wait_duration=60
--stack_name=LambdaVersions --s3_bucket=... --capabilities=['CAPABILITY_IAM']                                               
2025-09-30 19:30:57,858 | Collected default values for parameters: {}                                                                     
2025-09-30 19:30:57,866 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource
logical id as the resource id                                                                                                             
2025-09-30 19:30:57,866 | There is no customer defined id or cdk path defined for resource ServerlessRestApi, so we will use the resource 
logical id as the resource id                                                                                                             
2025-09-30 19:30:57,866 | 0 stacks found in the template                                                                                  
2025-09-30 19:30:57,867 | Collected default values for parameters: {}                                                                     
2025-09-30 19:30:57,872 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource
logical id as the resource id                                                                                                             
2025-09-30 19:30:57,873 | There is no customer defined id or cdk path defined for resource ServerlessRestApi, so we will use the resource 
logical id as the resource id                                                                                                             
2025-09-30 19:30:57,947 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource
logical id as the resource id                                                                                                             
2025-09-30 19:30:57,947 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is 
HelloWorldFunction                                                                                                                        
2025-09-30 19:30:58,439 |                                                                                                                 
        File with same data already exists at ..., skipping upload                                           

	Deploying with following values
	===============================
	Stack name                   : LambdaVersions
	Region                       :...
	Confirm changeset            : True
	Disable rollback             : False
	Deployment s3 bucket         :...
	Capabilities                 : ["CAPABILITY_IAM"]
	Parameter overrides          : {"TestParameter": "3"}
	Signing Profiles             : {}

Initiating deployment
=====================

2025-09-30 19:30:58,466 | Collected default values for parameters: {}                                                                     
2025-09-30 19:30:58,476 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is 
HelloWorldFunction                                                                                                                        
2025-09-30 19:30:58,477 | There is no customer defined id or cdk path defined for resource ServerlessRestApi, so we will use the resource 
logical id as the resource id                                                                                                             
2025-09-30 19:30:58,477 | 0 stacks found in the template                                                                                  
2025-09-30 19:30:58,477 | Collected default values for parameters: {}                                                                     
2025-09-30 19:30:58,486 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is 
HelloWorldFunction                                                                                                                        
2025-09-30 19:30:58,486 | There is no customer defined id or cdk path defined for resource ServerlessRestApi, so we will use the resource 
logical id as the resource id                                                                                                             
2025-09-30 19:30:58,487 | 2 resources found in the stack                                                                                  
2025-09-30 19:30:59,741 |                                                                                                                 
        File with same data already exists at ....template, skipping upload                                  


Waiting for changeset to be created..

CloudFormation stack changeset
-------------------------------------------------------------------------------------------------------------------------------------
Operation                         LogicalResourceId                 ResourceType                      Replacement                     
-------------------------------------------------------------------------------------------------------------------------------------
* Modify                          HelloWorldFunction                AWS::Lambda::Function             False                           
-------------------------------------------------------------------------------------------------------------------------------------


Changeset created successfully. arn:aws:cloudformation:...:...:changeSet/samcli-deploy.../...


Previewing CloudFormation changeset before deployment
======================================================

Expected result

According to AutoPublishAliasAllProperties documentation, the new Lambda version should be created ("When true, a new Lambda version is created when any property in the Lambda function is modified").

Compare to changing the Lambda environment variable value in the template directly:

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Parameters:
  TestParameter:
    Type: String

Resources:
  HelloWorldFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: hello_world/
      Handler: app.lambda_handler
      Environment:
        Variables:
          TEST_PARAMETER: 3
      AutoPublishAlias: live
      AutoPublishAliasAllProperties: true
      Runtime: python3.12
      Architectures:
        - x86_64

sam build --template-file template.yaml

sam deploy --config-file samconfig.toml --template-file template.yaml --debug
2025-09-30 19:45:50,908 | Config file location: .../LambdaVersions/samconfig.toml            
2025-09-30 19:45:50,910 | Loading configuration values from [default.['deploy'].parameters] (env.command_name.section) in config file at '.../LambdaVersions/samconfig.toml'...                                                       
2025-09-30 19:45:50,910 | Configuration values successfully loaded.                                                                       
2025-09-30 19:45:50,910 | Configuration values are: {'stack_name': 'LambdaVersions', 'template': 'template.yaml', 'capabilities':         
'CAPABILITY_IAM', 'confirm_changeset': True, 'no_resolve_s3': True, 's3_bucket': '...', 's3-prefix': '.../'}                                                                                                         
2025-09-30 19:45:50,924 | Using config file: samconfig.toml, config environment: default                                                  
2025-09-30 19:45:50,924 | Expand command line arguments to:                                                                               
2025-09-30 19:45:50,925 | --template_file=.../LambdaVersions/template.yaml                   
--fail_on_empty_changeset --confirm_changeset --on_failure=ROLLBACK --max_wait_duration=60 --stack_name=LambdaVersions                    
--s3_bucket=... --capabilities=['CAPABILITY_IAM']                                                                           
2025-09-30 19:45:51,016 | Collected default values for parameters: {}                                                                     
2025-09-30 19:45:51,024 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource
logical id as the resource id                                                                                                             
2025-09-30 19:45:51,025 | There is no customer defined id or cdk path defined for resource ServerlessRestApi, so we will use the resource 
logical id as the resource id                                                                                                             
2025-09-30 19:45:51,025 | 0 stacks found in the template                                                                                  
2025-09-30 19:45:51,026 | Collected default values for parameters: {}                                                                     
2025-09-30 19:45:51,031 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource
logical id as the resource id                                                                                                             
2025-09-30 19:45:51,031 | There is no customer defined id or cdk path defined for resource ServerlessRestApi, so we will use the resource 
logical id as the resource id                                                                                                             
2025-09-30 19:45:51,104 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource
logical id as the resource id                                                                                                             
2025-09-30 19:45:51,104 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is 
HelloWorldFunction                                                                                                                        
2025-09-30 19:45:51,669 |                                                                                                                 
        File with same data already exists at ..., skipping upload                                           

	Deploying with following values
	===============================
	Stack name                   : LambdaVersions
	Region                       : ...
	Confirm changeset            : True
	Disable rollback             : False
	Deployment s3 bucket         :...
	Capabilities                 : ["CAPABILITY_IAM"]
	Parameter overrides          : {}
	Signing Profiles             : {}

Initiating deployment
=====================

2025-09-30 19:45:51,694 | Collected default values for parameters: {}                                                                     
2025-09-30 19:45:51,703 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is 
HelloWorldFunction                                                                                                                        
2025-09-30 19:45:51,704 | There is no customer defined id or cdk path defined for resource ServerlessRestApi, so we will use the resource 
logical id as the resource id                                                                                                             
2025-09-30 19:45:51,704 | 0 stacks found in the template                                                                                  
2025-09-30 19:45:51,705 | Collected default values for parameters: {}                                                                     
2025-09-30 19:45:51,713 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is 
HelloWorldFunction                                                                                                                        
2025-09-30 19:45:51,713 | There is no customer defined id or cdk path defined for resource ServerlessRestApi, so we will use the resource 
logical id as the resource id                                                                                                             
2025-09-30 19:45:51,714 | 2 resources found in the stack                                                                                  
	Uploading to ...template  1349 / 1349  (100.00%)


Waiting for changeset to be created..

CloudFormation stack changeset
-------------------------------------------------------------------------------------------------------------------------------------
Operation                         LogicalResourceId                 ResourceType                      Replacement                     
-------------------------------------------------------------------------------------------------------------------------------------
+ Add                             HelloWorldFunctionVersionfd...   AWS::Lambda::Version              N/A                             
* Modify                          HelloWorldFunctionAliaslive       AWS::Lambda::Alias                  False                           
* Modify                          HelloWorldFunction                   AWS::Lambda::Function             False                           
- Delete                          HelloWorldFunctionVersion...      AWS::Lambda::Version              N/A                                                                                                                   
-------------------------------------------------------------------------------------------------------------------------------------


Changeset created successfully. arn:aws:cloudformation...:...:changeSet/samcli-deploy.../...


Previewing CloudFormation changeset before deployment
======================================================

Additional environment details

  1. OS: macOS 15.6.1
  2. If using the SAM CLI, sam --version: SAM CLI, version 1.144.0
  3. AWS region: eu-central-1

Activity

  1. added
    stage/needs-triage
    on Sep 30, 2025
  2. roger-zhangg commented on Jul 2, 2026

    @roger-zhangg
    Member

    Hi, thanks for reporting this. We're looking into the AutoPublishAlias version-change detection behavior.

    To help us investigate and reproduce, could you provide:

    1. A minimal SAM template demonstrating the issue (with the Parameter and AutoPublishAlias/AutoPublishAliasAllProperties configuration)
    2. The deploy commands you're running (e.g., sam deploy --parameter-overrides ...)
    3. Confirmation of your SAM CLI version and aws-sam-translator version

    This will help us determine whether the version hash calculation is missing parameter value changes. Thanks!

  3. daniel-afana commented on Jul 25, 2026

    @daniel-afana
    Author

    Hello @roger-zhangg,

    I generated a SAM stack code with
    sam init --runtime python3.12 --name sam-app --app-template hello-world --package-type Zip --dependency-manager pip

    and replaced template.yaml with

    AWSTemplateFormatVersion: '2010-09-09'
    Transform: AWS::Serverless-2016-10-31
    
    Parameters:
      TestParameter:
        Type: String
    
    Resources:
      HelloWorldFunction:
        Type: AWS::Serverless::Function
        Properties:
          CodeUri: hello_world/
          Handler: app.lambda_handler
          Environment:
            Variables:
              TEST_PARAMETER: !Ref TestParameter
          AutoPublishAlias: live
          AutoPublishAliasAllProperties: true
          Runtime: python3.12
          Architectures:
            - x86_64
    

    Also, since resolve_s3 did not work, I had to set no_resolve_s3 = true and specify my s3_bucket and s3_prefix.
    2.
    First deploy

    sam deploy --debug --parameter-overrides TestParameter='1'
    2026-07-25 11:50:39,925 | Config file location: <...>/samconfig.toml
    2026-07-25 11:50:39,926 | Loading configuration values from [default.['deploy'].parameters] (env.command_name.section) in config file at
    '<...>/samconfig.toml'...
    2026-07-25 11:50:39,926 | Configuration values successfully loaded.
    2026-07-25 11:50:39,926 | Configuration values are: {'stack_name': 'sam-app', 'region': 'eu-central-1', 'capabilities': 'CAPABILITY_IAM', 'confirm_changeset': True,
    'no_resolve_s3': True, 's3_bucket': '<bucket>', 's3_prefix': '<...>/SAMTest', 'image_repositories': []}
    2026-07-25 11:50:39,927 | Using SAM Template at <...>/template.yaml
    2026-07-25 11:50:39,928 | Input parameters: ('TestParameter=1',)
    2026-07-25 11:50:39,928 | Flattened parameters: ['TestParameter=1']
    2026-07-25 11:50:39,928 | Converted 1 parameters: {'TestParameter': '1'}
    2026-07-25 11:50:39,941 | Using config file: samconfig.toml, config environment: default
    2026-07-25 11:50:39,941 | Expand command line arguments to:
    2026-07-25 11:50:39,941 | --template_file=<...>/template.yaml --parameter_overrides={'TestParameter': '1'}
    --fail_on_empty_changeset --confirm_changeset --on_failure=ROLLBACK --max_wait_duration=60 --stack_name=sam-app --s3_bucket=<bucket>
    --s3_prefix=<...>/SAMTest --capabilities=['CAPABILITY_IAM']
    2026-07-25 11:50:40,031 | Collected default values for parameters: {}
    2026-07-25 11:50:40,051 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource logical id as the resource
    id
    2026-07-25 11:50:40,051 | 0 stacks found in the template
    2026-07-25 11:50:40,052 | Collected default values for parameters: {}
    2026-07-25 11:50:40,057 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource logical id as the resource
    id
    2026-07-25 11:50:40,105 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource logical id as the resource
    id
    2026-07-25 11:50:40,106 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is HelloWorldFunction
    	Uploading to <...>/SAMTest/<...>  847 / 847  (100.00%)
    
    	Deploying with following values
    	===============================
    	Stack name                   : sam-app
    	Region                       : eu-central-1
    	Confirm changeset            : True
    	Disable rollback             : False
    	Deployment s3 bucket         : <bucket>
    	Capabilities                 : ["CAPABILITY_IAM"]
    	Parameter overrides          : {"TestParameter": "1"}
    	Signing Profiles             : {}
    
    Initiating deployment
    =====================
    
    2026-07-25 11:50:40,889 | Collected default values for parameters: {}
    2026-07-25 11:50:40,899 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is HelloWorldFunction
    2026-07-25 11:50:40,900 | 0 stacks found in the template
    2026-07-25 11:50:40,900 | Collected default values for parameters: {}
    2026-07-25 11:50:40,909 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is HelloWorldFunction
    2026-07-25 11:50:40,909 | 1 resources found in the stack
    2026-07-25 11:50:41,537 | Stack with id sam-app does not exist
    	Uploading to <...>/SAMTest/<...>.template  633 / 633  (100.00%)
    
    
    Waiting for changeset to be created..
    
    CloudFormation stack changeset
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------
    Operation                                LogicalResourceId                        ResourceType                             Replacement
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------
    + Add                                    HelloWorldFunctionAliaslive              AWS::Lambda::Alias                       N/A
    + Add                                    HelloWorldFunctionRole                   AWS::IAM::Role                           N/A
    + Add                                    HelloWorldFunctionVersione41476af85      AWS::Lambda::Version                     N/A
    + Add                                    HelloWorldFunction                       AWS::Lambda::Function                    N/A
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    Changeset created successfully. arn:aws:cloudformation:eu-central-1:<account>:changeSet/samcli-deploy<number>/<hash>
    
    
    Previewing CloudFormation changeset before deployment
    ======================================================
    Deploy this changeset? [y/N]: y
    
    2026-07-25 11:51:01 - Waiting for stack create/update to complete
    
    CloudFormation events from stack operations (refresh every 5.0 seconds)
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------
    ResourceStatus                           ResourceType                             LogicalResourceId                        ResourceStatusReason
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------
    2026-07-25 11:51:01,476 | Trial # 0 to get the stack sam-app create events
    2026-07-25 11:51:06,624 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunctionRole-CREATE_IN_PROGRESS-2026-07-25T06:51:04.707Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>',
    'LogicalResourceId': 'HelloWorldFunctionRole', 'PhysicalResourceId': 'sam-app-HelloWorldFunctionRole-UwCvqFecgqfS', 'ResourceType': 'AWS::IAM::Role', 'Timestamp':
    datetime.datetime(2026, 7, 25, 6, 51, 4, 707000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceStatusReason': 'Resource creation Initiated',
    'ResourceProperties':
    '{"ManagedPolicyArns":["arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"],"AssumeRolePolicyDocument":{"Version":"2012-10-17","Statement":[{"Action":
    ["sts:AssumeRole"],"Effect":"Allow","Principal":{"Service":["lambda.amazonaws.com"]}}]},"Tags":[{"Value":"SAM","Key":"lambda:createdBy"}]}', 'ClientRequestToken':
    '<ClientRequestToken>'}
    2026-07-25 11:51:06,627 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunctionRole-CREATE_IN_PROGRESS-2026-07-25T06:51:03.466Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>',
    'LogicalResourceId': 'HelloWorldFunctionRole', 'PhysicalResourceId': '', 'ResourceType': 'AWS::IAM::Role', 'Timestamp': datetime.datetime(2026, 7, 25, 6, 51, 3,
    466000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceProperties':
    '{"ManagedPolicyArns":["arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"],"AssumeRolePolicyDocument":{"Version":"2012-10-17","Statement":[{"Action":
    ["sts:AssumeRole"],"Effect":"Allow","Principal":{"Service":["lambda.amazonaws.com"]}}]},"Tags":[{"Value":"SAM","Key":"lambda:createdBy"}]}', 'ClientRequestToken':
    '<ClientRequestToken>'}
    2026-07-25 11:51:06,629 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    '<EventId>', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId': 'sam-app',
    'PhysicalResourceId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'ResourceType':
    'AWS::CloudFormation::Stack', 'Timestamp': datetime.datetime(2026, 7, 25, 6, 51, 1, 545000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS',
    'ResourceStatusReason': 'User Initiated', 'ClientRequestToken': '<ClientRequestToken>'}
    2026-07-25 11:51:06,630 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    '277c7080-87f5-11f1-a14a-0292f0a9151f', 'StackName': 'sam-app', 'LogicalResourceId': 'sam-app', 'PhysicalResourceId':
    'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'ResourceType': 'AWS::CloudFormation::Stack', 'Timestamp':
    datetime.datetime(2026, 7, 25, 6, 50, 42, 522000, tzinfo=tzutc()), 'ResourceStatus': 'REVIEW_IN_PROGRESS', 'ResourceStatusReason': 'User Initiated'}
    2026-07-25 11:51:06,632 | Skip previous event as time_stamp_marker: 2026-07-25 06:50:42.522000+00:00 is after the event time stamp: 2026-07-25 06:50:42.522000+00:00
    2026-07-25 11:51:06,633 | Exit from the describe event loop
    CREATE_IN_PROGRESS                       AWS::CloudFormation::Stack               sam-app                                  User Initiated
    CREATE_IN_PROGRESS                       AWS::IAM::Role                           HelloWorldFunctionRole                   -
    CREATE_IN_PROGRESS                       AWS::IAM::Role                           HelloWorldFunctionRole                   Resource creation Initiated
    2026-07-25 11:51:06,634 | Trial # 0 to get the stack sam-app create events
    2026-07-25 11:51:11,779 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunctionRole-CREATE_IN_PROGRESS-2026-07-25T06:51:04.707Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>',
    'LogicalResourceId': 'HelloWorldFunctionRole', 'PhysicalResourceId': 'sam-app-HelloWorldFunctionRole-UwCvqFecgqfS', 'ResourceType': 'AWS::IAM::Role', 'Timestamp':
    datetime.datetime(2026, 7, 25, 6, 51, 4, 707000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceStatusReason': 'Resource creation Initiated',
    'ResourceProperties':
    '{"ManagedPolicyArns":["arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"],"AssumeRolePolicyDocument":{"Version":"2012-10-17","Statement":[{"Action":
    ["sts:AssumeRole"],"Effect":"Allow","Principal":{"Service":["lambda.amazonaws.com"]}}]},"Tags":[{"Value":"SAM","Key":"lambda:createdBy"}]}', 'ClientRequestToken':
    '<ClientRequestToken>'}
    2026-07-25 11:51:11,782 | Skip previous event as time_stamp_marker: 2026-07-25 06:51:04.707000+00:00 is after the event time stamp: 2026-07-25 06:51:04.707000+00:00
    2026-07-25 11:51:11,783 | Exit from the describe event loop
    2026-07-25 11:51:11,784 | Trial # 0 to get the stack sam-app create events
    2026-07-25 11:51:16,934 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunctionRole-CREATE_IN_PROGRESS-2026-07-25T06:51:04.707Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>',
    'LogicalResourceId': 'HelloWorldFunctionRole', 'PhysicalResourceId': 'sam-app-HelloWorldFunctionRole-UwCvqFecgqfS', 'ResourceType': 'AWS::IAM::Role', 'Timestamp':
    datetime.datetime(2026, 7, 25, 6, 51, 4, 707000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceStatusReason': 'Resource creation Initiated',
    'ResourceProperties':
    '{"ManagedPolicyArns":["arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"],"AssumeRolePolicyDocument":{"Version":"2012-10-17","Statement":[{"Action":
    ["sts:AssumeRole"],"Effect":"Allow","Principal":{"Service":["lambda.amazonaws.com"]}}]},"Tags":[{"Value":"SAM","Key":"lambda:createdBy"}]}', 'ClientRequestToken':
    '<ClientRequestToken>'}
    2026-07-25 11:51:16,939 | Skip previous event as time_stamp_marker: 2026-07-25 06:51:04.707000+00:00 is after the event time stamp: 2026-07-25 06:51:04.707000+00:00
    2026-07-25 11:51:16,941 | Exit from the describe event loop
    2026-07-25 11:51:16,943 | Trial # 0 to get the stack sam-app create events
    2026-07-25 11:51:22,087 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunction-CREATE_IN_PROGRESS-2026-07-25T06:51:21.567Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId':
    'HelloWorldFunction', 'PhysicalResourceId': '', 'ResourceType': 'AWS::Lambda::Function', 'Timestamp': datetime.datetime(2026, 7, 25, 6, 51, 21, 567000,
    tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceProperties':
    '{"Role":"arn:aws:iam::<account>:role/sam-app-HelloWorldFunctionRole-UwCvqFecgqfS","Runtime":"python3.12","Handler":"app.lambda_handler","Environment":{"Variables
    ":{"TEST_PARAMETER":"1"}},"Code":{"S3Bucket":"<bucket>","S3Key":"<...>/SAMTest/<...>"},"Tags":[{"Value":"
    SAM","Key":"lambda:createdBy"}],"Architectures":["x86_64"]}', 'ClientRequestToken': '<ClientRequestToken>'}
    2026-07-25 11:51:22,093 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunctionRole-CREATE_COMPLETE-2026-07-25T06:51:20.710Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>',
    'LogicalResourceId': 'HelloWorldFunctionRole', 'PhysicalResourceId': 'sam-app-HelloWorldFunctionRole-UwCvqFecgqfS', 'ResourceType': 'AWS::IAM::Role', 'Timestamp':
    datetime.datetime(2026, 7, 25, 6, 51, 20, 710000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_COMPLETE', 'ResourceProperties':
    '{"ManagedPolicyArns":["arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"],"AssumeRolePolicyDocument":{"Version":"2012-10-17","Statement":[{"Action":
    ["sts:AssumeRole"],"Effect":"Allow","Principal":{"Service":["lambda.amazonaws.com"]}}]},"Tags":[{"Value":"SAM","Key":"lambda:createdBy"}]}', 'ClientRequestToken':
    '<ClientRequestToken>'}
    2026-07-25 11:51:22,097 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunctionRole-CREATE_IN_PROGRESS-2026-07-25T06:51:04.707Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>',
    'LogicalResourceId': 'HelloWorldFunctionRole', 'PhysicalResourceId': 'sam-app-HelloWorldFunctionRole-UwCvqFecgqfS', 'ResourceType': 'AWS::IAM::Role', 'Timestamp':
    datetime.datetime(2026, 7, 25, 6, 51, 4, 707000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceStatusReason': 'Resource creation Initiated',
    'ResourceProperties':
    '{"ManagedPolicyArns":["arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"],"AssumeRolePolicyDocument":{"Version":"2012-10-17","Statement":[{"Action":
    ["sts:AssumeRole"],"Effect":"Allow","Principal":{"Service":["lambda.amazonaws.com"]}}]},"Tags":[{"Value":"SAM","Key":"lambda:createdBy"}]}', 'ClientRequestToken':
    '<ClientRequestToken>'}
    2026-07-25 11:51:22,101 | Skip previous event as time_stamp_marker: 2026-07-25 06:51:04.707000+00:00 is after the event time stamp: 2026-07-25 06:51:04.707000+00:00
    2026-07-25 11:51:22,102 | Exit from the describe event loop
    CREATE_COMPLETE                          AWS::IAM::Role                           HelloWorldFunctionRole                   -
    CREATE_IN_PROGRESS                       AWS::Lambda::Function                    HelloWorldFunction                       -
    2026-07-25 11:51:22,103 | Trial # 0 to get the stack sam-app create events
    2026-07-25 11:51:27,258 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunction-e61cb26b-ff7e-4587-b235-bb57bc23b68b', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId':
    'HelloWorldFunction', 'PhysicalResourceId': 'sam-app-HelloWorldFunction-Do3E1yhwlX3G', 'ResourceType': 'AWS::Lambda::Function', 'Timestamp': datetime.datetime(2026,
    7, 25, 6, 51, 23, 816000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceStatusReason': 'Eventual consistency check initiated',
    'ClientRequestToken': '<ClientRequestToken>', 'DetailedStatus': 'CONFIGURATION_COMPLETE'}
    2026-07-25 11:51:27,261 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunction-CREATE_IN_PROGRESS-2026-07-25T06:51:23.071Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId':
    'HelloWorldFunction', 'PhysicalResourceId': 'sam-app-HelloWorldFunction-Do3E1yhwlX3G', 'ResourceType': 'AWS::Lambda::Function', 'Timestamp': datetime.datetime(2026,
    7, 25, 6, 51, 23, 71000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceStatusReason': 'Resource creation Initiated', 'ResourceProperties':
    '{"Role":"arn:aws:iam::<account>:role/sam-app-HelloWorldFunctionRole-UwCvqFecgqfS","Runtime":"python3.12","Handler":"app.lambda_handler","Environment":{"Variables
    ":{"TEST_PARAMETER":"1"}},"Code":{"S3Bucket":"<bucket>","S3Key":"<...>/SAMTest/<...>"},"Tags":[{"Value":"
    SAM","Key":"lambda:createdBy"}],"Architectures":["x86_64"]}', 'ClientRequestToken': '<ClientRequestToken>'}
    2026-07-25 11:51:27,264 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunction-CREATE_IN_PROGRESS-2026-07-25T06:51:21.567Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId':
    'HelloWorldFunction', 'PhysicalResourceId': '', 'ResourceType': 'AWS::Lambda::Function', 'Timestamp': datetime.datetime(2026, 7, 25, 6, 51, 21, 567000,
    tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceProperties':
    '{"Role":"arn:aws:iam::<account>:role/sam-app-HelloWorldFunctionRole-UwCvqFecgqfS","Runtime":"python3.12","Handler":"app.lambda_handler","Environment":{"Variables
    ":{"TEST_PARAMETER":"1"}},"Code":{"S3Bucket":"<bucket>","S3Key":"<...>/SAMTest/<...>"},"Tags":[{"Value":"
    SAM","Key":"lambda:createdBy"}],"Architectures":["x86_64"]}', 'ClientRequestToken': '<ClientRequestToken>'}
    2026-07-25 11:51:27,267 | Skip previous event as time_stamp_marker: 2026-07-25 06:51:21.567000+00:00 is after the event time stamp: 2026-07-25 06:51:21.567000+00:00
    2026-07-25 11:51:27,268 | Exit from the describe event loop
    CREATE_IN_PROGRESS                       AWS::Lambda::Function                    HelloWorldFunction                       Resource creation Initiated
    CREATE_IN_PROGRESS -                     AWS::Lambda::Function                    HelloWorldFunction                       Eventual consistency check initiated
    CONFIGURATION_COMPLETE
    2026-07-25 11:51:27,269 | Trial # 0 to get the stack sam-app create events
    2026-07-25 11:51:32,517 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunctionAliaslive-CREATE_COMPLETE-2026-07-25T06:51:32.205Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>',
    'LogicalResourceId': 'HelloWorldFunctionAliaslive', 'PhysicalResourceId':
    'arn:aws:lambda:eu-central-1:<account>:function:sam-app-HelloWorldFunction-Do3E1yhwlX3G:live', 'ResourceType': 'AWS::Lambda::Alias', 'Timestamp':
    datetime.datetime(2026, 7, 25, 6, 51, 32, 205000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_COMPLETE', 'ResourceProperties':
    '{"FunctionName":"sam-app-HelloWorldFunction-Do3E1yhwlX3G","FunctionVersion":"1","Name":"live"}', 'ClientRequestToken': '<ClientRequestToken>'}
    2026-07-25 11:51:32,519 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunctionAliaslive-CREATE_IN_PROGRESS-2026-07-25T06:51:31.938Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>',
    'LogicalResourceId': 'HelloWorldFunctionAliaslive', 'PhysicalResourceId':
    'arn:aws:lambda:eu-central-1:<account>:function:sam-app-HelloWorldFunction-Do3E1yhwlX3G:live', 'ResourceType': 'AWS::Lambda::Alias', 'Timestamp':
    datetime.datetime(2026, 7, 25, 6, 51, 31, 938000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceStatusReason': 'Resource creation Initiated',
    'ResourceProperties': '{"FunctionName":"sam-app-HelloWorldFunction-Do3E1yhwlX3G","FunctionVersion":"1","Name":"live"}', 'ClientRequestToken':
    '<ClientRequestToken>'}
    2026-07-25 11:51:32,520 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunctionAliaslive-CREATE_IN_PROGRESS-2026-07-25T06:51:31.108Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>',
    'LogicalResourceId': 'HelloWorldFunctionAliaslive', 'PhysicalResourceId': '', 'ResourceType': 'AWS::Lambda::Alias', 'Timestamp': datetime.datetime(2026, 7, 25, 6,
    51, 31, 108000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceProperties':
    '{"FunctionName":"sam-app-HelloWorldFunction-Do3E1yhwlX3G","FunctionVersion":"1","Name":"live"}', 'ClientRequestToken': '<ClientRequestToken>'}
    2026-07-25 11:51:32,521 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunctionVersione41476af85-CREATE_COMPLETE-2026-07-25T06:51:30.405Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>',
    'LogicalResourceId': 'HelloWorldFunctionVersione41476af85', 'PhysicalResourceId':
    'arn:aws:lambda:eu-central-1:<account>:function:sam-app-HelloWorldFunction-Do3E1yhwlX3G:1', 'ResourceType': 'AWS::Lambda::Version', 'Timestamp':
    datetime.datetime(2026, 7, 25, 6, 51, 30, 405000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_COMPLETE', 'ResourceProperties':
    '{"FunctionName":"sam-app-HelloWorldFunction-Do3E1yhwlX3G"}', 'ClientRequestToken': '<ClientRequestToken>'}
    2026-07-25 11:51:32,523 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunctionVersione41476af85-CREATE_IN_PROGRESS-2026-07-25T06:51:30.121Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>',
    'LogicalResourceId': 'HelloWorldFunctionVersione41476af85', 'PhysicalResourceId':
    'arn:aws:lambda:eu-central-1:<account>:function:sam-app-HelloWorldFunction-Do3E1yhwlX3G:1', 'ResourceType': 'AWS::Lambda::Version', 'Timestamp':
    datetime.datetime(2026, 7, 25, 6, 51, 30, 121000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceStatusReason': 'Resource creation Initiated',
    'ResourceProperties': '{"FunctionName":"sam-app-HelloWorldFunction-Do3E1yhwlX3G"}', 'ClientRequestToken': '<ClientRequestToken>'}
    2026-07-25 11:51:32,524 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunctionVersione41476af85-CREATE_IN_PROGRESS-2026-07-25T06:51:28.997Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>',
    'LogicalResourceId': 'HelloWorldFunctionVersione41476af85', 'PhysicalResourceId': '', 'ResourceType': 'AWS::Lambda::Version', 'Timestamp': datetime.datetime(2026, 7,
    25, 6, 51, 28, 997000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceProperties': '{"FunctionName":"sam-app-HelloWorldFunction-Do3E1yhwlX3G"}',
    'ClientRequestToken': '<ClientRequestToken>'}
    2026-07-25 11:51:32,525 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunction-CREATE_COMPLETE-2026-07-25T06:51:28.676Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId':
    'HelloWorldFunction', 'PhysicalResourceId': 'sam-app-HelloWorldFunction-Do3E1yhwlX3G', 'ResourceType': 'AWS::Lambda::Function', 'Timestamp': datetime.datetime(2026,
    7, 25, 6, 51, 28, 676000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_COMPLETE', 'ResourceProperties':
    '{"Role":"arn:aws:iam::<account>:role/sam-app-HelloWorldFunctionRole-UwCvqFecgqfS","Runtime":"python3.12","Handler":"app.lambda_handler","Environment":{"Variables
    ":{"TEST_PARAMETER":"1"}},"Code":{"S3Bucket":"<bucket>","S3Key":"<...>/SAMTest/<...>"},"Tags":[{"Value":"
    SAM","Key":"lambda:createdBy"}],"Architectures":["x86_64"]}', 'ClientRequestToken': '<ClientRequestToken>'}
    2026-07-25 11:51:32,526 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunction-e61cb26b-ff7e-4587-b235-bb57bc23b68b', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId':
    'HelloWorldFunction', 'PhysicalResourceId': 'sam-app-HelloWorldFunction-Do3E1yhwlX3G', 'ResourceType': 'AWS::Lambda::Function', 'Timestamp': datetime.datetime(2026,
    7, 25, 6, 51, 23, 816000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_IN_PROGRESS', 'ResourceStatusReason': 'Eventual consistency check initiated',
    'ClientRequestToken': '<ClientRequestToken>', 'DetailedStatus': 'CONFIGURATION_COMPLETE'}
    2026-07-25 11:51:32,527 | Skip previous event as time_stamp_marker: 2026-07-25 06:51:23.816000+00:00 is after the event time stamp: 2026-07-25 06:51:23.816000+00:00
    2026-07-25 11:51:32,528 | Exit from the describe event loop
    CREATE_COMPLETE                          AWS::Lambda::Function                    HelloWorldFunction                       -
    CREATE_IN_PROGRESS                       AWS::Lambda::Version                     HelloWorldFunctionVersione41476af85      -
    CREATE_IN_PROGRESS                       AWS::Lambda::Version                     HelloWorldFunctionVersione41476af85      Resource creation Initiated
    CREATE_COMPLETE                          AWS::Lambda::Version                     HelloWorldFunctionVersione41476af85      -
    CREATE_IN_PROGRESS                       AWS::Lambda::Alias                       HelloWorldFunctionAliaslive              -
    CREATE_IN_PROGRESS                       AWS::Lambda::Alias                       HelloWorldFunctionAliaslive              Resource creation Initiated
    CREATE_COMPLETE                          AWS::Lambda::Alias                       HelloWorldFunctionAliaslive              -
    2026-07-25 11:51:32,528 | Trial # 0 to get the stack sam-app create events
    2026-07-25 11:51:37,798 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    '<EventId>', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId': 'sam-app',
    'PhysicalResourceId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'ResourceType':
    'AWS::CloudFormation::Stack', 'Timestamp': datetime.datetime(2026, 7, 25, 6, 51, 32, 743000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_COMPLETE',
    'ClientRequestToken': '<ClientRequestToken>'}
    2026-07-25 11:51:37,802 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId':
    'HelloWorldFunctionAliaslive-CREATE_COMPLETE-2026-07-25T06:51:32.205Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>',
    'LogicalResourceId': 'HelloWorldFunctionAliaslive', 'PhysicalResourceId':
    'arn:aws:lambda:eu-central-1:<account>:function:sam-app-HelloWorldFunction-Do3E1yhwlX3G:live', 'ResourceType': 'AWS::Lambda::Alias', 'Timestamp':
    datetime.datetime(2026, 7, 25, 6, 51, 32, 205000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_COMPLETE', 'ResourceProperties':
    '{"FunctionName":"sam-app-HelloWorldFunction-Do3E1yhwlX3G","FunctionVersion":"1","Name":"live"}', 'ClientRequestToken': '<ClientRequestToken>'}
    2026-07-25 11:51:37,805 | Skip previous event as time_stamp_marker: 2026-07-25 06:51:32.205000+00:00 is after the event time stamp: 2026-07-25 06:51:32.205000+00:00
    2026-07-25 11:51:37,807 | Exit from the describe event loop
    CREATE_COMPLETE                          AWS::CloudFormation::Stack               sam-app                                  -
    2026-07-25 11:51:37,807 | Stack sam-app is not in progress. Its status is CREATE_COMPLETE, and event is {'StackId':
    'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'EventId': '<EventId>',
    'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId': 'sam-app', 'PhysicalResourceId':
    'arn:aws:cloudformation:eu-central-1:<account>:stack/sam-app/<sam-app-hash>', 'ResourceType': 'AWS::CloudFormation::Stack', 'Timestamp':
    datetime.datetime(2026, 7, 25, 6, 51, 32, 743000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_COMPLETE', 'ClientRequestToken': '<ClientRequestToken>'}
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    Successfully created/updated stack - sam-app in eu-central-1
    
    2026-07-25 11:51:38,086 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
    2026-07-25 11:51:38,175 | No container socket path in global storage, falling back to DOCKER_HOST detection:
    2026-07-25 11:51:38,176 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
    2026-07-25 11:51:38,177 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '<RequestId>', 'installationId':
    '<InstallationId>', 'sessionId': '<SessionId>', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.11.10',
    'samcliVersion': '1.153.1', 'osPlatform': 'Darwin', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': 'eu-central-1', 'commandName': 'sam deploy',
    'metricSpecificAttributes': {'projectType': 'CFN', 'gitOrigin': None, 'projectName': '<projectName>',
    'initialCommit': None, 'containerEngine': 'docker-default', 'adminContainerPreference': None}, 'duration': 58146, 'exitReason': 'success', 'exitCode': 0}}]}
    2026-07-25 11:51:38,177 | Unable to find Click Context for getting session_id.
    2026-07-25 11:51:38,179 | No container socket path in global storage, falling back to DOCKER_HOST detection:
    2026-07-25 11:51:38,180 | Sending Telemetry: {'metrics': [{'events': {'requestId': '<RequestId>', 'installationId':
    '<InstallationId>', 'sessionId': '<SessionId>', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.11.10',
    'samcliVersion': '1.153.1', 'osPlatform': 'Darwin', 'commandName': 'sam deploy', 'metricSpecificAttributes': {'events': [{'event_name': 'SamConfigFileExtension',
    'event_value': '.toml', 'thread_id': '<ThreadId>', 'time_stamp': '2026-07-25 06:50:39.924924+00', 'exception_name': None}, {'event_name':
    'SamConfigFileExtension', 'event_value': '.toml', 'thread_id': '<ThreadId>', 'time_stamp': '2026-07-25 06:50:39.940630+00', 'exception_name':
    None}], 'containerEngine': 'docker-default'}}}]}
    2026-07-25 11:51:38,867 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
    2026-07-25 11:51:38,895 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1) 
    

    Second deploy

    sam deploy --debug --parameter-overrides TestParameter='2'
    2026-07-25 11:53:37,138 | Config file location: <...>/samconfig.toml                                              
    2026-07-25 11:53:37,139 | Loading configuration values from [default.['deploy'].parameters] (env.command_name.section) in config file at                             
    '<...>/samconfig.toml'...                                                                                         
    2026-07-25 11:53:37,140 | Configuration values successfully loaded.                                                                                                  
    2026-07-25 11:53:37,140 | Configuration values are: {'stack_name': 'sam-app', 'region': 'eu-central-1', 'capabilities': 'CAPABILITY_IAM', 'confirm_changeset': True, 
    'no_resolve_s3': True, 's3_bucket': '<bucket>', 's3_prefix': '<...>/SAMTest', 'image_repositories': []}                             
    2026-07-25 11:53:37,141 | Using SAM Template at <...>/template.yaml                                               
    2026-07-25 11:53:37,141 | Input parameters: ('TestParameter=2',)                                                                                                     
    2026-07-25 11:53:37,142 | Flattened parameters: ['TestParameter=2']                                                                                                  
    2026-07-25 11:53:37,142 | Converted 1 parameters: {'TestParameter': '2'}                                                                                             
    2026-07-25 11:53:37,155 | Using config file: samconfig.toml, config environment: default                                                                             
    2026-07-25 11:53:37,155 | Expand command line arguments to:                                                                                                          
    2026-07-25 11:53:37,155 | --template_file=<...>/template.yaml --parameter_overrides={'TestParameter': '2'}        
    --fail_on_empty_changeset --confirm_changeset --on_failure=ROLLBACK --max_wait_duration=60 --stack_name=sam-app --s3_bucket=<bucket>                        
    --s3_prefix=<...>/SAMTest --capabilities=['CAPABILITY_IAM']                                                                                  
    2026-07-25 11:53:37,244 | Collected default values for parameters: {}                                                                                                
    2026-07-25 11:53:37,265 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource logical id as the resource
    id                                                                                                                                                                   
    2026-07-25 11:53:37,266 | 0 stacks found in the template                                                                                                             
    2026-07-25 11:53:37,266 | Collected default values for parameters: {}                                                                                                
    2026-07-25 11:53:37,271 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource logical id as the resource
    id                                                                                                                                                                   
    2026-07-25 11:53:37,317 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource logical id as the resource
    id                                                                                                                                                                   
    2026-07-25 11:53:37,317 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is HelloWorldFunction         
    2026-07-25 11:53:37,673 |                                                                                                                                            
            File with same data already exists at <...>/SAMTest/<...>, skipping upload                                
    
    	Deploying with following values
    	===============================
    	Stack name                   : sam-app
    	Region                       : eu-central-1
    	Confirm changeset            : True
    	Disable rollback             : False
    	Deployment s3 bucket         : <bucket>
    	Capabilities                 : ["CAPABILITY_IAM"]
    	Parameter overrides          : {"TestParameter": "2"}
    	Signing Profiles             : {}
    
    Initiating deployment
    =====================
    
    2026-07-25 11:53:37,697 | Collected default values for parameters: {}                                                                                                
    2026-07-25 11:53:37,708 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is HelloWorldFunction         
    2026-07-25 11:53:37,709 | 0 stacks found in the template                                                                                                             
    2026-07-25 11:53:37,709 | Collected default values for parameters: {}                                                                                                
    2026-07-25 11:53:37,718 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is HelloWorldFunction         
    2026-07-25 11:53:37,718 | 1 resources found in the stack                                                                                                             
    2026-07-25 11:53:38,748 |                                                                                                                                            
            File with same data already exists at <...>/SAMTest/e9f99dd2ea36630fb57e31d8f53aa5cd.template, skipping upload                       
    
    
    Waiting for changeset to be created..
    
    CloudFormation stack changeset
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------
    Operation                                LogicalResourceId                        ResourceType                             Replacement                            
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------
    * Modify                                 HelloWorldFunction                       AWS::Lambda::Function                    False                                  
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    Changeset created successfully. arn:aws:cloudformation:eu-central-1:<...>:changeSet/samcli-deploy<number>/<hash>
    
    
    Previewing CloudFormation changeset before deployment
    ======================================================
    Deploy this changeset? [y/N]: y
    
    2026-07-25 11:54:00 - Waiting for stack create/update to complete
    
    CloudFormation events from stack operations (refresh every 5.0 seconds)
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------
    ResourceStatus                           ResourceType                             LogicalResourceId                        ResourceStatusReason                   
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------
    2026-07-25 11:54:00,673 | Trial # 0 to get the stack sam-app create events                                                                                           
    2026-07-25 11:54:05,928 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'EventId': 
    'HelloWorldFunction-UPDATE_IN_PROGRESS-2026-07-25T06:54:03.749Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId':
    'HelloWorldFunction', 'PhysicalResourceId': 'sam-app-HelloWorldFunction-Do3E1yhwlX3G', 'ResourceType': 'AWS::Lambda::Function', 'Timestamp': datetime.datetime(2026, 
    7, 25, 6, 54, 3, 749000, tzinfo=tzutc()), 'ResourceStatus': 'UPDATE_IN_PROGRESS', 'ResourceProperties':                                                              
    '{"Role":"arn:aws:iam::<...>:role/sam-app-HelloWorldFunctionRole-UwCvqFecgqfS","Runtime":"python3.12","Handler":"app.lambda_handler","Environment":{"Variables
    ":{"TEST_PARAMETER":"2"}},"Code":{"S3Bucket":"<bucket>","S3Key":"<...>/SAMTest/<...>"},"Tags":[{"Value":"
    SAM","Key":"lambda:createdBy"}],"Architectures":["x86_64"]}', 'ClientRequestToken': '<ClientRequestToken>'}                                          
    2026-07-25 11:54:05,932 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'EventId': 
    '9da21b20-87f5-11f1-9bba-026e347bdaa3', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId': 'sam-app',               
    'PhysicalResourceId': 'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'ResourceType':                         
    'AWS::CloudFormation::Stack', 'Timestamp': datetime.datetime(2026, 7, 25, 6, 54, 0, 641000, tzinfo=tzutc()), 'ResourceStatus': 'UPDATE_IN_PROGRESS',                 
    'ResourceStatusReason': 'User Initiated', 'ClientRequestToken': '<ClientRequestToken>'}                                                              
    2026-07-25 11:54:05,933 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'EventId': 
    '457b1eb0-87f5-11f1-a802-0268d08c02a5', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId': 'sam-app',
    'PhysicalResourceId': 'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'ResourceType':                         
    'AWS::CloudFormation::Stack', 'Timestamp': datetime.datetime(2026, 7, 25, 6, 51, 32, 743000, tzinfo=tzutc()), 'ResourceStatus': 'CREATE_COMPLETE',                   
    'ClientRequestToken': '<ClientRequestToken>'}
    2026-07-25 11:54:05,934 | Skip previous event as time_stamp_marker: 2026-07-25 06:51:32.743000+00:00 is after the event time stamp: 2026-07-25 06:51:32.743000+00:00 
    2026-07-25 11:54:05,934 | Exit from the describe event loop                                                                                                          
    UPDATE_IN_PROGRESS                       AWS::CloudFormation::Stack               sam-app                                  User Initiated                         
    UPDATE_IN_PROGRESS                       AWS::Lambda::Function                    HelloWorldFunction                       -                                      
    2026-07-25 11:54:05,934 | Trial # 0 to get the stack sam-app create events                                                                                           
    2026-07-25 11:54:11,183 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'EventId': 
    'HelloWorldFunction-UPDATE_COMPLETE-2026-07-25T06:54:10.155Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId':   
    'HelloWorldFunction', 'PhysicalResourceId': 'sam-app-HelloWorldFunction-Do3E1yhwlX3G', 'ResourceType': 'AWS::Lambda::Function', 'Timestamp': datetime.datetime(2026, 
    7, 25, 6, 54, 10, 155000, tzinfo=tzutc()), 'ResourceStatus': 'UPDATE_COMPLETE', 'ResourceProperties':                                                                
    '{"Role":"arn:aws:iam::<...>:role/sam-app-HelloWorldFunctionRole-UwCvqFecgqfS","Runtime":"python3.12","Handler":"app.lambda_handler","Environment":{"Variables
    ":{"TEST_PARAMETER":"2"}},"Code":{"S3Bucket":"<bucket>","S3Key":"<...>/SAMTest/<...>"},"Tags":[{"Value":"
    SAM","Key":"lambda:createdBy"}],"Architectures":["x86_64"]}', 'ClientRequestToken': '<ClientRequestToken>'}                                          
    2026-07-25 11:54:11,188 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'EventId': 
    'HelloWorldFunction-UPDATE_IN_PROGRESS-2026-07-25T06:54:03.749Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId':
    'HelloWorldFunction', 'PhysicalResourceId': 'sam-app-HelloWorldFunction-Do3E1yhwlX3G', 'ResourceType': 'AWS::Lambda::Function', 'Timestamp': datetime.datetime(2026, 
    7, 25, 6, 54, 3, 749000, tzinfo=tzutc()), 'ResourceStatus': 'UPDATE_IN_PROGRESS', 'ResourceProperties':                                                              
    '{"Role":"arn:aws:iam::<...>:role/sam-app-HelloWorldFunctionRole-UwCvqFecgqfS","Runtime":"python3.12","Handler":"app.lambda_handler","Environment":{"Variables
    ":{"TEST_PARAMETER":"2"}},"Code":{"S3Bucket":"<bucket>","S3Key":"<...>/SAMTest/<...>"},"Tags":[{"Value":"
    SAM","Key":"lambda:createdBy"}],"Architectures":["x86_64"]}', 'ClientRequestToken': '<ClientRequestToken>'}                                          
    2026-07-25 11:54:11,193 | Skip previous event as time_stamp_marker: 2026-07-25 06:54:03.749000+00:00 is after the event time stamp: 2026-07-25 06:54:03.749000+00:00 
    2026-07-25 11:54:11,194 | Exit from the describe event loop                                                                                                          
    UPDATE_COMPLETE                          AWS::Lambda::Function                    HelloWorldFunction                       -                                      
    2026-07-25 11:54:11,195 | Trial # 0 to get the stack sam-app create events                                                                                           
    2026-07-25 11:54:16,438 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'EventId': 
    'a4c0ebc0-87f5-11f1-8c52-0ab5697a391b', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId': 'sam-app',               
    'PhysicalResourceId': 'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'ResourceType':                         
    'AWS::CloudFormation::Stack', 'Timestamp': datetime.datetime(2026, 7, 25, 6, 54, 12, 585000, tzinfo=tzutc()), 'ResourceStatus': 'UPDATE_COMPLETE',                   
    'ClientRequestToken': '<ClientRequestToken>'}                                                                                                        
    2026-07-25 11:54:16,441 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'EventId': 
    'a4569130-87f5-11f1-8884-0286dc2a7dbd', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId': 'sam-app',               
    'PhysicalResourceId': 'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'ResourceType':                         
    'AWS::CloudFormation::Stack', 'Timestamp': datetime.datetime(2026, 7, 25, 6, 54, 11, 902000, tzinfo=tzutc()), 'ResourceStatus':                                      
    'UPDATE_COMPLETE_CLEANUP_IN_PROGRESS', 'ClientRequestToken': '<ClientRequestToken>'}                                                                 
    2026-07-25 11:54:16,442 | Stack Event: {'StackId': 'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'EventId': 
    'HelloWorldFunction-UPDATE_COMPLETE-2026-07-25T06:54:10.155Z', 'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId':   
    'HelloWorldFunction', 'PhysicalResourceId': 'sam-app-HelloWorldFunction-Do3E1yhwlX3G', 'ResourceType': 'AWS::Lambda::Function', 'Timestamp': datetime.datetime(2026, 
    7, 25, 6, 54, 10, 155000, tzinfo=tzutc()), 'ResourceStatus': 'UPDATE_COMPLETE', 'ResourceProperties':                                                                
    '{"Role":"arn:aws:iam::<...>:role/sam-app-HelloWorldFunctionRole-UwCvqFecgqfS","Runtime":"python3.12","Handler":"app.lambda_handler","Environment":{"Variables
    ":{"TEST_PARAMETER":"2"}},"Code":{"S3Bucket":"<bucket>","S3Key":"<...>/SAMTest/<...>"},"Tags":[{"Value":"
    SAM","Key":"lambda:createdBy"}],"Architectures":["x86_64"]}', 'ClientRequestToken': '<ClientRequestToken>'}                                          
    2026-07-25 11:54:16,444 | Skip previous event as time_stamp_marker: 2026-07-25 06:54:10.155000+00:00 is after the event time stamp: 2026-07-25 06:54:10.155000+00:00 
    2026-07-25 11:54:16,445 | Exit from the describe event loop                                                                                                          
    UPDATE_COMPLETE_CLEANUP_IN_PROGRESS      AWS::CloudFormation::Stack               sam-app                                  -                                      
    UPDATE_COMPLETE                          AWS::CloudFormation::Stack               sam-app                                  -                                      
    2026-07-25 11:54:16,445 | Stack sam-app is not in progress. Its status is UPDATE_COMPLETE, and event is {'StackId':                                                  
    'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'EventId': 'a4c0ebc0-87f5-11f1-8c52-0ab5697a391b',            
    'StackName': 'sam-app', 'OperationId': '<OperationId>', 'LogicalResourceId': 'sam-app', 'PhysicalResourceId':                                 
    'arn:aws:cloudformation:eu-central-1:<...>:stack/sam-app/<sam-app-hash>', 'ResourceType': 'AWS::CloudFormation::Stack', 'Timestamp':    
    datetime.datetime(2026, 7, 25, 6, 54, 12, 585000, tzinfo=tzutc()), 'ResourceStatus': 'UPDATE_COMPLETE', 'ClientRequestToken': '<ClientRequestToken>'}
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    Successfully created/updated stack - sam-app in eu-central-1
    
    2026-07-25 11:54:16,695 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics                                 
    2026-07-25 11:54:16,768 | No container socket path in global storage, falling back to DOCKER_HOST detection:                                                         
    2026-07-25 11:54:16,769 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics                                 
    2026-07-25 11:54:16,770 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '<RequestId>', 'installationId':
    '<InstallationId>', 'sessionId': '<SessionId>', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.11.10',
    'samcliVersion': '1.153.1', 'osPlatform': 'Darwin', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': 'eu-central-1', 'commandName': 'sam deploy',   
    'metricSpecificAttributes': {'projectType': 'CFN', 'gitOrigin': None, 'projectName': '<projectName>',
    'initialCommit': None, 'containerEngine': 'docker-default', 'adminContainerPreference': None}, 'duration': 39540, 'exitReason': 'success', 'exitCode': 0}}]}         
    2026-07-25 11:54:16,770 | Unable to find Click Context for getting session_id.                                                                                       
    2026-07-25 11:54:16,772 | No container socket path in global storage, falling back to DOCKER_HOST detection:                                                         
    2026-07-25 11:54:16,772 | Sending Telemetry: {'metrics': [{'events': {'requestId': '<RequestId>', 'installationId':
    '<InstallationId>', 'sessionId': '<SessionId>', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.11.10',
    'samcliVersion': '1.153.1', 'osPlatform': 'Darwin', 'commandName': 'sam deploy', 'metricSpecificAttributes': {'events': [{'event_name': 'SamConfigFileExtension',    
    'event_value': '.toml', 'thread_id': '<ThreadId>', 'time_stamp': '2026-07-25 06:53:37.138223+00', 'exception_name': None}, {'event_name':
    'SamConfigFileExtension', 'event_value': '.toml', 'thread_id': '<ThreadId>', 'time_stamp': '2026-07-25 06:53:37.154557+00', 'exception_name':
    None}], 'containerEngine': 'docker-default'}}}]}                                                                                                                     
    2026-07-25 11:54:17,533 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)           
    2026-07-25 11:54:17,536 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
    
    sam --version
    SAM CLI, version 1.153.1
    
    pip list | grep aws-sam-translator
    aws-sam-translator                       1.99.0
    
  4. roger-zhangg commented on Jul 31, 2026

    @roger-zhangg
    Member

    Thanks for the detailed repro @daniel-afana — that was exactly what was needed, and I can confirm this is a real bug in the SAM transform.

    Root cause

    LambdaVersion generation in samtranslator/model/sam_resources.py builds the version's logical ID from a hash of the properties that should trigger a new version. The non-AutoPublishAliasAllProperties path resolves template parameter references before hashing, and there's an explicit comment saying why that matters:

    When using intrinsic functions there are two cases when hash must change:

    • Value of the template parameter changes
    • (or) LogicalId of a referenced resource changes
    code_dict = intrinsics_resolver.resolve_parameter_refs(code_dict)

    But when AutoPublishAliasAllProperties: true is set, the hash input is taken straight from the unresolved resource dict instead:

    if self.AutoPublishAliasAllProperties:
        properties = function._generate_resource_dict().get("Properties", {})
        ...
        logical_dict = properties
    else:
        logical_dict = code_dict.copy()   # <-- parameter refs already resolved here

    So with TEST_PARAMETER: !Ref TestParameter, the hashed value is literally {"Ref": "TestParameter"} no matter what you pass to --parameter-overrides. The version logical ID is unchanged, CloudFormation sees no new resource, and no version is published:

    UNRESOLVED !Ref  , param 2 vs 3 -> identical logical id: True   (FnVersion0133d9d8bc)
    RESOLVED values  , param 2 vs 3 -> identical logical id: False  (FnVersion87960cf275 / FnVersion3825031f72)
    

    Your CFN event log lines up with that — "TEST_PARAMETER":"2" updated to "3" on the function itself (AWS::Lambda::Function UPDATE_COMPLETE), but no new AWS::Lambda::Version resource appears.

    Worth noting the property behaves correctly for literal values; it's specifically intrinsics referencing template parameters that don't take effect, which is why this wasn't caught when AutoPublishAliasAllProperties was added (#2838).

    Workaround

    Until this is fixed, AutoPublishAlias without AutoPublishAliasAllProperties does resolve parameter refs, so if the env var is the only property you need to trigger on, dropping AutoPublishAliasAllProperties: true should publish versions as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stage/needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions