Skip to content

Commit 66cb8b1

Browse files
Merge pull request #57 from mineiros-io/soerenmartius/refactor
Upgrade tests from template
2 parents 5879667 + 985e154 commit 66cb8b1

20 files changed

+1350
-379
lines changed

.golangci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# ----------------------------------------------------------------------------------------------------------------------
2+
# GOLANG LINTER RULES
3+
# ----------------------------------------------------------------------------------------------------------------------
4+
5+
# configure golangci-lint
6+
# see https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
7+
issues:
8+
exclude-rules:
9+
- path: _test\.go
10+
linters:
11+
- dupl
12+
- gosec
13+
- goconst
14+
linters:
15+
enable:
16+
- bodyclose
17+
- deadcode
18+
- depguard
19+
- dupl
20+
- errcheck
21+
- gocritic
22+
- gofmt
23+
- goconst
24+
- goimports
25+
- gosec
26+
- gosimple
27+
- revive
28+
- govet
29+
- ineffassign
30+
- interfacer
31+
- misspell
32+
- nakedret
33+
- prealloc
34+
- staticcheck
35+
- structcheck
36+
- stylecheck
37+
- typecheck
38+
- unconvert
39+
- unparam
40+
- unused
41+
- varcheck
42+
- whitespace
43+
44+
linters-settings:
45+
errcheck:
46+
# report about assignment of errors to blank identifier: `num, _ := strcnv.Atoi(numStr)`;
47+
# default is false: such cases aren't reported by default.
48+
check-blank: true
49+
ignore: fmt:.*,[rR]ead|[wW]rite|[cC]lose,io:Copy
50+
govet:
51+
# report about shadowed variables
52+
check-shadowing: true
53+
gocyclo:
54+
# minimal code complexity to report, 30 by default
55+
min-complexity: 15
56+
maligned:
57+
# print struct with more effective memory layout or not, false by default
58+
suggest-new: true
59+
gofmt:
60+
# simplify code: gofmt with `-s` option, true by default
61+
simplify: true

.pre-commit-config.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
repos:
22
- repo: https://github.com/mineiros-io/pre-commit-hooks
3-
rev: v0.2.3
3+
rev: v0.3.0
44
hooks:
55
- id: terraform-fmt
66
- id: terraform-validate
77
exclude: ^examples|.terraform/
88
- id: tflint
9-
- id: gofmt
10-
- id: goimports
119
- id: golangci-lint
1210
- id: phony-targets
1311
- id: markdown-link-check

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Add support for `module_tags`
13+
1014
## [0.9.0]
1115

1216
### BREAKING

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Set default shell to bash
22
SHELL := /bin/bash -o pipefail
33

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

@@ -36,6 +36,10 @@ GIT_TOPLEVEl = $(shell git rev-parse --show-toplevel)
3636
DOCKER_RUN_FLAGS += -v ${GIT_TOPLEVEl}:/build
3737
DOCKER_RUN_FLAGS += --rm
3838
DOCKER_RUN_FLAGS += -e TF_IN_AUTOMATION
39+
# If TF_VERSION is defined, TFSwitch will switch to the desired version on
40+
# container startup. If TF_VERSION is omitted, the default version installed
41+
# inside the docker image will be used.
42+
DOCKER_RUN_FLAGS += -e TF_VERSION
3943

4044
# If SSH_AUTH_SOCK is set, we forward the SSH agent of the host system into
4145
# the docker container. This is useful when working with private repositories

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,35 @@ for details and use-cases.
8989

9090
#### Module Configuration
9191

92-
- **`module_enabled`**: *(Optional `bool`)*
92+
- **`module_enabled`**: _(Optional `bool`)_
9393

9494
Specifies whether resources in the module will be created.
9595
Default is `true`.
9696

97-
- **`module_depends_on`**: *(Optional `list(any)`)*
97+
- **`module_tags`**: _(Optional `map(string)`)_
9898

99-
A list of dependencies. Any object can be _assigned_ to this list to define a
100-
hidden external dependency. Default is `[]`.
99+
A map of tags that will be applied to all created resources that accept tags. Tags defined with 'module_tags' can be
100+
overwritten by resource-specific tags.
101+
Default is `{}`.
102+
103+
Example:
104+
```hcl
105+
module_tags = {
106+
environment = "staging"
107+
team = "platform"
108+
}
109+
```
110+
111+
- **`module_depends_on`**: _(Optional `list(dependencies)`)_
112+
113+
A list of dependencies. Any object can be _assigned_ to this list to define a hidden external dependency.
114+
115+
Example:
116+
```hcl
117+
module_depends_on = [
118+
aws_vpc.vpc
119+
]
120+
```
101121

102122
#### Cognito User Pool
103123

go.mod

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
1-
module github.com/mineiros/terraform-aws-cognito-user-pool
1+
module github.com/mineiros-io/terraform-aws-cognito-user-pool
22

3-
go 1.14
3+
go 1.17
44

5-
require github.com/gruntwork-io/terratest v0.30.0
5+
require (
6+
github.com/gruntwork-io/terratest v0.38.2
7+
github.com/stretchr/testify v1.7.0
8+
)
9+
10+
require (
11+
github.com/agext/levenshtein v1.2.3 // indirect
12+
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
13+
github.com/davecgh/go-spew v1.1.1 // indirect
14+
github.com/hashicorp/errwrap v1.0.0 // indirect
15+
github.com/hashicorp/go-multierror v1.1.0 // indirect
16+
github.com/hashicorp/hcl/v2 v2.9.1 // indirect
17+
github.com/hashicorp/terraform-json v0.12.0 // indirect
18+
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a // indirect
19+
github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326 // indirect
20+
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
21+
github.com/pmezard/go-difflib v1.0.0 // indirect
22+
github.com/tmccombs/hcl2json v0.3.3 // indirect
23+
github.com/zclconf/go-cty v1.8.1 // indirect
24+
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
25+
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
26+
golang.org/x/sys v0.0.0-20210603125802-9665404d3644 // indirect
27+
golang.org/x/text v0.3.6 // indirect
28+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
29+
)

0 commit comments

Comments
 (0)