aws / aws/aws-sam-cli

Feature request: Allow specification of parameters that should apply to all (or multiple) environments in AWS SAM CLI configuration file (samconfig.toml)

Open
#5,492 2 comments 4 reactions 0 assignees View on GitHub
area/sam-config contributors/welcome type/feature
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

### Describe your idea/feature/enhancement

Allow specification of parameters that should apply to all (or multiple) **_environments_** in AWS SAM CLI configuration file (samconfig.toml).

This would be similar to the `global` keyword introduced in response to issue #2382, which allowed specifying parameters that should apply to all sam commands.

### Proposal

Perhaps the simplest approach would be to introduce another key-character or keyword to use in the position where an environment name is specified - one that indicates the stanza should apply to _all_ environments. I personally like `*`, but I it might also make sense to reuse the same `global` keyword.

Examples ...
```toml
[*.deploy.parameters]
confirm_changeset = true
region = "us-west-2"
s3_bucket = "some-bucket-name"
```
```toml
[global.deploy.parameters]
confirm_changeset = true
region = "us-west-2"
s3_bucket = "some-bucket-name"
```

A more complex, but also more powerful approach could be to allow the use of a regular expression or a glob expression, such that one could specify _some_, but not necessarily _all_ environments to which a stanza should apply.

Examples ...
```toml
[^dev\d+$.deploy.parameters]
confirm_changeset = true
region = "us-west-2"
s3_bucket = "some-bucket-name"
```
```toml
[dev*.deploy.parameters]
confirm_changeset = true
region = "us-west-2"
s3_bucket = "some-bucket-name"
```

### Additional Details

In [the last comment](https://github.com/aws/aws-sam-cli/issues/2382#issuecomment-901859466) on issue #2382, @dunika seemed to be asking for this feature, and his comment received several 👍s, but there are otherwise no responses.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.