Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt authored Sep 11, 2024
0 parents commit f5ddd88
Show file tree
Hide file tree
Showing 14 changed files with 231 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @silinternational/tf-devs
17 changes: 17 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### Added
-

### Changed
-

### Deprecated
-

### Removed
-

### Fixed
-

### Security
-
38 changes: 38 additions & 0 deletions .github/workflows/terraform.yml
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
24 changes: 24 additions & 0 deletions .gitignore
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
21 changes: 21 additions & 0 deletions LICENSE
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.
33 changes: 33 additions & 0 deletions README.md
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.

12 changes: 12 additions & 0 deletions example/main.tf
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"
}
10 changes: 10 additions & 0 deletions example/providers.tf
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
}
}
}
3 changes: 3 additions & 0 deletions example/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
variable "aws_region" {
default = "us-east-1"
}
7 changes: 7 additions & 0 deletions main.tf
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"
}

5 changes: 5 additions & 0 deletions outputs.tf
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
}
39 changes: 39 additions & 0 deletions test/main.tf
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"
}
}
}
6 changes: 6 additions & 0 deletions variables.tf
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
}
15 changes: 15 additions & 0 deletions versions.tf
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"
}
}
}

0 comments on commit f5ddd88

Please sign in to comment.