Skip to content

Commit 9918b23

Browse files
Merge pull request #36 from mineiros-io/soerenmartius/add-terraform-0-15-support
feat: add support for Terraform v0.15
2 parents f8b338e + 422d11e commit 9918b23

File tree

11 files changed

+56
-31
lines changed

11 files changed

+56
-31
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: CI/CD Pipeline
22

3-
on: push
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
410

511
env:
612
AWS_SECRET_ACCESS_KEY: ${{ secrets.MINEIROS_TESTING_AWS_SECRET_ACCESS_KEY }}

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
repos:
22
- repo: https://github.com/mineiros-io/pre-commit-hooks
3-
rev: v0.1.3
3+
rev: v0.2.3
44
hooks:
55
- id: terraform-fmt
66
- id: terraform-validate
77
exclude: ^examples|.terraform/
88
- id: tflint
99
- id: gofmt
1010
- id: goimports
11-
- id: golint
11+
- id: golangci-lint
1212
- id: phony-targets
1313
- id: markdown-link-check

CHANGELOG.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [0.6.0]
10+
### Added
11+
- feat: feat: add support for Terraform `v0.15`
12+
13+
### Changed
14+
- feat: upgrade terratest to `v1.34.0`
15+
- build: upgrade build-tools to `v0.11.0`
16+
- build: upgrade pre-commit-hooks to `v0.2.3`
17+
918
## [0.5.0]
1019
### Added
1120
- Add support for `account_recovery_mechanisms`
@@ -80,9 +89,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8089
- Add unit tests for basic use cases.
8190

