Skip to content

Commit 7d71374

Browse files
maximmiactions-bot
andauthored
Terraform 0.14 upgrade (#29)
* Terraform 0.14 upgrade * Updated README.md Co-authored-by: actions-bot <58130806+actions-bot@users.noreply.github.com>
1 parent dd39b07 commit 7d71374

File tree

14 files changed

+239
-37
lines changed

14 files changed

+239
-37
lines changed

.github/CODEOWNERS

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Use this file to define individuals or teams that are responsible for code in a repository.
22
# Read more: <https://help.github.com/articles/about-codeowners/>
33
#
4-
# Order is important: the last matching pattern takes the most precedence
4+
# Order is important: the last matching pattern has the highest precedence
55

66
# These owners will be the default owners for everything
77
* @cloudposse/engineering @cloudposse/contributors
@@ -13,5 +13,12 @@
1313
# Cloud Posse must review any changes to GitHub actions
1414
.github/* @cloudposse/engineering
1515

16-
# Cloud Posse must review any changes to standard context definition
17-
**/context.tf @cloudposse/engineering
16+
# Cloud Posse must review any changes to standard context definition,
17+
# but some changes can be rubber-stamped.
18+
**/context.tf @cloudposse/engineering @cloudposse/approvers
19+
README.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
20+
docs/*.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
21+
22+
# Cloud Posse Admins must review all changes to CODEOWNERS or the mergify configuration
23+
.github/mergify.yml @cloudposse/admins
24+
.github/CODEOWNERS @cloudposse/admins

.github/auto-release.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,35 @@ version-template: '$MAJOR.$MINOR.$PATCH'
44
version-resolver:
55
major:
66
labels:
7-
- 'major'
7+
- 'major'
88
minor:
99
labels:
10-
- 'minor'
11-
- 'enhancement'
10+
- 'minor'
11+
- 'enhancement'
1212
patch:
1313
labels:
14-
- 'patch'
15-
- 'fix'
16-
- 'bugfix'
17-
- 'bug'
18-
- 'hotfix'
14+
- 'auto-update'
15+
- 'patch'
16+
- 'fix'
17+
- 'bugfix'
18+
- 'bug'
19+
- 'hotfix'
1920
default: 'minor'
2021

2122
categories:
22-
- title: '🚀 Enhancements'
23-
labels:
24-
- 'enhancement'
25-
- title: '🐛 Bug Fixes'
26-
labels:
27-
- 'fix'
28-
- 'bugfix'
29-
- 'bug'
30-
- 'hotfix'
23+
- title: '🚀 Enhancements'
24+
labels:
25+
- 'enhancement'
26+
- 'patch'
27+
- title: '🐛 Bug Fixes'
28+
labels:
29+
- 'fix'
30+
- 'bugfix'
31+
- 'bug'
32+
- 'hotfix'
33+
- title: '🤖 Automatic Updates'
34+
labels:
35+
- 'auto-update'
3136

3237
change-template: |
3338
<details>

.github/mergify.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
pull_request_rules:
2+
- name: "approve automated PRs that have passed checks"
3+
conditions:
4+
- "check-success~=test/bats"
5+
- "check-success~=test/readme"
6+
- "check-success~=test/terratest"
7+
- "base=master"
8+
- "author=cloudpossebot"
9+
- "head~=auto-update/.*"
10+
actions:
11+
review:
12+
type: "APPROVE"
13+
bot_account: "cloudposse-mergebot"
14+
message: "We've automatically approved this PR because the checks from the automated Pull Request have passed."
15+
16+
- name: "merge automated PRs when approved and tests pass"
17+
conditions:
18+
- "check-success~=test/bats"
19+
- "check-success~=test/readme"
20+
- "check-success~=test/terratest"
21+
- "base=master"
22+
- "head~=auto-update/.*"
23+
- "#approved-reviews-by>=1"
24+
- "#changes-requested-reviews-by=0"
25+
- "#commented-reviews-by=0"
26+
- "base=master"
27+
- "author=cloudpossebot"
28+
actions:
29+
merge:
30+
method: "squash"
31+
32+
- name: "delete the head branch after merge"
33+
conditions:
34+
- "merged"
35+
actions:
36+
delete_head_branch: {}
37+
38+
- name: "ask to resolve conflict"
39+
conditions:
40+
- "conflict"
41+
actions:
42+
comment:
43+
message: "This pull request is now in conflict. Could you fix it @{{author}}? 🙏"
44+
45+
- name: "remove outdated reviews"
46+
conditions:
47+
- "base=master"
48+
actions:
49+
dismiss_reviews:
50+
changes_requested: true
51+
approved: true
52+
message: "This Pull Request has been updated, so we're dismissing all reviews."

.github/workflows/auto-context.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "auto-context"
2+
on:
3+
schedule:
4+
# Update context.tf nightly
5+
- cron: '0 3 * * *'
6+
7+
jobs:
8+
update:
9+
if: github.event_name == 'schedule'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Update context.tf
15+
shell: bash
16+
id: update
17+
env:
18+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
19+
run: |
20+
if [[ -f context.tf ]]; then
21+
echo "Discovered existing context.tf! Fetching most recent version to see if there is an update."
22+
curl -o context.tf -fsSL https://raw.githubusercontent.com/cloudposse/terraform-null-label/master/exports/context.tf
23+
if git diff --no-patch --exit-code context.tf; then
24+
echo "No changes detected! Exiting the job..."
25+
else
26+
echo "context.tf file has changed. Update examples and rebuild README.md."
27+
make init
28+
make github/init/context.tf
29+
make readme/build
30+
echo "::set-output name=create_pull_request=true"
31+
fi
32+
else
33+
echo "This module has not yet been updated to support the context.tf pattern! Please update in order to support automatic updates."
34+
fi
35+
36+
- name: Create Pull Request
37+
if: {{ steps.update.outputs.create_pull_request == 'true' }}
38+
uses: cloudposse/actions/github/create-pull-request@0.22.0
39+
with:
40+
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
41+
commit-message: Update context.tf from origin source
42+
title: Update context.tf
43+
body: |-
44+
## what
45+
This is an auto-generated PR that updates the `context.tf` file to the latest version from `cloudposse/terraform-null-label`
46+
47+
## why
48+
To support all the features of the `context` interface.
49+
50+
branch: auto-update/context.tf
51+
base: master
52+
delete-branch: true
53+
labels: |
54+
auto-update
55+
context

.github/workflows/auto-readme.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "auto-readme"
2+
on:
3+
schedule:
4+
# Update README.md nightly
5+
- cron: '0 4 * * *'
6+
7+
jobs:
8+
update:
9+
if: github.event_name == 'schedule'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Update readme
15+
shell: bash
16+
id: update
17+
env:
18+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
19+
run: |
20+
make init
21+
make readme/build
22+
23+
- name: Create Pull Request
24+
uses: cloudposse/actions/github/create-pull-request@0.20.0
25+
with:
26+
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
27+
commit-message: Update README.md and docs
28+
title: Update README.md and docs
29+
body: |-
30+
## what
31+
This is an auto-generated PR that updates the README.md and docs
32+
33+
## why
34+
To have most recent changes of README.md and doc from origin templates
35+
36+
branch: auto-update/readme
37+
base: master
38+
delete-branch: true
39+
labels: |
40+
auto-update
41+
readme

.github/workflows/chatops.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v2
1111
- name: "Handle common commands"
12-
uses: cloudposse/actions/github/slash-command-dispatch@0.16.0
12+
uses: cloudposse/actions/github/slash-command-dispatch@0.22.0
1313
with:
1414
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
1515
reaction-token: ${{ secrets.GITHUB_TOKEN }}
@@ -24,7 +24,7 @@ jobs:
2424
- name: "Checkout commit"
2525
uses: actions/checkout@v2
2626
- name: "Run tests"
27-
uses: cloudposse/actions/github/slash-command-dispatch@0.16.0
27+
uses: cloudposse/actions/github/slash-command-dispatch@0.22.0
2828
with:
2929
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
3030
reaction-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Validate Codeowners
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
validate-codeowners:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: "Checkout source code at current commit"
10+
uses: actions/checkout@v2
11+
- uses: mszostok/codeowners-validator@v0.5.0
12+
with:
13+
# For now, remove "files" check to allow CODEOWNERS to specify non-existent
14+
# files so we can use the same CODEOWNERS file for Terraform and non-Terraform repos
15+
# checks: "files,syntax,owners,duppatterns"
16+
checks: "syntax,owners,duppatterns"
17+
# GitHub access token is required only if the `owners` check is enabled
18+
github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
<!-- markdownlint-disable -->
12
# terraform-aws-lambda-elasticsearch-cleanup
23

34
[![GitHub Action Build Status](https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/workflows/Lambda/badge.svg?branch=master)](https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/actions?query=workflow%3ALambda) [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-aws-lambda-elasticsearch-cleanup.svg)](https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
5+
<!-- markdownlint-restore -->
46

57
[![README Header][readme_header_img]][readme_header_link]
68

@@ -68,8 +70,15 @@ We literally have [*hundreds of terraform modules*][terraform_modules] that are
6870
## Usage
6971

7072

71-
**IMPORTANT:** The `master` branch is used in `source` just as an example. In your code, do not pin to `master` because there may be breaking changes between releases.
72-
Instead pin to the release tag (e.g. `?ref=tags/x.y.z`) of one of our [latest releases](https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/releases).
73+
**IMPORTANT:** We do not pin modules to versions in our examples because of the
74+
difficulty of keeping the versions in the documentation in sync with the latest released versions.
75+
We highly recommend that in your code you pin the version to the exact version you are
76+
using so that your infrastructure remains stable, and update versions in a
77+
systematic way so that they do not catch you by surprise.
78+
79+
Also, because of a bug in the Terraform registry ([hashicorp/terraform#21417](https://github.com/hashicorp/terraform/issues/21417)),
80+
the registry shows many of our inputs as required when in fact they are optional.
81+
The table below correctly indicates which inputs are required.
7382

7483

7584

@@ -152,7 +161,7 @@ is given
152161

153162
| Name | Version |
154163
|------|---------|
155-
| terraform | >= 0.12.0 |
164+
| terraform | >= 0.12.26 |
156165
| aws | >= 2.0 |
157166
| null | >= 2.0 |
158167

@@ -295,7 +304,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
295304

296305
## Copyright
297306

298-
Copyright © 2017-2020 [Cloud Posse, LLC](https://cpco.io/copyright)
307+
Copyright © 2017-2021 [Cloud Posse, LLC](https://cpco.io/copyright)
299308

300309

301310

@@ -352,8 +361,10 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
352361

353362
### Contributors
354363

364+
<!-- markdownlint-disable -->
355365
| [![Josh Myers][joshmyers_avatar]][joshmyers_homepage]<br/>[Josh Myers][joshmyers_homepage] | [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Marcin Brański][3h4x_avatar]][3h4x_homepage]<br/>[Marcin Brański][3h4x_homepage] |
356366
|---|---|---|---|---|
367+
<!-- markdownlint-restore -->
357368

358369
[joshmyers_homepage]: https://github.com/joshmyers
359370
[joshmyers_avatar]: https://img.cloudposse.com/150x150/https://github.com/joshmyers.png

context.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
#
2020

2121
module "this" {
22-
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.19.2"
22+
source = "cloudposse/label/null"
23+
version = "0.22.1" // requires Terraform >= 0.12.26
2324

2425
enabled = var.enabled
2526
namespace = var.namespace

docs/terraform.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ is given
1010

1111
| Name | Version |
1212
|------|---------|
13-
| terraform | >= 0.12.0 |
13+
| terraform | >= 0.12.26 |
1414
| aws | >= 2.0 |
1515
| null | >= 2.0 |
1616

examples/complete/context.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
#
2020

2121
module "this" {
22-
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.19.2"
22+
source = "cloudposse/label/null"
23+
version = "0.22.1" // requires Terraform >= 0.12.26
2324

2425
enabled = var.enabled
2526
namespace = var.namespace

examples/complete/main.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ provider "aws" {
33
}
44

55
module "vpc" {
6-
source = "git::https://github.com/cloudposse/terraform-aws-vpc.git?ref=tags/0.17.0"
6+
source = "cloudposse/vpc/aws"
7+
version = "0.17.0"
78

89
cidr_block = "172.16.0.0/16"
910

1011
context = module.this.context
1112
}
1213

1314
module "subnets" {
14-
source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=tags/0.30.0"
15+
source = "cloudposse/dynamic-subnets/aws"
16+
version = "0.30.0"
1517

1618
availability_zones = var.availability_zones
1719
vpc_id = module.vpc.vpc_id
@@ -24,7 +26,8 @@ module "subnets" {
2426
}
2527

2628
module "elasticsearch" {
27-
source = "git::https://github.com/cloudposse/terraform-aws-elasticsearch.git?ref=tags/0.24.0"
29+
source = "cloudposse/elasticsearch/aws"
30+
version = "0.24.0"
2831

2932
security_groups = [module.vpc.vpc_default_security_group_id]
3033
vpc_id = module.vpc.vpc_id

main.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,17 @@ locals {
8888
# Modules
8989
#--------------------------------------------------------------
9090
module "label" {
91-
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.19.2"
91+
source = "cloudposse/label/null"
92+
version = "0.19.2"
9293

9394
attributes = compact(concat(module.this.attributes, ["elasticsearch", "cleanup"]))
9495

9596
context = module.this.context
9697
}
9798

9899
module "artifact" {
99-
source = "git::https://github.com/cloudposse/terraform-external-module-artifact.git?ref=tags/0.5.0"
100+
source = "cloudposse/module-artifact/external"
101+
version = "0.5.0"
100102
enabled = module.this.enabled
101103
filename = "lambda.zip"
102104
module_name = "terraform-aws-lambda-elasticsearch-cleanup"

0 commit comments

Comments
 (0)