Skip to content

Commit ca078ce

Browse files
committed
Updated the doc to reflect the changes
1 parent 74ca08c commit ca078ce

File tree

3 files changed

+145
-34
lines changed

3 files changed

+145
-34
lines changed

.lintstagedrc.js

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
module.exports = {
2-
// Prettier
3-
'**/*.{md}': ['prettier --ignore-path .gitignore --write'],
4-
5-
// Eslint
6-
'**/*.{ts,tsx}': ['eslint --fix'],
7-
8-
// Jest
9-
'**/*.test.{ml,mli,mly,ts,js,json}': 'jest',
10-
}
11-
2+
// Prettier
3+
'**/*.{md}': ['prettier --ignore-path .gitignore --write'],
4+
5+
// Eslint
6+
'**/*.{ts,tsx}': ['eslint --fix'],
7+
8+
// Jest
9+
'**/*.test.{ml,mli,mly,ts,js,json}': 'jest'
10+
}

README.md

+70-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
## AWS CloudFormation "Deploy CloudFormation Stack" Action for GitHub Actions
1+
<!-- trunk-ignore-all(prettier/SyntaxError) -->
2+
# AWS CloudFormation "Deploy CloudFormation Stack" Action for GitHub Actions
23

34
![Package](https://github.com/aws-actions/aws-cloudformation-github-deploy/workflows/Package/badge.svg)
45
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -31,6 +32,7 @@ Override multiple parameters separated by commas: `"MyParam1=myValue1,MyParam2=m
3132
Override a comma delimited list: `"MyParam1=myValue1,MyParam1=myValue2"` or `MyParam1="myValue1,myValue2"`
3233

3334
Override parameters using a native YAML object:
35+
3436
```yaml
3537
parameter-overrides:
3638
MyParam1: myValue1
@@ -41,6 +43,7 @@ parameter-overrides:
4143
```
4244

4345
Override parameters using a local JSON file: `"file:///${{ github.workspace }}/parameters.json"` with a file named `parameters.json` at the root of the repository:
46+
4447
```json
4548
[
4649
{
@@ -52,6 +55,58 @@ Override parameters using a local JSON file: `"file:///${{ github.workspace }}/p
5255

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

58+
## Setting Tags
59+
60+
You can add tags to your CloudFormation stack by using the `tags` parameter. Tags can be specified in three formats:
61+
62+
Using YAML array format:
63+
64+
```yaml
65+
- uses: aws-actions/aws-cloudformation-github-deploy@v1
66+
with:
67+
name: MyStack
68+
template: myStack.yaml
69+
tags:
70+
- Key: Environment
71+
Value: Production
72+
- Key: Team
73+
Value: DevOps
74+
```
75+
76+
Using YAML object format:
77+
78+
```yaml
79+
- uses: aws-actions/aws-cloudformation-github-deploy@v1
80+
with:
81+
name: MyStack
82+
template: myStack.yaml
83+
tags:
84+
Environment: Production
85+
Team: DevOps
86+
```
87+
88+
Using JSON formating:
89+
90+
```yaml
91+
- uses: aws-actions/aws-cloudformation-github-deploy@v1
92+
with:
93+
name: MyStack
94+
template: myStack.yaml
95+
tags: |
96+
[
97+
{
98+
"Key": "Environment",
99+
"Value": "Production"
100+
},
101+
{
102+
"Key": "Team",
103+
"Value": "DevOps"
104+
}
105+
]
106+
```
107+
108+
Tags specified during stack creation or update will be applied to the stack and all its resources that support tagging. These tags can be useful for cost allocation, access control, and resource organization.
109+
55110
## Credentials and Region
56111

57112
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.
@@ -71,7 +126,7 @@ This action requires the following minimum set of permissions:
71126

72127
> We recommend to read [AWS CloudFormation Security Best Practices](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/best-practices.html)
73128

74-
```
129+
```json
75130
{
76131
"Version": "2012-10-17",
77132
"Statement": [
@@ -147,15 +202,18 @@ jobs:
147202
name: ${{ steps.env-name.outputs.environment }}-cluster
148203
template: https://s3.amazonaws.com/aws-quickstart/quickstart-amazon-eks/templates/amazon-eks-master.template.yaml
149204
no-fail-on-empty-changeset: "1"
150-
parameter-overrides: >-
151-
AvailabilityZones=${{ github.event.inputs.region }}a,
152-
AvailabilityZones=${{ github.event.inputs.region }}c,
153-
KeyPairName=${{ github.event.inputs.keypair }},
154-
NumberOfAZs=2,
155-
ProvisionBastionHost=Disabled,
156-
EKSPublicAccessEndpoint=Enabled,
157-
EKSPrivateAccessEndpoint=Enabled,
158-
RemoteAccessCIDR=0.0.0.0/0
205+
parameter-overrides:
206+
AvailabilityZones: ${{ github.event.inputs.region }}a
207+
AvailabilityZones: ${{ github.event.inputs.region }}c
208+
KeyPairName: ${{ github.event.inputs.keypair }}
209+
NumberOfAZs: 2
210+
ProvisionBastionHost: Disabled
211+
EKSPublicAccessEndpoint: Enabled
212+
EKSPrivateAccessEndpoint: Enabled
213+
RemoteAccessCIDR: 0.0.0.0/0
214+
tags:
215+
Environmnet: Develop
216+
Owner: DevOps
159217

160218
```
161219

@@ -166,6 +224,7 @@ If you run in self-hosted environments and in secured environment where you need
166224
Additionally this action will always consider already configured proxy in the environment.
167225

168226
Manually configured proxy:
227+
169228
```yaml
170229
uses: aws-actions/aws-cloudformation-github-deploy@v1
171230
with:

action.yml

+66-13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: 'AWS CloudFormation "Deploy CloudFormation Stack" Action for GitHub Actions'
23
description: "Deploys a AWS CloudFormation stack"
34
branding:
@@ -11,53 +12,105 @@ inputs:
1112
description: "The path or URL to the CloudFormation template"
1213
required: true
1314
capabilities:
14-
description: "The comma-delimited list of stack template capabilities to acknowledge. Defaults to 'CAPABILITY_IAM'"
15+
description: >-
16+
The comma-delimited list of stack template capabilities to acknowledge.
17+
Defaults to 'CAPABILITY_IAM'
1518
required: false
1619
default: "CAPABILITY_IAM"
1720
parameter-overrides:
18-
description: 'The parameters to override in the stack inputs. You can pass a comma-delimited list, a file URL, or a native YAML object. Comma-delimited list has each entry formatted as <ParameterName>=<ParameterValue> or <ParameterName>="<ParameterValue>,<ParameterValue>". A JSON file can be a local file with a "file://" prefix or remote URL. The file should look like: [ { "ParameterKey": "KeyPairName", "ParameterValue": "MyKey" }]. For YAML objects, provide parameter keys and values directly in the YAML structure.'
21+
description: >-
22+
The parameters to override in the stack inputs. You can pass a comma-delimited
23+
list, a file URL, or a native YAML object. Comma-delimited list has each entry
24+
formatted as <ParameterName>=<ParameterValue> or
25+
<ParameterName>="<ParameterValue>,<ParameterValue>". A JSON file can be a local
26+
file with a "file://" prefix or remote URL. The file should look like:
27+
[ { "ParameterKey": "KeyPairName", "ParameterValue": "MyKey" }]. For YAML
28+
objects, provide parameter keys and values directly in the YAML structure.
1929
required: false
2030
no-execute-changeset:
21-
description: "Indicates whether to execute to the change set or have it reviewed. Default to '0' (will execute the change set)"
31+
description: >-
32+
Indicates whether to execute to the change set or have it reviewed.
33+
Default to '0' (will execute the change set)
2234
required: false
2335
default: "0"
2436
no-delete-failed-changeset:
25-
description: "Indicates whether to delete to a failed change set. Default to '0' (will delete the failed changeset)"
37+
description: >-
38+
Indicates whether to delete to a failed change set.
39+
Default to '0' (will delete the failed changeset)
2640
required: false
2741
default: "0"
2842
no-fail-on-empty-changeset:
29-
description: "If the CloudFormation change set is empty, do not fail. Defaults to '0' (will fail on empty change set)"
43+
description: >-
44+
If the CloudFormation change set is empty, do not fail.
45+
Defaults to '0' (will fail on empty change set)
3046
required: false
3147
default: "0"
3248
disable-rollback:
33-
description: "Disable rollback of the stack if stack creation fails. Defaults to '0' (will rollback if stack creation fails). This input is only used for stack creation, not for stack update"
49+
description: >-
50+
Disable rollback of the stack if stack creation fails.
51+
Defaults to '0' (will rollback if stack creation fails).
52+
This input is only used for stack creation, not for stack update
3453
required: false
3554
default: "0"
3655
timeout-in-minutes:
37-
description: "The amount of time that can pass before the stack status becomes CREATE_FAILED. This input is only used for stack creation, not for stack update"
56+
description: >-
57+
The amount of time that can pass before the stack status becomes CREATE_FAILED.
58+
This input is only used for stack creation, not for stack update
3859
required: false
3960
notification-arns:
40-
description: "The comma-delimited list of Amazon SNS topic ARNs to publish stack related events"
61+
description: >-
62+
The comma-delimited list of Amazon SNS topic ARNs to publish stack
63+
related events
4164
required: false
4265
role-arn:
43-
description: "The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that AWS CloudFormation assumes to create the stack. AWS CloudFormation uses the role's credentials to make calls on your behalf. AWS CloudFormation always uses this role for all future operations on the stack. As long as users have permission to operate on the stack, AWS CloudFormation uses this role even if the users don't have permission to pass it. Ensure that the role grants least privilege. If you don't specify a value, AWS CloudFormation uses the role that was previously associated with the stack"
66+
description: >-
67+
The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM)
68+
role that AWS CloudFormation assumes to create the stack. AWS CloudFormation
69+
uses the role's credentials to make calls on your behalf. AWS CloudFormation
70+
always uses this role for all future operations on the stack. As long as users
71+
have permission to operate on the stack, AWS CloudFormation uses this role even
72+
if the users don't have permission to pass it. Ensure that the role grants
73+
least privilege. If you don't specify a value, AWS CloudFormation uses the
74+
role that was previously associated with the stack
4475
required: false
4576
tags:
46-
description: 'Key-value pairs to associate with this stack. This input should be JSON-formatted, for example [ { "Key": "string", "Value": "string" } ]'
77+
description: >-
78+
Key-value pairs to associate with this stack. Can be specified in three formats:
79+
1. As a YAML array:
80+
tags:
81+
- Key: Environment
82+
Value: Production
83+
- Key: Team
84+
Value: DevOps
85+
2. As a YAML object:
86+
tags:
87+
Environment: Production
88+
Team: DevOps
89+
3. As a JSON string:
90+
tags: '[{"Key":"Environment","Value":"Production"},{"Key":"Team","Value":"DevOps"}]'
4791
required: false
4892
termination-protection:
49-
description: "Whether to enable termination protection on the specified stack. Defaults to '0' (terminated protection will be disabled) This input is only used for stack creation, not for stack update"
93+
description: >-
94+
Whether to enable termination protection on the specified stack.
95+
Defaults to '0' (terminated protection will be disabled)
96+
This input is only used for stack creation, not for stack update
5097
required: false
5198
default: "0"
5299
http-proxy:
53100
description: 'Proxy to use for the AWS SDK agent'
54101
required: false
55102
change-set-name:
56-
description: "The name of the change set to create. Defaults to '<stack-name>-CS'"
103+
description: >-
104+
The name of the change set to create.
105+
Defaults to '<stack-name>-CS'
57106
required: false
58107
outputs:
59108
stack-id:
60-
description: "The id of the deployed stack. In addition, any outputs declared in the deployed CloudFormation stack will also be set as outputs for the action, e.g. if the stack has a stack output named 'foo', this action will also have an output named 'foo'."
109+
description: >-
110+
The id of the deployed stack. In addition, any outputs declared in the
111+
deployed CloudFormation stack will also be set as outputs for the action,
112+
e.g. if the stack has a stack output named 'foo', this action will also
113+
have an output named 'foo'.
61114
runs:
62115
using: "node20"
63116
main: "dist/index.js"

0 commit comments

Comments
 (0)