Skip to content

Commit 8ddb90c

Browse files
author
Scott Miller
authored
Merge pull request #7 from rhythmictech/hotfix/null-dep
relax dependency restrictions
2 parents 4dd83f7 + 2d56a10 commit 8ddb90c

8 files changed

+78
-48
lines changed

.pre-commit-config.yaml

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1+
exclude: ".terraform"
12
repos:
23
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.31.0
4+
rev: v1.50.0
45
hooks:
56
- id: terraform_docs
67
always_run: true
78
args:
89
- --args=--sort-by-required
910
- id: terraform_fmt
10-
- id: terraform_tflint
11-
alias: terraform_tflint_deep
12-
name: terraform_tflint_deep
13-
args:
14-
- --args=--deep
1511
- id: terraform_tflint
1612
alias: terraform_tflint_nocreds
1713
name: terraform_tflint_nocreds
1814
- id: terraform_tfsec
15+
args:
16+
- "--args=--exclude-downloaded-modules"
1917
- repo: local
2018
hooks:
2119
- id: terraform_validate
@@ -33,14 +31,15 @@ repos:
3331
cd $(dirname "$FILE")
3432
terraform init --backend=false
3533
terraform validate .
34+
cd ..
3635
done
3736
'
3837
language: system
3938
verbose: true
4039
files: \.tf(vars)?$
4140
exclude: examples
4241
- repo: https://github.com/pre-commit/pre-commit-hooks
43-
rev: v3.0.0
42+
rev: v3.4.0
4443
hooks:
4544
- id: check-case-conflict
4645
- id: check-json

.terraform-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
latest:^0.14

.tflint.hcl

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
config {
22
module = true
3-
deep_check = false
43
}
54

65
rule "terraform_deprecated_interpolation" {

README.md

+52-30
Original file line numberDiff line numberDiff line change
@@ -33,51 +33,73 @@ Creates a password with a Lambda data source and saves it in a secrets manager s
3333

3434
| Name | Version |
3535
|------|---------|
36-
| terraform | >= 0.12.28 |
37-
| aws | >= 2.45, < 4.0 |
38-
| external | ~> 1.2 |
39-
| null | ~> 2.1 |
40-
| random | ~> 2.3 |
36+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.28 |
37+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.45 |
38+
| <a name="requirement_external"></a> [external](#requirement\_external) | >= 1.2 |
39+
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 2.1 |
40+
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.3 |
4141

4242
## Providers
4343

4444
| Name | Version |
4545
|------|---------|
46-
| aws | >= 2.45, < 4.0 |
47-
| external | ~> 1.2 |
48-
| null | ~> 2.1 |
49-
| random | ~> 2.3 |
46+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.45 |
47+
| <a name="provider_external"></a> [external](#provider\_external) | >= 1.2 |
48+
| <a name="provider_null"></a> [null](#provider\_null) | >= 2.1 |
49+
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.3 |
50+
51+
## Modules
52+
53+
| Name | Source | Version |
54+
|------|--------|---------|
55+
| <a name="module_lambda_invocation"></a> [lambda\_invocation](#module\_lambda\_invocation) | matti/resource/shell | ~>1.0.7 |
56+
| <a name="module_lambda_invocation_result"></a> [lambda\_invocation\_result](#module\_lambda\_invocation\_result) | matti/resource/shell | ~>1.0.7 |
57+
| <a name="module_lambda_version"></a> [lambda\_version](#module\_lambda\_version) | rhythmictech/find-release-by-semver/github | ~> 1.0 |
58+
59+
## Resources
60+
61+
| Name | Type |
62+
|------|------|
63+
| [aws_iam_role.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
64+
| [aws_iam_role_policy.secret_write](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
65+
| [aws_iam_role_policy_attachment.lambda_basic_execution](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
66+
| [aws_lambda_function.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource |
67+
| [aws_secretsmanager_secret.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/secretsmanager_secret) | resource |
68+
| [null_resource.lambda_zip](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
69+
| [random_string.trigger](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
70+
| [aws_iam_policy_document.assume](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
71+
| [aws_iam_policy_document.secret_write](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
72+
| [external_external.sha](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/external) | data source |
5073

5174
## Inputs
5275

5376
| Name | Description | Type | Default | Required |
5477
|------|-------------|------|---------|:--------:|
55-
| length | Length of the password to be created | `number` | n/a | yes |
56-
| name | Moniker to apply to all resources in the module | `string` | n/a | yes |
57-
| keepers | Arbitrary map of values that when changed will force a new password | `map(string)` | `{}` | no |
58-
| lambda\_version\_constraint | NPM-style version constraint for the version of the lambda code you want to use | `string` | `"^1.0.3"` | no |
59-
| lower | Whether to use lower case characters | `bool` | `true` | no |
60-
| min\_lower | Minimum number of lowercase letters | `number` | `0` | no |
61-
| min\_numeric | Minimum number of numeric characters to use. Must be at least 1 | `number` | `1` | no |
62-
| min\_special | Minimum number of special characters to use. Must be at least 1 | `number` | `1` | no |
63-
| min\_upper | Minimum number of uppercase characters to use. Must be at least 1 | `number` | `1` | no |
64-
| number | Whether to use numbers | `bool` | `true` | no |
65-
| override\_special | Supply your own list of special characters to use for string generation | `string` | `"!@#$%&*()-_=+[]{}<>:?"` | no |
66-
| secret\_description | Set a description for the secret | `string` | `"A password created by Terraform"` | no |
67-
| special | Whether to use special characters | `bool` | `true` | no |
68-
| tags | User-Defined tags | `map(string)` | `{}` | no |
69-
| upper | Whether to use uppercase characters | `bool` | `true` | no |
78+
| <a name="input_length"></a> [length](#input\_length) | Length of the password to be created | `number` | n/a | yes |
79+
| <a name="input_name"></a> [name](#input\_name) | Moniker to apply to all resources in the module | `string` | n/a | yes |
80+
| <a name="input_keepers"></a> [keepers](#input\_keepers) | Arbitrary map of values that when changed will force a new password | `map(string)` | `{}` | no |
81+
| <a name="input_lambda_version_constraint"></a> [lambda\_version\_constraint](#input\_lambda\_version\_constraint) | NPM-style version constraint for the version of the lambda code you want to use | `string` | `"^1.0.3"` | no |
82+
| <a name="input_lower"></a> [lower](#input\_lower) | Whether to use lower case characters | `bool` | `true` | no |
83+
| <a name="input_min_lower"></a> [min\_lower](#input\_min\_lower) | Minimum number of lowercase letters | `number` | `0` | no |
84+
| <a name="input_min_numeric"></a> [min\_numeric](#input\_min\_numeric) | Minimum number of numeric characters to use. Must be at least 1 | `number` | `1` | no |
85+
| <a name="input_min_special"></a> [min\_special](#input\_min\_special) | Minimum number of special characters to use. Must be at least 1 | `number` | `1` | no |
86+
| <a name="input_min_upper"></a> [min\_upper](#input\_min\_upper) | Minimum number of uppercase characters to use. Must be at least 1 | `number` | `1` | no |
87+
| <a name="input_number"></a> [number](#input\_number) | Whether to use numbers | `bool` | `true` | no |
88+
| <a name="input_override_special"></a> [override\_special](#input\_override\_special) | Supply your own list of special characters to use for string generation | `string` | `"!@#$%&*()-_=+[]{}<>:?"` | no |
89+
| <a name="input_secret_description"></a> [secret\_description](#input\_secret\_description) | Set a description for the secret | `string` | `"A password created by Terraform"` | no |
90+
| <a name="input_special"></a> [special](#input\_special) | Whether to use special characters | `bool` | `true` | no |
91+
| <a name="input_tags"></a> [tags](#input\_tags) | User-Defined tags | `map(string)` | `{}` | no |
92+
| <a name="input_upper"></a> [upper](#input\_upper) | Whether to use uppercase characters | `bool` | `true` | no |
7093

7194
## Outputs
7295

7396
| Name | Description |
7497
|------|-------------|
75-
| lambda\_version | The selected version of the Lambda code |
76-
| lambda\_version\_info | all information about the selected version of the Lambda code |
77-
| result | String result of Lambda execution |
78-
| secret\_arn | ARN of the secret containing the password |
79-
| secret\_name | Name of the secret containing the password |
80-
98+
| <a name="output_lambda_version"></a> [lambda\_version](#output\_lambda\_version) | The selected version of the Lambda code |
99+
| <a name="output_lambda_version_info"></a> [lambda\_version\_info](#output\_lambda\_version\_info) | all information about the selected version of the Lambda code |
100+
| <a name="output_result"></a> [result](#output\_result) | String result of Lambda execution |
101+
| <a name="output_secret_arn"></a> [secret\_arn](#output\_secret\_arn) | ARN of the secret containing the password |
102+
| <a name="output_secret_name"></a> [secret\_name](#output\_secret\_name) | Name of the secret containing the password |
81103
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
82104

83105
## The Giants Underneath this Module

bin/install-macos.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ git config --global init.templateDir ~/.git-template
1414
pre-commit init-templatedir ~/.git-template
1515

1616
echo 'installing terraform with tfenv'
17-
tfenv install min-required
18-
tfenv use min-required
17+
tfenv install

bin/install-ubuntu.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
echo 'installing dependencies'
44
sudo apt install python3-pip gawk &&\
55
pip3 install pre-commit
6-
curl -sL "$(curl -sL https://api.github.com/repos/segmentio/terraform-docs/releases/latest | grep -o -E "https://.+?-linux-amd64")" > terraform-docs && chmod +x terraform-docs && sudo mv terraform-docs /usr/bin/
7-
curl -sL "$(curl -sL https://api.github.com/repos/terraform-linters/tflint/releases/latest | grep -o -E "https://.+?_linux_amd64.zip")" > tflint.zip && unzip tflint.zip && rm tflint.zip && sudo mv tflint /usr/bin/
6+
tfdocs_latest_dl_url=$(curl -sL https://api.github.com/repos/terraform-docs/terraform-docs/releases/latest | grep -o -E "https://.+?-linux-amd64" | tail -n1)
7+
curl -L "$tfdocs_latest_dl_url" > terraform-docs && chmod +x terraform-docs && sudo mv terraform-docs /usr/bin/
8+
curl -L "$(curl -sL https://api.github.com/repos/terraform-linters/tflint/releases/latest | grep -o -E "https://.+?_linux_amd64.zip")" > tflint.zip && unzip tflint.zip && rm tflint.zip && sudo mv tflint /usr/bin/
89
env GO111MODULE=on go get -u github.com/liamg/tfsec/cmd/tfsec
910
git clone https://github.com/tfutils/tfenv.git ~/.tfenv || true
1011
mkdir -p ~/.local/bin/
@@ -19,5 +20,4 @@ git config --global init.templateDir ~/.git-template
1920
pre-commit init-templatedir ~/.git-template
2021

2122
echo 'installing terraform with tfenv'
22-
tfenv install min-required
23-
tfenv use min-required
23+
tfenv install

bin/install.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#! /bin/bash
2+
unameOut="$(uname -s)"
3+
case "${unameOut}" in
4+
Linux*)
5+
./bin/install-ubuntu.sh
6+
;;
7+
Darwin*)
8+
./bin/install-macos.sh
9+
;;
10+
esac

versions.tf

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 2.45, < 4.0"
7+
version = ">= 2.45"
88
}
99

1010
external = {
1111
source = "hashicorp/external"
12-
version = "~> 1.2"
12+
version = ">= 1.2"
1313
}
1414

1515
null = {
1616
source = "hashicorp/null"
17-
version = "~> 2.1"
17+
version = ">= 2.1"
1818
}
1919

2020
random = {
2121
source = "hashicorp/random"
22-
version = "~> 2.3"
22+
version = ">= 2.3"
2323
}
2424
}
2525
}

0 commit comments

Comments
 (0)