Skip to content

Name transformation documentation #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2024
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
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ To use the action, add a step to your workflow that uses the following syntax.
secret-ids: |
secretId1
ENV_VAR_NAME, secretId2
name-transformation: (Optional) uppercase|lowercase|none
parse-json-secrets: (Optional) true|false
```
Parameters
Expand All @@ -46,6 +47,10 @@ The environment variable name can consist of uppercase letters, numbers, and und

To use a prefix, enter at least three characters followed by an asterisk. For example `dev*` matches all secrets with a name beginning in **dev**. The maximum number of matching secrets that can be retrieved is 100. If you set the variable name, and the prefix matches multiple secrets, then the action fails.

- `name-transformation`

By default, the step creates each environment variable name from the secret name, transformed to include only uppercase letters, numbers, and underscores, and so that it doesn't begin with a number. For the letters in the name, you can configure the step to use lowercase letters with `lowercase` or to not change the case of the letters with `none`. The default value is `uppercase`.

- `parse-json-secrets`

(Optional - default false) By default, the action sets the environment variable value to the entire JSON string in the secret value.
Expand Down Expand Up @@ -172,6 +177,23 @@ MYUSERNAME: "alejandro_rosalez"
MYPASSWORD: "EXAMPLE_PASSWORD"
```

**Example 4 Use lowercase letters for environment variable names**
The following example creates an environment variable with a lowercase name.

```
- name: Get secrets
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: exampleSecretName
name-transformation: lowercase
```

Environment variable created:

```
examplesecretname: secretValue
```

## Security

See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
Expand Down