-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update to current terraform-module-template structure (#10)
Signed-off-by: Andre Licht <[email protected]>
- Loading branch information
Showing
22 changed files
with
323 additions
and
32 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
* @rswrz @lixhunter @Phil-Thoennissen | ||
* @rswrz @lixhunter @Phil-Thoennissen @neonwhiskers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: "Bug Report" | ||
description: "File a bug report." | ||
title: "[Bug]: " | ||
labels: ["bug"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thank you for taking the time to fill out this bug report! | ||
- type: textarea | ||
id: what-happened | ||
attributes: | ||
label: Bug Description | ||
description: "Also tell us, what did you expect to happen?" | ||
placeholder: "Tell us what you see!" | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: version | ||
attributes: | ||
label: Terraform-Version | ||
description: "What version of Terraform are you running?" | ||
placeholder: "Output of 'terraform version'" | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: logs | ||
attributes: | ||
label: Relevant log output | ||
description: "Please copy and paste any relevant log output. This will be automatically formatted." | ||
render: shell | ||
- type: textarea | ||
id: error-message | ||
attributes: | ||
label: Relevant Error Messages | ||
description: "Please copy and paste any relevant error Messages. This will be automatically formatted." | ||
render: shell | ||
- type: textarea | ||
id: additional-info | ||
attributes: | ||
label: Additional Information | ||
description: "Please add any information that might be relevant in solving this bug." | ||
- type: checkboxes | ||
id: terms2 | ||
attributes: | ||
label: Privacy Statement | ||
description: "I acknowledge that this is a public repository and confirm that I have not included any sensitive customer data, internal information, or proprietary details in this report." | ||
options: | ||
- label: I agree | ||
required: true | ||
- type: checkboxes | ||
id: terms | ||
attributes: | ||
label: Code of Conduct | ||
description: "By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/cloudeteer/terraform-governance?tab=coc-ov-file#code-of-conduct)." | ||
options: | ||
- label: I agree to follow this repository's Code of Conduct | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
blank_issues_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: "Feature Request" | ||
description: "Suggest a new feature or improvement." | ||
title: "[Feature Request]: " | ||
labels: ["enhancement"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thank you for taking the time to suggest a feature or improvement! | ||
- type: textarea | ||
id: feature-description | ||
attributes: | ||
label: Feature Description | ||
description: "Please describe the feature or improvement you would like to see." | ||
placeholder: "Provide a detailed explanation of the feature." | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: use-case | ||
attributes: | ||
label: Use Case | ||
description: "What is the problem this feature will solve or the benefit it will provide? How would you use it?" | ||
placeholder: "Explain the context and use case." | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: additional-info | ||
attributes: | ||
label: Additional Information | ||
description: "Any additional context or information that may help with this feature request." | ||
|
||
- type: checkboxes | ||
id: terms2 | ||
attributes: | ||
label: Privacy Statement | ||
description: "I acknowledge that this is a public repository and confirm that I have not included any sensitive customer data, internal information, or proprietary details in this request." | ||
options: | ||
- label: I agree | ||
required: true | ||
|
||
- type: checkboxes | ||
id: terms | ||
attributes: | ||
label: Code of Conduct | ||
description: "By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/cloudeteer/terraform-governance?tab=coc-ov-file#code-of-conduct)." | ||
options: | ||
- label: I agree to follow this repository's Code of Conduct | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
tflint { | ||
required_version = "~> 0.50" | ||
} | ||
|
||
plugin "azurerm" { | ||
enabled = true | ||
version = "0.27.0" | ||
source = "github.com/terraform-linters/tflint-ruleset-azurerm" | ||
} | ||
|
||
rule "terraform_required_version" { | ||
enabled = false | ||
} | ||
|
||
rule "terraform_required_providers" { | ||
enabled = false | ||
} | ||
|
||
rule "terraform_module_version" { | ||
enabled = false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
SHELL := /usr/bin/env bash | ||
|
||
## | ||
# Console Colors | ||
## | ||
GREEN := $(shell tput -Txterm setaf 2) | ||
YELLOW := $(shell tput -Txterm setaf 3) | ||
WHITE := $(shell tput -Txterm setaf 7) | ||
CYAN := $(shell tput -Txterm setaf 6) | ||
RESET := $(shell tput -Txterm sgr0) | ||
|
||
.PHONY: help | ||
help: ## show this help. | ||
@echo 'Usage:' | ||
@echo ' ${GREEN}make${RESET} ${YELLOW}<target>${RESET}' | ||
@echo '' | ||
@echo 'Targets:' | ||
@awk 'BEGIN {FS = ":.*?## "} { \ | ||
if (/^[a-zA-Z_-]+:.*?##.*$$/) {printf " ${GREEN}%-21s${YELLOW}%s${RESET}\n", $$1, $$2} \ | ||
else if (/^## .*$$/) {printf " ${CYAN}%s${RESET}\n", substr($$1,4)} \ | ||
}' $(MAKEFILE_LIST) | ||
|
||
.PHONY: test-examples | ||
test-examples: ## Run tests on examples | ||
@echo "Running tests on examples" | ||
terraform init -test-directory=tests/examples | ||
terraform test -test-directory=tests/examples | ||
|
||
.PHONY: test-local | ||
test-local: ## Run tests on local | ||
@echo "Running tests on local" | ||
terraform init -test-directory=tests/local | ||
terraform test -test-directory=tests/local | ||
|
||
.PHONY: test-remote | ||
test-remote: ## Run tests on remote | ||
@echo "Running tests on remote" | ||
terraform init -test-directory=tests/remote | ||
terraform test -test-directory=tests/remote | ||
|
||
.PHONY: test | ||
test: test-examples test-local test-remote ## Run all tests | ||
|
||
.PHONY: docs | ||
docs: README.md ## Generate Terraform docs and update README.md | ||
|
||
ROOT_TF_FILES := $(wildcard *.tf) | ||
EXAMPLES_TF_FILES := $(shell find ./examples -name '*.tf') | ||
TF_FILES := $(ROOT_TF_FILES) $(EXAMPLES_TF_FILES) | ||
|
||
README.md: $(TF_FILES) .terraform-docs.yaml | ||
@echo "Generating Terraform docs for README.md" | ||
@terraform-docs . --config .terraform-docs.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Example: Usage | ||
|
||
This primary usage example is also included in the [README.md](../../README.md) of this module. | ||
|
||
## Prerequisites | ||
|
||
Before you begin, ensure you have the following: | ||
|
||
- [Terraform](https://www.terraform.io/downloads.html) installed on your local machine. | ||
|
||
## Steps to Deploy | ||
|
||
1. **Initialize the Terraform Configuration** | ||
|
||
Initialize the Terraform configuration to download the necessary providers and modules. | ||
|
||
```shell | ||
terraform init | ||
``` | ||
|
||
2. **Apply the Terraform Configuration** | ||
|
||
Apply the configuration to create the resources defined in your Terraform files. | ||
|
||
```shell | ||
terraform apply | ||
``` | ||
|
||
## Additional Resources | ||
|
||
- [Terraform Configuration Language](https://www.terraform.io/docs/language/index.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
# added to verify azurerm provider is required | ||
data "azurerm_client_config" "current" {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Sub-modules | ||
|
||
Create directories for each sub-module as needed. The `README.md` files for each sub-module will be automatically generated using [terraform-docs](https://terraform-docs.io/user-guide/configuration/recursive/), just like the `README.md` of the primary module. Documentation generation requires a usage example in `./<module>/examples/usage/`, with a `main.tf` file defining the example and a `main.md` file briefly describing it. | ||
|
||
Thus, the minimal file structure of a module is: | ||
|
||
```tree | ||
. | ||
├── README.md | ||
├── examples | ||
│ └── usage | ||
│ ├── main.md | ||
│ └── main.tf | ||
├── inputs.tf | ||
├── main.tf | ||
├── outputs.tf | ||
└── terraform.tf | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
output "hello_world" { | ||
value = "Hello World!" | ||
} | ||
|
||
output "client_id" { | ||
value = data.azurerm_client_config.current.client_id | ||
} | ||
|
||
output "hello_world" { | ||
value = "Hello World!" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
terraform { | ||
required_version = "~> 1.0" | ||
required_version = "~> 1.9" | ||
|
||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "~> 4.0" | ||
version = ">= 4.1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.