From 38a5e1fa7991666200555e6baecef319c2af6ae2 Mon Sep 17 00:00:00 2001 From: Jirka Fajfr Date: Tue, 4 Jun 2024 17:23:03 -0500 Subject: [PATCH] Name transformation documentation --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index f926b4c..ccc05bc 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. @@ -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.