8291
<!-- markdown-link-check-disable -->
83-
[Unreleased]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.5.0...HEAD
84-
[0.5.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.4.1...v0.5.0
92+
[Unreleased]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.5.1...HEAD
93+
[0.5.1]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.5.0...v0.5.1
8594
<!-- markdown-link-check-enable -->
95+
[0.5.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.4.1...v0.5.0
8696
[0.4.1]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.4.0...v0.4.1
8797
[0.4.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.3.0...v0.4.0
8898
[0.3.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.2.0...v0.3.0

Makefile

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# Set default shell to bash
22
SHELL := /bin/bash -o pipefail
33

4-
BUILD_TOOLS_VERSION ?= v0.7.0
4+
BUILD_TOOLS_VERSION ?= v0.11.0
55
BUILD_TOOLS_DOCKER_REPO ?= mineiros/build-tools
66
BUILD_TOOLS_DOCKER_IMAGE ?= ${BUILD_TOOLS_DOCKER_REPO}:${BUILD_TOOLS_VERSION}
77

8-
# If running in CI
8+
# If running in CI (e.g. GitHub Actions)
9+
# https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables
910
#
10-
# to disable TF_IN_AUTOMATION in CI set it to empty
11+
# To disable TF_IN_AUTOMATION in CI set it to empty
1112
# https://www.terraform.io/docs/commands/environment-variables.html#tf_in_automation
1213
#
13-
# we are using GNU style quiet commands to disable set V to non-empty e.g. V=1
14+
# We are using GNU style quiet commands to disable set V to non-empty e.g. V=1
1415
# https://www.gnu.org/software/automake/manual/html_node/Debugging-Make-Rules.html
1516
#
1617
ifdef CI
@@ -27,10 +28,15 @@ ifndef NOCOLOR
2728
RESET := $(shell tput -Txterm sgr0)
2829
endif
2930

31+
# We are creating docker volumes for /go and /terraform that are unique per
32+
# repository to reuse dependencies between different docker run commands.
33+
VOLUME_PREFIX ?= mineiros_build_tools
34+
VOLUME_SUFFIX ?= $(notdir $(shell git rev-parse --show-toplevel || "build"))
35+
DOCKER_RUN_FLAGS += -v ${VOLUME_PREFIX}-terraform-${VOLUME_SUFFIX}:/terraform
36+
DOCKER_RUN_FLAGS += -v ${VOLUME_PREFIX}-go-${VOLUME_SUFFIX}:/go
37+
DOCKER_RUN_FLAGS += -v ${PWD}:/build
3038
DOCKER_RUN_FLAGS += --rm
31-
DOCKER_RUN_FLAGS += -v ${PWD}:/app/src
3239
DOCKER_RUN_FLAGS += -e TF_IN_AUTOMATION
33-
DOCKER_RUN_FLAGS += -e USER_UID=$(shell id -u)
3440

3541
DOCKER_SSH_FLAGS += -e SSH_AUTH_SOCK=/ssh-agent
3642
DOCKER_SSH_FLAGS += -v ${SSH_AUTH_SOCK}:/ssh-agent
@@ -45,7 +51,13 @@ DOCKER_RUN_CMD = docker run ${DOCKER_FLAGS} ${BUILD_TOOLS_DOCKER_IMAGE}
4551
.PHONY: default
4652
default: help
4753

48-
## Run pre-commit hooks in build-tools docker container.
54+
# Not exposed as a callable target by `make help`, since this is a one-time shot to simplify the development of this module.
55+
.PHONY: template/adjust
56+
template/adjust: FILTER = -path ./.git -prune -a -type f -o -type f -not -name Makefile
57+
template/adjust:
58+
@find . $(FILTER) -exec sed -i -e "s,terraform-module-template,$${PWD##*/},g" {} \;
59+
60+
## Run pre-commit hooks inside a build-tools docker container.
4961
.PHONY: test/pre-commit
5062
test/pre-commit: DOCKER_FLAGS += ${DOCKER_SSH_FLAGS}
5163
test/pre-commit:
@@ -55,17 +67,18 @@ test/pre-commit:
5567
.PHONY: test/unit-tests
5668
test/unit-tests: DOCKER_FLAGS += ${DOCKER_SSH_FLAGS}
5769
test/unit-tests: DOCKER_FLAGS += ${DOCKER_AWS_FLAGS}
70+
test/unit-tests: TEST ?= "TestUnit"
5871
test/unit-tests:
5972
@echo "${YELLOW}[TEST] ${GREEN}Start Running Go Tests in Docker Container.${RESET}"
60-
$(call go-test,./test/...)
73+
$(call go-test,./test -run $(TEST))
6174

6275
## Clean up cache and temporary files
6376
.PHONY: clean
6477
clean:
6578
$(call rm-command,.terraform)
6679
$(call rm-command,*.tfplan)
67-
$(call rm-command,examples/*/.terraform)
68-
$(call rm-command,examples/*/*.tfplan)
80+
$(call rm-command,*/*/.terraform)
81+
$(call rm-command,*/*/*.tfplan)
6982

7083
## Display help for all targets
7184
.PHONY: help

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A [Terraform] module for deploying and managing
1212
[Cognito User Pools]
1313
on [Amazon Web Services (AWS)][AWS].
1414

15-
*This module supports Terraform v0.14, v0.13 as well as v0.12.20 and above
15+
*This module supports Terraform v0.15, v0.14, v0.13 as well as v0.12.20 and above
1616
and is compatible with the terraform AWS provider v3.19 and above.*
1717

1818
The last version supporting terraform AWS provider v2.x is v0.4.1.
@@ -67,7 +67,7 @@ Most basic usage just setting required arguments:
6767
```hcl
6868
module "terraform-aws-cognito-user-pool" {
6969
source = "mineiros-io/cognito-user-pool/aws"
70-
version = "~> 0.5.0"
70+
version = "~> 0.6.0"
7171
7272
name = "application-userpool"
7373
}
@@ -589,7 +589,7 @@ Copyright &copy; 2020 [Mineiros GmbH][homepage]
589589

590590
[badge-semver]: https://img.shields.io/github/v/tag/mineiros-io/terraform-aws-cognito-user-pool.svg?label=latest&sort=semver
591591
[badge-license]: https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg
592-
[badge-terraform]: https://img.shields.io/badge/terraform-0.14%20|%200.13%20|%200.12.20+-623CE4.svg?logo=terraform
592+
[badge-terraform]: https://img.shields.io/badge/terraform-0.15%20|%200.14%20|%200.13%20|%200.12.20+-623CE4.svg?logo=terraform
593593
[badge-slack]: https://img.shields.io/badge/[email protected]?logo=slack
594594

595595
[build-status]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/actions

examples/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
- [user-pool-with-default-settings/] Deploy a Cognito User Pool with custom settings.
1212

1313
<!-- References -->
14-
<!-- markdown-link-check-disable -->
1514
[complete/]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/blob/master/examples/complete
1615
[user-pool-with-default-settings/]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/blob/master/examples/user-pool-with-default-settings
17-
<!-- markdown-link-check-enable -->
1816

1917
[homepage]: https://mineiros.io/?ref=terraform-aws-cognito-user-pool
2018

@@ -23,9 +21,7 @@
2321
[badge-slack]: https://img.shields.io/badge/[email protected]?logo=slack
2422
[badge-semver]: https://img.shields.io/github/v/tag/mineiros-io/terraform-aws-cognito-user-pool.svg?label=latest&sort=semver
2523

26-
<!-- markdown-link-check-disable -->
2724
[releases-github]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/releases
28-
<!-- markdown-link-check-enable -->
2925
[releases-terraform]: https://github.com/hashicorp/terraform/releases
3026
[apache20]: https://opensource.org/licenses/Apache-2.0
3127
[slack]: https://join.slack.com/t/mineiros-community/shared_invite/zt-ehidestg-aLGoIENLVs6tvwJ11w9WGg

examples/complete/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ shows how to deploy a Cognito User Pool with custom settings.
1212
```hcl
1313
module "cognito_user_pool" {
1414
source = "mineiros-io/cognito-user-pool/aws"
15-
version = "~> 0.5.0"
15+
version = "~> 0.6.0"
1616
1717
name = "complete-example-userpool"
1818
@@ -140,9 +140,7 @@ Run `terraform destroy` to destroy all resources again.
140140

141141
<!-- References -->
142142

143-
<!-- markdown-link-check-disable -->
144143
[main.tf]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/tree/master/examples/complete/main.tf
145-
<!-- markdown-link-check-enable -->
146144

147145
[homepage]: https://mineiros.io/?ref=terraform-module-template
148146

examples/complete/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ provider "aws" {
1717

1818
module "cognito_user_pool" {
1919
source = "mineiros-io/cognito-user-pool/aws"
20-
version = "~> 0.5.0"
20+
version = "~> 0.6.0"
2121

2222
name = "complete-example-userpool"
2323

examples/user-pool-with-default-settings/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ defined in the [variables.tf] file of this module.
1313
```hcl
1414
module "cognito_user_pool" {
1515
source = "mineiros-io/cognito-user-pool/aws"
16-
version = "~> 0.5.0"
16+
version = "~> 0.6.0"
1717
1818
name = "example-userpool"
1919
}
@@ -47,10 +47,8 @@ Run `terraform destroy` to destroy all resources again.
4747

4848
<!-- References -->
4949

50-
<!-- markdown-link-check-disable -->
5150
[main.tf]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/tree/master/examples/user-pool-with-default-settings/main.tf
5251
[variables.tf]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/tree/master/variables.tf
53-
<!-- markdown-link-check-enable -->
5452

5553
[homepage]: https://mineiros.io/?ref=terraform-module-template
5654

examples/user-pool-with-default-settings/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ provider "aws" {
1818

1919
module "cognito_user_pool" {
2020
source = "mineiros-io/cognito-user-pool/aws"
21-
version = "~> 0.5.0"
21+
version = "~> 0.6.0"
2222

2323
name = "example-userpool"
2424
}

0 commit comments

Comments
 (0)