Skip to content

Commit

Permalink
Merge pull request #21 from mineiros-io/soerenmartius/add-terraform-0…
Browse files Browse the repository at this point in the history
…-15-support

feat: add support for Terraform v0.15
  • Loading branch information
soerenmartius authored May 23, 2021
2 parents 87a02d0 + 140af4e commit cc80a49
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/mineiros-io/pre-commit-hooks
rev: v0.1.4
rev: v0.2.3
hooks:
- id: terraform-fmt
- id: terraform-validate
exclude: ^examples|.terraform/
- id: tflint
- id: gofmt
- id: goimports
- id: golint
- id: golangci-lint
- id: phony-targets
- id: markdown-link-check
38 changes: 36 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,88 @@
# Changelog

All notable changes to this project will be documented in this file.

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

## [Unreleased]

## [0.4.0]

### Added

- feat: feat: add support for Terraform `v0.15`

### Changed

- feat: upgrade terratest to `v1.34.0`
- build: update secrets in GitHub Actions pipeline
- build: upgrade build-tools to `v0.11.0`
- build: upgrade pre-commit-hooks to `v0.2.3`

## [0.3.0]

### Added

- Add support for Terraform v0.14.x

## [0.2.0]

### Added

- Add support for Terraform v0.13.x
- Add support for Terraform AWS Provider v3.x
- Prepare support for Terraform v0.14.x

## [0.1.0] - 2020-07-08

### Added

- Add CHANGELOG.md

### Changed

- Align documentation to latest structure and style

## [0.0.4] - 2020-06-18

### Added

- Add a unit tests

### Changed

- Align repository to latest structure and style

## [0.0.3] - 2020-06-18

### Fixed

- Fix creation of empty group resources

## [0.0.2] - 2020-05-25

### Added

- Add support for adding multiple users at once

## [0.0.1] - 2020-05-25

### Added

- Add IAM user support
- Add IAM user inline policy support
- Add custom or managed policies support
- Add support to attach the user to a list of groups by group name

<!-- markdown-link-check-disable -->
[Unreleased]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.3.0...HEAD
[0.3.0]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.2.0...v0.3.0

[unreleased]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.4.0...HEAD
[0.4.0]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.3.0...v0.4.0

<!-- markdown-link-check-disabled -->

[0.3.0]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.0.4...v0.1.0
[0.0.4]: https://github.com/mineiros-io/terraform-aws-iam-user/compare/v0.0.3...v0.0.4
Expand Down
27 changes: 14 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Set default shell to bash
SHELL := /bin/bash -o pipefail

BUILD_TOOLS_VERSION ?= v0.7.0
BUILD_TOOLS_VERSION ?= v0.11.0
BUILD_TOOLS_DOCKER_REPO ?= mineiros/build-tools
BUILD_TOOLS_DOCKER_IMAGE ?= ${BUILD_TOOLS_DOCKER_REPO}:${BUILD_TOOLS_VERSION}

# if running in CI (e.g. Semaphore CI)
# https://docs.semaphoreci.com/ci-cd-environment/environment-variables/#ci
# If running in CI (e.g. GitHub Actions)
# https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables
#
# to disable TF_IN_AUTOMATION in CI set it to empty
# To disable TF_IN_AUTOMATION in CI set it to empty
# https://www.terraform.io/docs/commands/environment-variables.html#tf_in_automation
#
# we are using GNU style quiet commands to disable set V to non-empty e.g. V=1
# We are using GNU style quiet commands to disable set V to non-empty e.g. V=1
# https://www.gnu.org/software/automake/manual/html_node/Debugging-Make-Rules.html
#
ifdef CI
Expand All @@ -28,13 +28,15 @@ ifndef NOCOLOR
RESET := $(shell tput -Txterm sgr0)
endif

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

DOCKER_SSH_FLAGS += -e SSH_AUTH_SOCK=/ssh-agent
DOCKER_SSH_FLAGS += -v ${SSH_AUTH_SOCK}:/ssh-agent

DOCKER_AWS_FLAGS += -e AWS_ACCESS_KEY_ID
DOCKER_AWS_FLAGS += -e AWS_SECRET_ACCESS_KEY
Expand All @@ -54,17 +56,16 @@ template/adjust:

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

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

## Clean up cache and temporary files
.PHONY: clean
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
A [Terraform](https://www.terraform.io) base module for deploying and managing
[IAM Users][IAM-User-Docs] on [Amazon Web Services][AWS].

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

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

Copyright &copy; 2020 [Mineiros GmbH][homepage]
Copyright &copy; 2021 [Mineiros GmbH][homepage]

<!-- References -->

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

[badge-tf-aws]: https://img.shields.io/badge/AWS-3%20and%202.0+-F8991D.svg?logo=terraform
Expand Down
2 changes: 1 addition & 1 deletion examples/require-mfa-credentials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The `AllowManageOwnGitCredentials`, `AllowManageOwnSSHPublicKeys` and `AllowMana
```hcl
module "iam-users" {
source = "mineiros-io/iam-user/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"
names = [
"user.one",
Expand Down
2 changes: 1 addition & 1 deletion examples/require-mfa-credentials/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ provider "aws" {

module "iam-users" {
source = "mineiros-io/iam-user/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"

names = [
"user.one",
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-users/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ provider "aws" {

module "iam-users" {
source = "mineiros-io/iam-user/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"

names = [
"user.one",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/mineiros-io/terraform-aws-iam-user
go 1.14

require (
github.com/gruntwork-io/terratest v0.30.0
github.com/gruntwork-io/terratest v0.34.0
github.com/stretchr/testify v1.4.0
)
Loading

0 comments on commit cc80a49

Please sign in to comment.