Skip to content

Commit cc80a49

Browse files
Merge pull request #21 from mineiros-io/soerenmartius/add-terraform-0-15-support
feat: add support for Terraform v0.15
2 parents 87a02d0 + 140af4e commit cc80a49

File tree

10 files changed

+166
-26
lines changed

10 files changed

+166
-26
lines changed

.pre-commit-config.yaml

+2-2
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.4
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

+36-2
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,88 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
56
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

78
## [Unreleased]
89

10+
## [0.4.0]
11+
12+
### Added
13+
14+
- feat: feat: add support for Terraform `v0.15`
15+
16+
### Changed
17+
18+
- feat: upgrade terratest to `v1.34.0`
19+
- build: update secrets in GitHub Actions pipeline
20+
- build: upgrade build-tools to `v0.11.0`
21+
- build: upgrade pre-commit-hooks to `v0.2.3`
22+
923
## [0.3.0]
24+
1025
### Added
26+
1127
- Add support for Terraform v0.14.x
1228

1329
## [0.2.0]
30+
1431
### Added
32+
1533
- Add support for Terraform v0.13.x
1634
- Add support for Terraform AWS Provider v3.x
1735
- Prepare support for Terraform v0.14.x
1836

1937
## [0.1.0] - 2020-07-08
38+
2039
### Added
40+
2141
- Add CHANGELOG.md
2242

2343
### Changed
44+
2445
- Align documentation to latest structure and style
2546

2647
## [0.0.4] - 2020-06-18
48+
2749
### Added
50+
2851
- Add a unit tests
2952

3053
### Changed
54+
3155
- Align repository to latest structure and style
3256

3357
## [0.0.3] - 2020-06-18
58+
3459
### Fixed
60+
3561
- Fix creation of empty group resources
3662

3763
## [0.0.2] - 2020-05-25
64+
3865
### Added
66+
3967
- Add support for adding multiple users at once
4068

4169
## [0.0.1] - 2020-05-25
70+
4271
### Added
72+
4373
- Add IAM user support
4474
- Add IAM user inline policy support
4575
- Add custom or managed policies support
4676
- Add support to attach the user to a list of groups by group name
4777

4878
<!-- markdown-link-check-disable -->
49-
[Unreleased]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.3.0...HEAD
50-
[0.3.0]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.2.0...v0.3.0
79+
80+
[unreleased]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.4.0...HEAD
81+
[0.4.0]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.3.0...v0.4.0
82+
5183
<!-- markdown-link-check-disabled -->
84+
85+
[0.3.0]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.2.0...v0.3.0
5286
[0.2.0]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.1.0...v0.2.0
5387
[0.1.0]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.0.4...v0.1.0
5488
[0.0.4]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.0.3...v0.0.4

Makefile

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +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 (e.g. Semaphore CI)
9-
# https://docs.semaphoreci.com/ci-cd-environment/environment-variables/#ci
8+
# If running in CI (e.g. GitHub Actions)
9+
# https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables
1010
#
11-
# to disable TF_IN_AUTOMATION in CI set it to empty
11+
# To disable TF_IN_AUTOMATION in CI set it to empty
1212
# https://www.terraform.io/docs/commands/environment-variables.html#tf_in_automation
1313
#
14-
# 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
1515
# https://www.gnu.org/software/automake/manual/html_node/Debugging-Make-Rules.html
1616
#
1717
ifdef CI
@@ -28,13 +28,15 @@ ifndef NOCOLOR
2828
RESET := $(shell tput -Txterm sgr0)
2929
endif
3030

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
3138
DOCKER_RUN_FLAGS += --rm
32-
DOCKER_RUN_FLAGS += -v ${PWD}:/app/src
3339
DOCKER_RUN_FLAGS += -e TF_IN_AUTOMATION
34-
DOCKER_RUN_FLAGS += -e USER_UID=$(shell id -u)
35-
36-
DOCKER_SSH_FLAGS += -e SSH_AUTH_SOCK=/ssh-agent
37-
DOCKER_SSH_FLAGS += -v ${SSH_AUTH_SOCK}:/ssh-agent
3840

3941
DOCKER_AWS_FLAGS += -e AWS_ACCESS_KEY_ID
4042
DOCKER_AWS_FLAGS += -e AWS_SECRET_ACCESS_KEY
@@ -54,17 +56,16 @@ template/adjust:
5456

