Skip to content

Commit e33c3f9

Browse files
committed
first commit
0 parents  commit e33c3f9

File tree

11 files changed

+211
-0
lines changed

11 files changed

+211
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: pre-commit-check
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: macOS-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
15+
- name: Install prerequisites
16+
run: |
17+
brew install tfenv tflint terraform-docs pre-commit
18+
pre-commit install
19+
tfenv install
20+
- name: pre-commit run all
21+
run: |
22+
pre-commit run -a

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Local .terraform directories
2+
**/.terraform/*
3+
4+
# .tfstate files
5+
*.tfstate
6+
*.tfstate.*
7+
8+
# .tfvars files
9+
*.tfvars

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
repos:
2+
- repo: git://github.com/antonbabenko/pre-commit-terraform
3+
rev: v1.30.0
4+
hooks:
5+
- id: terraform_fmt
6+
- id: terraform_docs
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v3.0.0
9+
hooks:
10+
- id: end-of-file-fixer
11+
- id: trailing-whitespace
12+
- id: no-commit-to-branch

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Rhythmic Technologies, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# terraform-anycloud-template [![](https://github.com/rhythmictech/terraform-anycloud-template/workflows/pre-commit-check/badge.svg)](https://github.com/rhythmictech/terraform-anycloud-template/actions) <a href="https://twitter.com/intent/follow?screen_name=RhythmicTech"><img src="https://img.shields.io/twitter/follow/RhythmicTech?style=social&logo=RhythmicTech" alt="follow on Twitter"></a>
2+
Template repository for terraform modules. Good for any cloud and any provider.
3+
4+
## Example
5+
Here's what using the module will look like
6+
```
7+
module "example" {
8+
source = "rhythmictech/terraform-mycloud-mymodule
9+
}
10+
```
11+
12+
## About
13+
A bit about this module
14+
15+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
16+
## Requirements
17+
18+
No requirements.
19+
20+
## Providers
21+
22+
No provider.
23+
24+
## Inputs
25+
26+
| Name | Description | Type | Default | Required |
27+
|------|-------------|------|---------|:--------:|
28+
| name | Moniker to apply to all resources in the module | `string` | n/a | yes |
29+
| tags | User-Defined tags | `map(string)` | `{}` | no |
30+
31+
## Outputs
32+
33+
| Name | Description |
34+
|------|-------------|
35+
| tags\_module | Tags Module in it's entirety |
36+
37+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
38+
39+
## The Giants underneath this module
40+
- pre-commit.com/
41+
- terraform.io/
42+
- github.com/tfutils/tfenv
43+
- github.com/segmentio/terraform-docs

bin/install-macos.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
echo 'installing brew packages'
4+
brew install tfenv tflint terraform-docs pre-commit
5+
6+
echo 'installing pre-commit hooks'
7+
pre-commit install
8+
9+
echo 'installing terraform with tfenv'
10+
tfenv install

examples/basic/README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# basic example
2+
A basic example for this repository
3+
4+
## Code
5+
Look to [main.tf](./main.tf), or be helpful and copy/paste that code here.
6+
7+
## Applying
8+
```
9+
> alias tf="terraform"
10+
> tf apply
11+
12+
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
13+
14+
Outputs:
15+
16+
example = {
17+
"tags_module" = {
18+
"name" = "TEST"
19+
"name32" = "TEST"
20+
"name6" = "TEST"
21+
"namenosymbols" = "TEST"
22+
"tags" = {
23+
"Name" = "TEST"
24+
"terraform_managed" = true
25+
"terraform_module" = "terraform-terraform-tags-1.0.0"
26+
"terraform_root_module" = "."
27+
"terraform_workspace" = "default"
28+
}
29+
"tags_as_list_of_maps" = [
30+
{
31+
"key" = "Name"
32+
"value" = "TEST"
33+
},
34+
{
35+
"key" = "terraform_managed"
36+
"value" = true
37+
},
38+
{
39+
"key" = "terraform_module"
40+
"value" = "terraform-terraform-tags-1.0.0"
41+
},
42+
{
43+
"key" = "terraform_root_module"
44+
"value" = "."
45+
},
46+
{
47+
"key" = "terraform_workspace"
48+
"value" = "default"
49+
},
50+
]
51+
"tags_no_name" = {
52+
"terraform_managed" = true
53+
"terraform_module" = "terraform-terraform-tags-1.0.0"
54+
"terraform_root_module" = "."
55+
"terraform_workspace" = "default"
56+
}
57+
}
58+
}
59+
```

examples/basic/main.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
module "example" {
3+
source = "../.."
4+
5+
name = "test"
6+
}
7+
8+
output "example" {
9+
value = module.example
10+
}

main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
module "tags" {
3+
source = "rhythmictech/tags/terraform"
4+
version = "1.0.0"
5+
6+
enforce_case = "UPPER"
7+
names = [var.name]
8+
tags = var.tags
9+
}

outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
output "tags_module" {
3+
description = "Tags Module in it's entirety"
4+
value = module.tags
5+
}

0 commit comments

Comments
 (0)