Skip to content

Commit

Permalink
Update example to context.tf. Add GitHub Actions. Use go modules (#…
Browse files Browse the repository at this point in the history
…77)

* Update example to `context.tf`. Add GitHub Actions. Use `go` modules

* Update example to `context.tf`. Add GitHub Actions. Use `go` modules
  • Loading branch information
aknysh authored Nov 13, 2020
1 parent 0861dd8 commit 3f912cc
Show file tree
Hide file tree
Showing 22 changed files with 905 additions and 194 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@

# Cloud Posse must review any changes to GitHub actions
.github/* @cloudposse/engineering

# Cloud Posse must review any changes to standard context definition
**/context.tf @cloudposse/engineering
40 changes: 40 additions & 0 deletions .github/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
version-template: '$MAJOR.$MINOR.$PATCH'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'enhancement'
patch:
labels:
- 'patch'
- 'fix'
- 'bugfix'
- 'bug'
- 'hotfix'
default: 'minor'

categories:
- title: '🚀 Enhancements'
labels:
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- 'hotfix'

change-template: |
<details>
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary>
$BODY
</details>
template: |
$CHANGES
19 changes: 19 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: auto-release

on:
push:
branches:
- master

jobs:
semver:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
with:
publish: true
prerelease: false
config-name: auto-release.yml
env:
GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/chatops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: "Handle common commands"
uses: cloudposse/actions/github/slash-command-dispatch@0.15.0
uses: cloudposse/actions/github/slash-command-dispatch@0.16.0
with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
reaction-token: ${{ secrets.GITHUB_TOKEN }}
repository: cloudposse/actions
commands: rebuild-readme, terraform-fmt
permission: none
permission: triage
issue-type: pull-request

test:
Expand All @@ -24,13 +24,13 @@ jobs:
- name: "Checkout commit"
uses: actions/checkout@v2
- name: "Run tests"
uses: cloudposse/actions/github/slash-command-dispatch@0.15.0
uses: cloudposse/actions/github/slash-command-dispatch@0.16.0
with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
reaction-token: ${{ secrets.GITHUB_TOKEN }}
repository: cloudposse/actions
commands: test
permission: none
permission: triage
issue-type: pull-request
reactions: false

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
terraform-aws-tfstate-backend.iml

.build-harness
build-harness
build-harness
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export README_DEPS ?= docs/targets.md docs/terraform.md

## Lint terraform code
lint:
$(SELF) terraform/install terraform/get-modules terraform/get-plugins terraform/lint terraform/validate
$(SELF) terraform/install terraform/get-modules terraform/get-plugins terraform/lint terraform/validate
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Follow this procedure just once to create your deployment.
1. `terraform apply -auto-approve`. This creates the state bucket and DynamoDB locking
table, along with anything else you have defined in your `*.tf` file(s). At
this point, the Terraform state is still stored locally.

Module `terraform_state_backend` also creates a new `backend.tf` file
that defines the S3 state backend. For example:
```hcl
Expand Down Expand Up @@ -219,16 +219,15 @@ Available targets:
|------|---------|
| terraform | >= 0.12.0 |
| aws | >= 2.0 |
| local | >= 1.2 |
| null | >= 2.0 |
| local | >= 1.3 |
| template | >= 2.0 |

## Providers

| Name | Version |
|------|---------|
| aws | >= 2.0 |
| local | >= 1.2 |
| local | >= 1.3 |
| template | >= 2.0 |

## Inputs
Expand Down
30 changes: 22 additions & 8 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ license: "APACHE2"
# Canonical GitHub repo
github_repo: cloudposse/terraform-aws-tfstate-backend

# Tags of this project
tags:
- aws
- terraform
- terraform-modules
- terraform-state
- terraform-state-backend
- remote-state
- s3

# Categories of this project
categories:
- terraform-modules/state
- terraform-modules/state-backend

# Badges to display
badges:
Expand Down Expand Up @@ -55,9 +69,9 @@ description: |-
# How to use this project
usage: |-
### Create
Follow this procedure just once to create your deployment.
1. Add the `terraform_state_backend` module to your `main.tf` file. The
Expand Down Expand Up @@ -94,7 +108,7 @@ usage: |-
1. `terraform apply -auto-approve`. This creates the state bucket and DynamoDB locking
table, along with anything else you have defined in your `*.tf` file(s). At
this point, the Terraform state is still stored locally.
Module `terraform_state_backend` also creates a new `backend.tf` file
that defines the S3 state backend. For example:
```hcl
Expand All @@ -116,14 +130,14 @@ usage: |-
Terraform state to the S3 backend, and it does so per `-auto-approve`. Now the
state is stored in the S3 bucket, and the DynamoDB table will be used to lock
the state to prevent concurrent modification.
This concludes the one-time preparation. Now you can extend and modify your
Terraform configuration as usual.
### Destroy
Follow this procedure to delete your deployment.
1. In `main.tf`, change the `terraform_state_backend` module arguments as
follows:
```hcl
Expand All @@ -143,13 +157,13 @@ usage: |-
1. `terraform destroy`. This deletes all resources in your deployment.
1. Examine local state file `terraform.tfstate` to verify that it contains
no resources.
<br/>
![s3-bucket-with-terraform-state](images/s3-bucket-with-terraform-state.png)
### Bucket Replication (Disaster Recovery)
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.
```hcl
Expand Down
5 changes: 2 additions & 3 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
|------|---------|
| terraform | >= 0.12.0 |
| aws | >= 2.0 |
| local | >= 1.2 |
| null | >= 2.0 |
| local | >= 1.3 |
| template | >= 2.0 |

## Providers

| Name | Version |
|------|---------|
| aws | >= 2.0 |
| local | >= 1.2 |
| local | >= 1.3 |
| template | >= 2.0 |

## Inputs
Expand Down
Loading

0 comments on commit 3f912cc

Please sign in to comment.