5557
## Run pre-commit hooks inside a build-tools docker container.
5658
.PHONY: test/pre-commit
57-
test/pre-commit: DOCKER_FLAGS += ${DOCKER_SSH_FLAGS}
5859
test/pre-commit:
5960
$(call docker-run,pre-commit run -a)
6061

6162
## Run all Go tests inside a build-tools docker container. This is complementary to running 'go test ./test/...'.
6263
.PHONY: test/unit-tests
63-
test/unit-tests: DOCKER_FLAGS += ${DOCKER_SSH_FLAGS}
6464
test/unit-tests: DOCKER_FLAGS += ${DOCKER_AWS_FLAGS}
65+
test/unit-tests: TEST ?= "TestUnit"
6566
test/unit-tests:
6667
@echo "${YELLOW}[TEST] ${GREEN}Start Running Go Tests in Docker Container.${RESET}"
67-
$(call go-test,./test/...)
68+
$(call go-test,./test -run $(TEST))
6869

6970
## Clean up cache and temporary files
7071
.PHONY: clean

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
A [Terraform](https://www.terraform.io) base module for deploying and managing
1212
[IAM Users][IAM-User-Docs] on [Amazon Web Services][AWS].
1313

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

1717
- [Module Features](#module-features)
@@ -56,7 +56,7 @@ Most basic usage showing how to add three users and assigning two policies:
5656
```hcl
5757
module "iam-users" {
5858
source = "mineiros-io/iam-user/aws"
59-
version = "~> 0.3.0"
59+
version = "~> 0.4.0"
6060
6161
names = [
6262
"user.one",
@@ -231,7 +231,7 @@ Run `make help` to see details on each available target.
231231
This module is licensed under the Apache License Version 2.0, January 2004.
232232
Please see [LICENSE] for full details.
233233

234-
Copyright &copy; 2020 [Mineiros GmbH][homepage]
234+
Copyright &copy; 2021 [Mineiros GmbH][homepage]
235235

236236
<!-- References -->
237237

@@ -241,7 +241,7 @@ Copyright &copy; 2020 [Mineiros GmbH][homepage]
241241
[badge-build]: https://github.com/mineiros-io/terraform-aws-iam-user/workflows/CI/CD%20Pipeline/badge.svg
242242
[badge-semver]: https://img.shields.io/github/v/tag/mineiros-io/terraform-aws-iam-user.svg?label=latest&sort=semver
243243
[badge-license]: https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg
244-
[badge-terraform]: https://img.shields.io/badge/terraform-0.14,%200.13,%200.12.20+-623CE4.svg?logo=terraform
244+
[badge-terraform]: https://img.shields.io/badge/terraform-0.15%20|0.14%20|%200.13%20|%200.12.20+-623CE4.svg?logo=terraform
245245
[badge-slack]: https://img.shields.io/badge/slack-@mineiros--community-f32752.svg?logo=slack
246246

247247
[badge-tf-aws]: https://img.shields.io/badge/AWS-3%20and%202.0+-F8991D.svg?logo=terraform

examples/require-mfa-credentials/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The `AllowManageOwnGitCredentials`, `AllowManageOwnSSHPublicKeys` and `AllowMana
1515
```hcl
1616
module "iam-users" {
1717
source = "mineiros-io/iam-user/aws"
18-
version = "~> 0.3.0"
18+
version = "~> 0.4.0"
1919
2020
names = [
2121
"user.one",

examples/require-mfa-credentials/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ provider "aws" {
1515

1616
module "iam-users" {
1717
source = "mineiros-io/iam-user/aws"
18-
version = "~> 0.3.0"
18+
version = "~> 0.4.0"
1919

2020
names = [
2121
"user.one",

examples/simple-users/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ provider "aws" {
1515

1616
module "iam-users" {
1717
source = "mineiros-io/iam-user/aws"
18-
version = "~> 0.3.0"
18+
version = "~> 0.4.0"
1919

2020
names = [
2121
"user.one",

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module github.com/mineiros-io/terraform-aws-iam-user
33
go 1.14
44

55
require (
6-
github.com/gruntwork-io/terratest v0.30.0
6+
github.com/gruntwork-io/terratest v0.34.0
77
github.com/stretchr/testify v1.4.0
88
)

0 commit comments

Comments
 (0)