Skip to content

Commit 95ae279

Browse files
committed
doc: added usage description to README
1 parent 35ad560 commit 95ae279

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,30 @@ Override parameters using a local JSON file: `"file:///${{ github.workspace }}/p
4242

4343
> You can learn more about [AWS CloudFormation](https://aws.amazon.com/cloudformation/)
4444

45+
#### envs-prefix-for-parameter-overrides (OPTIONAL)
46+
47+
You can also override parameter values using environment variables with prefixed keys. Use `envs-prefix-for-parameter-overrides` parameter to define a prefix you want action to filter out and combine with other parameters while deploying.
48+
49+
The biggest advantage of this approach is that you don't need to think about escaping your variables (as long as Github UI/YAML accepts it).
50+
51+
The prefix of your choice will be stripped.
52+
53+
Example:
54+
```yaml
55+
- name: Deploy to AWS CloudFormation
56+
uses: aws-actions/aws-cloudformation-github-deploy@v1
57+
with:
58+
name: MyStack
59+
template: myStack.yaml
60+
parameter-overrides: "MyParam1=myValue,MyParam2=${{ secrets.MY_SECRET_VALUE }}"
61+
envs-prefix-for-parameter-overrides: CFD_
62+
env:
63+
CFD_MyParam3: some value, that is automatically escaped
64+
CFD_MyParam4: ${{ vars.MY_VAR_VALUE }}
65+
```
66+
67+
This example will result in 4 parameter overrides: MyParam1, MyParam2, MyParam3 and MyParam4. The last two will be taken from environment variables.
68+
4569
## Credentials and Region
4670

4771
This action relies on the [default behavior of the AWS SDK for Javascript](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html) to determine AWS credentials and region.

0 commit comments

Comments
 (0)