Skip to content

Bug: The location parameter is not a valid S3 uri #9027

@danjhd

Description

@danjhd

Description:

In 1.160.0 and 1.1.60.1:
When using AWS::Include with the Fn::Transform function the path to the file is not correctly set when using sam deploy.
The fails to deploy. This is a new bug sice 1.160.0

Steps to reproduce:

Create a new template that uses a snippet like this, also create a file called export-events.json in the same folder as the template

  Parameter:
    Type: AWS::SSM::Parameter
    Properties:
      Type: String
      DataType: text
      Value:
        Fn::ToJsonString:
          Fn::Transform:
            Name: AWS::Include
            Parameters:
              Location: export-events.json

Observed result:

Waiting for changeset to be created..

2026-05-18 18:40:14,077 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2026-05-18 18:40:14,645 | No container socket path in global storage, falling back to DOCKER_HOST detection:
2026-05-18 18:40:14,647 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2026-05-18 18:40:14,648 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': 'd342929b-8650-43f2-bdbd-e9abc3b5b18d', 'installationId': 'f58a317c-44f2-41cb-b6c6-bab84e920a15', 'sessionId':
'df1236c0-d92c-437b-9d08-727104116fc4', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.13.12', 'samcliVersion': '1.160.1', 'osPlatform': 'Windows', 'awsProfileProvided': False, 'debugFlagProvided': True, 
'region': 'eu-west-2', 'commandName': 'sam deploy', 'metricSpecificAttributes': {'projectType': 'CFN', 'gitOrigin': 'b398845365a4018d12e842198ce76bf7364ddf7f9421dafd6aa1cb816b400c3f', 'projectName':
'c30e4251488023561baee9b93d8e6e89e0845010dce7bddb80dcb1d22becc12c', 'initialCommit': 'a87ac7ad8d1009199bbe1f1b1e4bfa0c409753baccc5ef5a26266d8190c8fbf9', 'containerEngine': 'docker-default', 'adminContainerPreference':
None, 'functionFieldsUsed': {'codeuri': 13, 'environment': 11, 'layers': 11, 'events': 8, 'function_url_config': 1}}, 'duration': 41253, 'exitReason': 'ChangeSetError', 'exitCode': 1}}]}
2026-05-18 18:40:14,648 | Unable to find Click Context for getting session_id.
2026-05-18 18:40:14,656 | No container socket path in global storage, falling back to DOCKER_HOST detection:
2026-05-18 18:40:14,657 | Sending Telemetry: {'metrics': [{'events': {'requestId': 'd081ab4b-1a85-41d5-82ed-f5682e58a61b', 'installationId': 'f58a317c-44f2-41cb-b6c6-bab84e920a15', 'sessionId':
'df1236c0-d92c-437b-9d08-727104116fc4', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.13.12', 'samcliVersion': '1.160.1', 'osPlatform': 'Windows', 'commandName': 'sam deploy', 'metricSpecificAttributes':
{'events': [{'event_name': 'SamConfigFileExtension', 'event_value': '.toml', 'thread_id': '7d017f6fb58244b3b6df7f04dec4e1ce', 'time_stamp': '2026-05-18 17:39:32.524397+00', 'exception_name': None}, {'event_name':     
'SamConfigFileExtension', 'event_value': '.toml', 'thread_id': '954fe5d730874b36af2b65de5e1748d4', 'time_stamp': '2026-05-18 17:39:32.753953+00', 'exception_name': None}, {'event_name': 'UsedFeature', 'event_value':  
'CFNLanguageExtensions', 'thread_id': '410c3ee675c04c4bafa90a6b4691075c', 'time_stamp': '2026-05-18 17:39:38.215017+00', 'exception_name': None}, {'event_name': 'UsedFeature', 'event_value': 'CFNLanguageExtensions',  
'thread_id': 'a9811468be0a47a3840bd3188b1a68a0', 'time_stamp': '2026-05-18 17:39:38.920177+00', 'exception_name': None}, {'event_name': 'UsedFeature', 'event_value': 'CFNLanguageExtensions', 'thread_id':
'31b98648e916456584092bbcaac9869c', 'time_stamp': '2026-05-18 17:39:40.285482+00', 'exception_name': None}, {'event_name': 'UsedFeature', 'event_value': 'CFNLanguageExtensions', 'thread_id':
'f388b7301c2d47758b7476d8f3eea84c', 'time_stamp': '2026-05-18 17:39:40.780042+00', 'exception_name': None}, {'event_name': 'UsedFeature', 'event_value': 'CFNLanguageExtensions', 'thread_id':
'434bf5491154450dbc3e280a62ad3416', 'time_stamp': '2026-05-18 17:39:41.166694+00', 'exception_name': None}, {'event_name': 'UsedFeature', 'event_value': 'CFNLanguageExtensions', 'thread_id':
'e6b3f6e4d5724a4fa4bc1ed4ce864248', 'time_stamp': '2026-05-18 17:40:05.556233+00', 'exception_name': None}, {'event_name': 'UsedFeature', 'event_value': 'CFNLanguageExtensions', 'thread_id':
'025f47f90d5645379d6c5006bc9f2394', 'time_stamp': '2026-05-18 17:40:06.745081+00', 'exception_name': None}], 'containerEngine': 'docker-default'}}}]}
2026-05-18 18:40:15,704 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: Failed to create changeset for the stack: tams-tools, ex: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state: For expression "Status" we matched expected path: "FAILED" Status: FAILED. Reason: Transform AWS::Include failed with: The location parameter is not a valid S3 uri.
2026-05-18 18:40:15,735 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)

Expected result:

I want it to deploy as it does with exactly the same template when using 1.159.0

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Windows 11
  2. sam --version: 1.160.1
  3. AWS region: eu-west-2
{
  "version": "1.160.1",
  "system": {
    "python": "3.13.12",
    "os": "Windows-11-10.0.26200-SP0"
  },
  "additional_dependencies": {
    "container_engine": "Docker(v29.4.3)",
    "aws_cdk": "Not available",
    "terraform": "Not available"
  },
  "available_beta_feature_env_vars": [
    "SAM_CLI_BETA_FEATURES",
    "SAM_CLI_BETA_BUILD_PERFORMANCE",
    "SAM_CLI_BETA_TERRAFORM_SUPPORT",
    "SAM_CLI_BETA_PACKAGE_PERFORMANCE",
    "SAM_CLI_BETA_UV_PACKAGE_MANAGER"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions