From 11dc9ff89bbd62cdf9508e53d55109d5a5918008 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Fri, 31 Jan 2020 18:29:16 +0000 Subject: [PATCH 1/9] Add the files of a minimal module --- main.tf | 7 +++++++ outputs.tf | 0 variables.tf | 0 3 files changed, 7 insertions(+) create mode 100644 main.tf create mode 100644 outputs.tf create mode 100644 variables.tf diff --git a/main.tf b/main.tf new file mode 100644 index 0000000..e03d2e9 --- /dev/null +++ b/main.tf @@ -0,0 +1,7 @@ +# https://www.terraform.io/docs/configuration/terraform.html#terraform-block-syntax. +terraform { + required_version = ">= 0.12.0" + + required_providers { + } +} diff --git a/outputs.tf b/outputs.tf new file mode 100644 index 0000000..e69de29 diff --git a/variables.tf b/variables.tf new file mode 100644 index 0000000..e69de29 From 441e175d99e34f79ea03c5723a593061d06b5bc6 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Fri, 31 Jan 2020 18:31:41 +0000 Subject: [PATCH 2/9] Add the 'examples' and 'modules' folders --- examples/.gitkeep | 0 modules/.gitkeep | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 examples/.gitkeep create mode 100644 modules/.gitkeep diff --git a/examples/.gitkeep b/examples/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/modules/.gitkeep b/modules/.gitkeep new file mode 100644 index 0000000..e69de29 From e23a3f1ef2182bb0a98aa93211fa66547f4df135 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Fri, 31 Jan 2020 18:38:48 +0000 Subject: [PATCH 3/9] Add a readme file --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5d67eb7 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# Terraform Module Template + +Template of a minimal Terraform module. + +This module follows the [standard structure][standard-module-structure] described in the [Terraform documentation][terraform-docs]. + + [standard-module-structure]: https://www.terraform.io/docs/modules/index.html#standard-module-structure "Terraform Documentation - Standard Module Structure" + [terraform-docs]: https://www.terraform.io/docs/ "Terraform Documentation" From 407aedbfa515fd3d4e4aa09fd8323dfac1e7b273 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Fri, 31 Jan 2020 18:40:19 +0000 Subject: [PATCH 4/9] Add a license file --- LICENSE | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..68a49da --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to From 26ae4342ed53455b215273f111f2435cb34a3324 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Sat, 1 Feb 2020 19:12:06 +0000 Subject: [PATCH 5/9] Add pre-commit config file See https://pre-commit.com/. --- .pre-commit-config.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9a1a653 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/antonbabenko/pre-commit-terraform + rev: v1.25.0 + hooks: + - id: terraform_fmt + - id: terraform_validate + - id: terraform_docs From 6853032464f2760572ccfe174e2dd5b07b7f433e Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Sat, 1 Feb 2020 19:16:31 +0000 Subject: [PATCH 6/9] Freeze the pre-commit hooks by using a hash as rev The option '--freeze' of the 'pre-commit autoupdate' command has been used to freeze the version of the remote Git hooks installed by pre-commit by using Git commit IDs instead of Git tags. See https://github.com/pre-commit/pre-commit/issues/1068 for further details. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9a1a653..1398707 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.25.0 + rev: b45a728a922c5916d37060aaa1fdad9b8b702d79 # frozen: v1.25.0 hooks: - id: terraform_fmt - id: terraform_validate From 90d0f6ecaeb843a30c8c46d84d25a4e6cc7075f3 Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Sat, 1 Feb 2020 19:32:33 +0000 Subject: [PATCH 7/9] Add terraform-docs markers in README.md See https://github.com/antonbabenko/pre-commit-terraform#notes-about-terraform_docs-hooks. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5d67eb7..1b75a73 100644 --- a/README.md +++ b/README.md @@ -4,5 +4,9 @@ Template of a minimal Terraform module. This module follows the [standard structure][standard-module-structure] described in the [Terraform documentation][terraform-docs]. + + + + [standard-module-structure]: https://www.terraform.io/docs/modules/index.html#standard-module-structure "Terraform Documentation - Standard Module Structure" [terraform-docs]: https://www.terraform.io/docs/ "Terraform Documentation" From eb8ed1914c255ba0c29f20bb56f43b7f6dc50a4d Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Sat, 1 Feb 2020 19:49:39 +0000 Subject: [PATCH 8/9] Add a gitignore file Taken from https://github.com/github/gitignore. --- .gitignore | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7a3e2fd --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +# Local .terraform directories +**/.terraform/* + +# .tfstate files +*.tfstate +*.tfstate.* + +# Crash log files +crash.log + +# Ignore any .tfvars files that are generated automatically for each Terraform run. Most +# .tfvars files are managed as part of configuration and so should be included in +# version control. +# +# example.tfvars + +# Ignore override files as they are usually used to override resources locally and so +# are not checked in +override.tf +override.tf.json +*_override.tf +*_override.tf.json + +# Include override files you do wish to add to version control using negated pattern +# +# !example_override.tf + +# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan +# example: *tfplan* From dad2cb370fb2e7cc1465776ae3d77855cf18e01e Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Sat, 1 Feb 2020 19:52:20 +0000 Subject: [PATCH 9/9] Ignore some text editor temporary files --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 7a3e2fd..805dca7 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,7 @@ override.tf.json # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan # example: *tfplan* + +# Text editors +*.swp +*~