Skip to content

Commit 3f912cc

Browse files
authored
Update example to context.tf. Add GitHub Actions. Use go modules (#77)
* Update example to `context.tf`. Add GitHub Actions. Use `go` modules * Update example to `context.tf`. Add GitHub Actions. Use `go` modules
1 parent 0861dd8 commit 3f912cc

22 files changed

+905
-194
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212

1313
# Cloud Posse must review any changes to GitHub actions
1414
.github/* @cloudposse/engineering
15+
16+
# Cloud Posse must review any changes to standard context definition
17+
**/context.tf @cloudposse/engineering

.github/auto-release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: '$RESOLVED_VERSION'
3+
version-template: '$MAJOR.$MINOR.$PATCH'
4+
version-resolver:
5+
major:
6+
labels:
7+
- 'major'
8+
minor:
9+
labels:
10+
- 'minor'
11+
- 'enhancement'
12+
patch:
13+
labels:
14+
- 'patch'
15+
- 'fix'
16+
- 'bugfix'
17+
- 'bug'
18+
- 'hotfix'
19+
default: 'minor'
20+
21+
categories:
22+
- title: '🚀 Enhancements'
23+
labels:
24+
- 'enhancement'
25+
- title: '🐛 Bug Fixes'
26+
labels:
27+
- 'fix'
28+
- 'bugfix'
29+
- 'bug'
30+
- 'hotfix'
31+
32+
change-template: |
33+
<details>
34+
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary>
35+
36+
$BODY
37+
</details>
38+
39+
template: |
40+
$CHANGES

.github/workflows/auto-release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: auto-release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
semver:
10+
runs-on: ubuntu-latest
11+
steps:
12+
# Drafts your next Release notes as Pull Requests are merged into "master"
13+
- uses: release-drafter/release-drafter@v5
14+
with:
15+
publish: true
16+
prerelease: false
17+
config-name: auto-release.yml
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}

.github/workflows/chatops.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v2
1111
- name: "Handle common commands"
12-
uses: cloudposse/actions/github/slash-command-dispatch@0.15.0
12+
uses: cloudposse/actions/github/slash-command-dispatch@0.16.0
1313
with:
1414
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
1515
reaction-token: ${{ secrets.GITHUB_TOKEN }}
1616
repository: cloudposse/actions
1717
commands: rebuild-readme, terraform-fmt
18-
permission: none
18+
permission: triage
1919
issue-type: pull-request
2020

2121
test:
@@ -24,13 +24,13 @@ jobs:
2424
- name: "Checkout commit"
2525
uses: actions/checkout@v2
2626
- name: "Run tests"
27-
uses: cloudposse/actions/github/slash-command-dispatch@0.15.0
27+
uses: cloudposse/actions/github/slash-command-dispatch@0.16.0
2828
with:
2929
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
3030
reaction-token: ${{ secrets.GITHUB_TOKEN }}
3131
repository: cloudposse/actions
3232
commands: test
33-
permission: none
33+
permission: triage
3434
issue-type: pull-request
3535
reactions: false
3636

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
terraform-aws-tfstate-backend.iml
99

1010
.build-harness
11-
build-harness
11+
build-harness

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ export README_DEPS ?= docs/targets.md docs/terraform.md
77

88
## Lint terraform code
99
lint:
10-
$(SELF) terraform/install terraform/get-modules terraform/get-plugins terraform/lint terraform/validate
10+
$(SELF) terraform/install terraform/get-modules terraform/get-plugins terraform/lint terraform/validate

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Follow this procedure just once to create your deployment.
120120
1. `terraform apply -auto-approve`. This creates the state bucket and DynamoDB locking
121121
table, along with anything else you have defined in your `*.tf` file(s). At
122122
this point, the Terraform state is still stored locally.
123-
123+
124124
Module `terraform_state_backend` also creates a new `backend.tf` file
125125
that defines the S3 state backend. For example:
126126
```hcl
@@ -219,16 +219,15 @@ Available targets:
219219
|------|---------|
220220
| terraform | >= 0.12.0 |
221221
| aws | >= 2.0 |
222-
| local | >= 1.2 |
223-
| null | >= 2.0 |
222+
| local | >= 1.3 |
224223
| template | >= 2.0 |
225224

226225
## Providers
227226

228227
| Name | Version |
229228
|------|---------|
230229
| aws | >= 2.0 |
231-
| local | >= 1.2 |
230+
| local | >= 1.3 |
232231
| template | >= 2.0 |
233232

234233
## Inputs

README.yaml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ license: "APACHE2"
1616
# Canonical GitHub repo
1717
github_repo: cloudposse/terraform-aws-tfstate-backend
1818

19+
# Tags of this project
20+
tags:
21+
- aws
22+
- terraform
23+
- terraform-modules
24+
- terraform-state
25+
- terraform-state-backend
26+
- remote-state
27+
- s3
28+
29+
# Categories of this project
30+
categories:
31+
- terraform-modules/state
32+
- terraform-modules/state-backend
1933

2034
# Badges to display
2135
badges:
@@ -55,9 +69,9 @@ description: |-
5569
5670
# How to use this project
5771
usage: |-
58-
72+
5973
### Create
60-
74+
6175
Follow this procedure just once to create your deployment.
6276
6377
1. Add the `terraform_state_backend` module to your `main.tf` file. The
@@ -94,7 +108,7 @@ usage: |-
94108
1. `terraform apply -auto-approve`. This creates the state bucket and DynamoDB locking
95109
table, along with anything else you have defined in your `*.tf` file(s). At
96110
this point, the Terraform state is still stored locally.
97-
111+
98112
Module `terraform_state_backend` also creates a new `backend.tf` file
99113
that defines the S3 state backend. For example:
100114
```hcl
@@ -116,14 +130,14 @@ usage: |-
116130
Terraform state to the S3 backend, and it does so per `-auto-approve`. Now the
117131
state is stored in the S3 bucket, and the DynamoDB table will be used to lock
118132
the state to prevent concurrent modification.
119-
133+
120134
This concludes the one-time preparation. Now you can extend and modify your
121135
Terraform configuration as usual.
122136
123137
### Destroy
124-
138+
125139
Follow this procedure to delete your deployment.
126-
140+
127141
1. In `main.tf`, change the `terraform_state_backend` module arguments as
128142
follows:
129143
```hcl
@@ -143,13 +157,13 @@ usage: |-
143157
1. `terraform destroy`. This deletes all resources in your deployment.
144158
1. Examine local state file `terraform.tfstate` to verify that it contains
145159
no resources.
146-
160+
147161
<br/>
148162
149163
![s3-bucket-with-terraform-state](images/s3-bucket-with-terraform-state.png)
150164
151165
### Bucket Replication (Disaster Recovery)
152-
166+
153167
To enable S3 bucket replication in this module, set `s3_replication_enabled` to `true` and populate `s3_replica_bucket_arn` with the ARN of an existing bucket.
154168
155169
```hcl

docs/terraform.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
|------|---------|
66
| terraform | >= 0.12.0 |
77
| aws | >= 2.0 |
8-
| local | >= 1.2 |
9-
| null | >= 2.0 |
8+
| local | >= 1.3 |
109
| template | >= 2.0 |
1110

1211
## Providers
1312

1413
| Name | Version |
1514
|------|---------|
1615
| aws | >= 2.0 |
17-
| local | >= 1.2 |
16+
| local | >= 1.3 |
1817
| template | >= 2.0 |
1918

2019
## Inputs

0 commit comments

Comments
 (0)