Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
qbart authored Apr 4, 2024
0 parents commit 9282bfa
Show file tree
Hide file tree
Showing 16 changed files with 283 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Generate terraform docs
on:
- pull_request

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Render terraform docs and push changes back to PR
uses: terraform-docs/[email protected]
with:
find-dir: .
output-file: README.md
output-method: inject
git-push: "true"
git-commit-message: "chore: Update terraform docs"
36 changes: 36 additions & 0 deletions .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Terraform Lint
on:
- pull_request

jobs:
tflint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
name: Checkout source code

- uses: actions/cache@v3
name: Cache plugin dir
with:
path: ~/.tflint.d/plugins
key: tflint-${{ hashFiles('.tflint.hcl') }}

- uses: terraform-linters/setup-tflint@v3
name: Setup TFLint
with:
tflint_version: v0.45.0

- name: Show version
run: tflint --version

- name: Init TFLint
run: tflint --init
env:
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
GITHUB_TOKEN: ${{ github.token }}

- name: Run TFLint
run: |
tflint -f compact .
tflint -f compact modules/rename_me
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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
*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*
/tmp/

.DS_Store
*.pem
4 changes: 4 additions & 0 deletions .terraform-docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
settings:
color: true
hide-empty: true
indent: 2
6 changes: 6 additions & 0 deletions .terraformignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git/
/tmp/
/bin/
*.md
*.tfstate
LICENSE
11 changes: 11 additions & 0 deletions .tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
plugin "terraform" {
enabled = true
version = "0.2.2"
source = "github.com/terraform-linters/tflint-ruleset-terraform"
}

plugin "aws" {
enabled = true
version = "0.21.2"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}
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) 2022 Selleo

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.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Terraform RENAME_ME module

TODO

<!-- BEGIN_TF_DOCS -->

<!-- END_TF_DOCS -->

## LICENSE

See `LICENSE` file.

## About Selleo

![selleo](https://raw.githubusercontent.com/Selleo/selleo-resources/master/public/github_footer.png)

Software development teams with an entrepreneurial sense of ownership at their core delivering great digital products and building culture people want to belong to. We are a community of engaged co-workers passionate about crafting impactful web solutions which transform the way our clients do business.

All names and logos for [Selleo](https://selleo.com/about) are trademark of Selleo Labs Sp. z o.o. (formerly Selleo Sp. z o.o. Sp.k.)
28 changes: 28 additions & 0 deletions examples/rename_me/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Example

<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_random"></a> [random](#provider\_random) | n/a |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | n/a |

## Resources

| Name | Type |
|------|------|
| [random_id.example](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) | resource |
<!-- END_TF_DOCS -->
21 changes: 21 additions & 0 deletions examples/rename_me/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "random_id" "example" {
byte_length = 4

prefix = "tf-example"
}

module "vpc" {
source = "terraform-aws-modules/vpc/aws"

name = random_id.example.hex
cidr = "10.0.0.0/16"

azs = ["eu-central-1a", "eu-central-1b"]
private_subnets = ["10.0.1.0/24"]
public_subnets = ["10.0.101.0/24", "10.0.102.0/24"]

single_nat_gateway = true
enable_nat_gateway = false
enable_vpn_gateway = false
}

15 changes: 15 additions & 0 deletions examples/rename_me/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
terraform {
required_version = "~> 1.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}

provider "aws" {
region = "eu-central-1"
}

33 changes: 33 additions & 0 deletions modules/rename_me/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 4.0 |

## Resources

| Name | Type |
|------|------|
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_context"></a> [context](#input\_context) | Project context. | <pre>object({<br> namespace = string<br> stage = string<br> name = string<br> })</pre> | n/a | yes |
| <a name="input_todo"></a> [todo](#input\_todo) | todo | `string` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_todo"></a> [todo](#output\_todo) | TODO. |
<!-- END_TF_DOCS -->
3 changes: 3 additions & 0 deletions modules/rename_me/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_region" "current" {}

locals {}
5 changes: 5 additions & 0 deletions modules/rename_me/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
output "todo" {
description = "TODO."

value = ""
}
18 changes: 18 additions & 0 deletions modules/rename_me/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
variable "context" {
description = "Project context."

type = object({
namespace = string
stage = string
name = string
})
}

variable "todo" {
description = "todo"

type = string
}

# optional

11 changes: 11 additions & 0 deletions modules/rename_me/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
terraform {
required_version = "~> 1.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}

0 comments on commit 9282bfa

Please sign in to comment.