generated from silinternational/template-terraform-module
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f5ddd88
Showing
14 changed files
with
231 additions
and
0 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
* @silinternational/tf-devs |
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,17 @@ | ||
### Added | ||
- | ||
|
||
### Changed | ||
- | ||
|
||
### Deprecated | ||
- | ||
|
||
### Removed | ||
- | ||
|
||
### Fixed | ||
- | ||
|
||
### Security | ||
- |
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,38 @@ | ||
# This workflow installs the latest version of Terraform CLI. On pull request events, this workflow will run | ||
# `terraform init`, `terraform fmt`, and `terraform plan`. | ||
# | ||
# Documentation for `hashicorp/setup-terraform` is located here: https://github.com/hashicorp/setup-terraform | ||
|
||
name: 'Terraform' | ||
|
||
on: | ||
push: | ||
branches: ["**"] | ||
|
||
jobs: | ||
terraform: | ||
name: 'Terraform' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout the repository to the GitHub Actions runner | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
# Install the latest version of Terraform CLI | ||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: "<1.6.0" # only use open source version of Terraform | ||
|
||
# Checks that all Terraform configuration files adhere to a canonical format | ||
- name: Terraform Format | ||
run: terraform fmt -check -diff -recursive | ||
|
||
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc. | ||
- name: Terraform Init | ||
run: terraform -chdir=test init | ||
|
||
# Validate the files, referring only to the configuration and not accessing any remote services | ||
- name: Terraform Validate | ||
run: terraform -chdir=test validate |
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,24 @@ | ||
# environment files typically containing secrets | ||
*.env | ||
|
||
# directories created by developer tools | ||
.idea/ | ||
|
||
*.tfstate | ||
*.tfstate.* | ||
# Local .terraform directories | ||
.terraform/ | ||
|
||
# Since this is a module, we don't want to retain version locks | ||
.terraform.lock.hcl | ||
|
||
# Exclude all .tfvars files, which are likely to contain sensitive data, such as | ||
# password, private keys, and other secrets. These should not be part of version | ||
# control as they are data points which are potentially sensitive and subject | ||
# to change depending on the environment. | ||
*.tfvars | ||
*.tfvars.json | ||
|
||
# Ignore CLI configuration files | ||
.terraformrc | ||
terraform.rc |
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 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 SIL International | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
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 OR COPYRIGHT HOLDERS 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. |
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,33 @@ | ||
# Terraform module for ... | ||
|
||
TODO: First https://developer.hashicorp.com/terraform/registry/modules/publish if you have never developed a publishable Terraform module. Then follow those requirements when creating your new module. | ||
|
||
This module ... | ||
|
||
TODO: Change the path in this link: | ||
|
||
This module is published in [Terraform Registry](https://registry.terraform.io/modules/silinternational/module-name/provider-name/latest). | ||
|
||
## Usage Example | ||
|
||
TODO: Update the following as a simple, brief representative sample of the module: | ||
|
||
```hcl | ||
module "this" { | ||
source = "silinternational/module-name/aws" | ||
version = "0.1.0" | ||
variable_name = "my variable value" | ||
} | ||
provider "aws" { | ||
region = "us-east-1" | ||
} | ||
``` | ||
|
||
## Working Example | ||
|
||
TODO: Update or remove this section: | ||
|
||
A working [example](https://github.com/silinternational/terraform-module-name/tree/main/example) usage of this module is included in the source repository. | ||
|
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,12 @@ | ||
/* | ||
* TODO: This example folder is a place to provide a fully-functional example, proving any other required | ||
* resources and typical root module outputs with appropriate `sensitive` flags. It can be removed | ||
* entirely if time does not allow for making it complete. | ||
*/ | ||
|
||
module "this" { | ||
source = "silinternational/module_name/aws" | ||
version = ">= 0.1.0" | ||
|
||
variable_name = "a variable value" | ||
} |
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,10 @@ | ||
provider "aws" { | ||
region = var.aws_region | ||
|
||
default_tags { | ||
tags = { | ||
managed_by = "terraform" | ||
workspace = terraform.workspace | ||
} | ||
} | ||
} |
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,3 @@ | ||
variable "aws_region" { | ||
default = "us-east-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
// TODO: define locals at the top of main.tf | ||
|
||
locals { | ||
a = "a" | ||
} | ||
|
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,5 @@ | ||
output "output_name" { | ||
value = var.variable_name | ||
description = "description of the output" | ||
sensitive = 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,39 @@ | ||
|
||
/* | ||
* TODO: complete these basic instantiations of the module, with the base purpose of | ||
* validating the syntax of module code automatically when pushed to version control. | ||
* One instance should use the minimum allowable set of inputs. The other should have | ||
* the full complement of inputs. You may also wish to include module outputs to | ||
* enforce the presence of module outputs. | ||
*/ | ||
|
||
module "minimal" { | ||
source = "../" | ||
|
||
variable_name = "foo" | ||
} | ||
|
||
module "full" { | ||
source = "../" | ||
|
||
variable_name = "foo" | ||
} | ||
|
||
output "an_output" { | ||
value = module.minimal.output_name | ||
} | ||
|
||
provider "aws" { | ||
region = "us-east-1" | ||
} | ||
|
||
terraform { | ||
required_version = ">= 1.0" | ||
|
||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 5.0" | ||
} | ||
} | ||
} |
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,6 @@ | ||
variable "variable_name" { | ||
description = "Use this order of variable properties: description, type, default, sensitive" | ||
type = string | ||
default = "" | ||
sensitive = 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,15 @@ | ||
terraform { | ||
required_version = ">= 1.0" | ||
|
||
/* | ||
* TODO: add any provider version constraints required by provider features | ||
* only available in later versions. | ||
*/ | ||
|
||
required_providers { | ||
aws = { | ||
version = ">=5.0.0, <6.0" | ||
source = "hashicorp/aws" | ||
} | ||
} | ||
} |