Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions docs/cfn-language-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The original template (with `Fn::ForEach` intact) is preserved for CloudFormatio

## Enabling Language Extensions

Local processing of `AWS::LanguageExtensions` is opt-in per command. Three equivalent activation methods, in priority order:
Local processing of `AWS::LanguageExtensions` is opt-in per command. Three activation methods, in priority order (highest first):

1. **CLI flag** — pass `--language-extensions` on a single invocation:

Expand All @@ -27,19 +27,9 @@ Local processing of `AWS::LanguageExtensions` is opt-in per command. Three equiv
sam deploy --language-extensions ...
```

`--no-language-extensions` explicitly disables, overriding the env var below.
`--no-language-extensions` explicitly disables, overriding both samconfig.toml and the env var below.

2. **Environment variable** — set `SAM_CLI_ENABLE_LANGUAGE_EXTENSIONS=1` to enable for the current shell:

```bash
export SAM_CLI_ENABLE_LANGUAGE_EXTENSIONS=1
sam build
sam local invoke MyFunction
```

Truthy values (case-insensitive): `1`, `true`, `yes`. Anything else, including empty string, is off.

3. **`samconfig.toml`** — persist the choice per project:
2. **`samconfig.toml`** — persist the choice per project:

```toml
[default.build.parameters]
Expand Down Expand Up @@ -67,6 +57,18 @@ Local processing of `AWS::LanguageExtensions` is opt-in per command. Three equiv
language_extensions = true
```

A `samconfig.toml` entry is loaded into Click's defaults, so it takes effect as if the flag were passed — and therefore wins over the env var.

3. **Environment variable** — set `SAM_CLI_ENABLE_LANGUAGE_EXTENSIONS=1` to enable for the current shell:

```bash
export SAM_CLI_ENABLE_LANGUAGE_EXTENSIONS=1
sam build
sam local invoke MyFunction
```

Truthy values (case-insensitive): `1`, `true`, `yes`. Anything else, including empty string, is off. The env var is consulted only when neither the CLI flag nor samconfig.toml sets a value.

**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.

## Fn::ForEach
Expand Down
Loading