Skip to content

Commit e0ec117

Browse files
authored
Merge branch 'develop' into fix/9027-le-package-merge
2 parents 38c5b70 + fe16ab0 commit e0ec117

77 files changed

Lines changed: 1470 additions & 501 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ jobs:
197197
run: pytest -vv ${{ matrix.tests_config.params }}
198198
env:
199199
FORCE_RUN_DOCKER_TEST: ${{ matrix.tests_config.name == 'durable-functions' && '1' || '' }}
200+
DURABLE_EXECUTIONS_EMULATOR_IMAGE_TAG: ${{ matrix.tests_config.name == 'durable-functions' && 'v1.1.1' || '' }}
200201

201202
smoke-and-functional-tests:
202203
name: ${{ matrix.tests_config.name }} / ${{ matrix.tests_config.os }} / ${{ matrix.python }}

docs/cfn-language-extensions.md

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,71 @@ SAM CLI now supports templates that use the `AWS::LanguageExtensions` transform,
44

55
## How it works
66

7-
When SAM CLI detects `AWS::LanguageExtensions` in a template's `Transform` section, it expands language extension constructs locally before running SAM transforms. This enables `sam build`, `sam package`, `sam deploy`, `sam sync`, `sam validate`, `sam local invoke`, and `sam local start-api` to work with templates that use these constructs.
7+
When SAM CLI detects `AWS::LanguageExtensions` in a template's `Transform` section *and* the customer has opted in to local processing, it expands language extension constructs locally before running SAM transforms. This enables `sam build`, `sam package`, `sam deploy`, `sam sync`, `sam validate`, `sam local invoke`, `sam local start-api`, and `sam local start-lambda` to work with templates that use these constructs.
88

9-
The expansion happens in two phases:
9+
**Local processing is off by default.** When off, SAM CLI passes the template through unchanged; CloudFormation processes the `AWS::LanguageExtensions` transform server-side at deploy time (the pre-1.160.0 behavior).
10+
11+
The expansion happens in two phases when enabled:
1012

1113
1. **Phase 1 (Language Extensions)**`Fn::ForEach` loops are expanded, intrinsic functions are resolved where possible, and the template is converted to standard CloudFormation.
1214
2. **Phase 2 (SAM Transform)** — The expanded template is processed by the SAM Translator as usual.
1315

1416
The original template (with `Fn::ForEach` intact) is preserved for CloudFormation deployment, since CloudFormation processes the `AWS::LanguageExtensions` transform server-side.
1517

18+
## Enabling Language Extensions
19+
20+
Local processing of `AWS::LanguageExtensions` is opt-in per command. Three equivalent activation methods, in priority order:
21+
22+
1. **CLI flag** — pass `--language-extensions` on a single invocation:
23+
24+
```bash
25+
sam build --language-extensions
26+
sam package --language-extensions ...
27+
sam deploy --language-extensions ...
28+
```
29+
30+
`--no-language-extensions` explicitly disables, overriding the env var below.
31+
32+
2. **Environment variable** — set `SAM_CLI_ENABLE_LANGUAGE_EXTENSIONS=1` to enable for the current shell:
33+
34+
```bash
35+
export SAM_CLI_ENABLE_LANGUAGE_EXTENSIONS=1
36+
sam build
37+
sam local invoke MyFunction
38+
```
39+
40+
Truthy values (case-insensitive): `1`, `true`, `yes`. Anything else, including empty string, is off.
41+
42+
3. **`samconfig.toml`** — persist the choice per project:
43+
44+
```toml
45+
[default.build.parameters]
46+
language_extensions = true
47+
48+
[default.package.parameters]
49+
language_extensions = true
50+
51+
[default.deploy.parameters]
52+
language_extensions = true
53+
54+
[default.sync.parameters]
55+
language_extensions = true
56+
57+
[default.local_invoke.parameters]
58+
language_extensions = true
59+
60+
[default.local_start_api.parameters]
61+
language_extensions = true
62+
63+
[default.local_start_lambda.parameters]
64+
language_extensions = true
65+
66+
[default.validate.parameters]
67+
language_extensions = true
68+
```
69+
70+
**Each command needs its own activation.** Passing `--language-extensions` to `sam build` does not propagate to a later `sam local invoke` — local processing is decided per command invocation. Use the env var or samconfig entry to enable across commands without repeating the flag.
71+
1672
## Fn::ForEach
1773

1874
`Fn::ForEach` generates multiple resources, conditions, or outputs from a single template definition:
@@ -302,4 +358,4 @@ The following template issues are caught locally before the SAM transform runs:
302358

303359
## Telemetry
304360

305-
SAM CLI tracks usage of `AWS::LanguageExtensions` via the `CFNLanguageExtensions` telemetry feature flag. No template content is transmitted.
361+
SAM CLI emits a `CFNLanguageExtensions` telemetry event when a command is invoked with `--language-extensions` (or its env-var equivalent) **and** the template declares the `AWS::LanguageExtensions` transform. The event fires once per invocation; no template content is transmitted. When local processing is off (the default), no event fires.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies = [
4040
"ruamel_yaml~=0.19.1",
4141
"PyYAML~=6.0",
4242
"cookiecutter>=2.6,<2.8",
43-
"aws-sam-translator==1.109.0",
43+
"aws-sam-translator==1.110.0",
4444
# docker minor version updates can include breaking changes. Auto update micro version only.
4545
"docker~=7.1.0",
4646
"dateparser~=1.3",

0 commit comments

Comments
 (0)