Commit 11f92366 authored by Anton Babenko's avatar Anton Babenko Committed by GitHub

Added pre-commit hook to autogenerate terraform-docs (#127)

parent 55b5991c
repos: repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform - repo: git://github.com/antonbabenko/pre-commit-terraform
sha: v1.4.0 rev: v1.7.0
hooks: hooks:
- id: terraform_fmt - id: terraform_fmt
- id: terraform_docs
- repo: git://github.com/pre-commit/pre-commit-hooks - repo: git://github.com/pre-commit/pre-commit-hooks
sha: v1.2.0 rev: v1.2.3
hooks: hooks:
- id: check-merge-conflict - id: check-merge-conflict
This diff is collapsed.
Complete VPC # Complete VPC
============
Configuration in this directory creates set of VPC resources which may be sufficient for staging or production environment (look into [simple-vpc](../simple-vpc) for more simplified setup). Configuration in this directory creates set of VPC resources which may be sufficient for staging or production environment (look into [simple-vpc](../simple-vpc) for more simplified setup).
There are public, private, database, ElastiCache subnets, NAT Gateways created in each availability zone. There are public, private, database, ElastiCache subnets, NAT Gateways created in each availability zone.
Usage ## Usage
=====
To run this example you need to execute: To run this example you need to execute:
...@@ -17,3 +15,19 @@ $ terraform apply ...@@ -17,3 +15,19 @@ $ terraform apply
``` ```
Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources. Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources.
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Outputs
| Name | Description |
|------|-------------|
| database_subnets | List of IDs of database subnets |
| elasticache_subnets | List of IDs of elasticache subnets |
| nat_public_ips | NAT gateways |
| private_subnets | Subnets |
| public_subnets | List of IDs of public subnets |
| redshift_subnets | List of IDs of redshift subnets |
| vpc_id | VPC |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Issue 108 - VPC # Issue 108 - VPC
==============
Configuration in this directory creates set of VPC resources to cover issues reported on GitHub: Configuration in this directory creates set of VPC resources to cover issues reported on GitHub:
...@@ -7,8 +6,7 @@ Configuration in this directory creates set of VPC resources to cover issues rep ...@@ -7,8 +6,7 @@ Configuration in this directory creates set of VPC resources to cover issues rep
* https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/102#issuecomment-374877706 * https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/102#issuecomment-374877706
* https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/44#issuecomment-378679404 * https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/44#issuecomment-378679404
Usage ## Usage
=====
To run this example you need to execute: To run this example you need to execute:
...@@ -19,3 +17,18 @@ $ terraform apply ...@@ -19,3 +17,18 @@ $ terraform apply
``` ```
Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources. Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources.
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Outputs
| Name | Description |
|------|-------------|
| database_subnets | List of IDs of database subnets |
| elasticache_subnets | List of IDs of elasticache subnets |
| nat_public_ips | NAT gateways |
| private_subnets | Subnets |
| public_subnets | List of IDs of public subnets |
| vpc_id | VPC |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Issue 44 - VPC # Issue 44 - VPC
==============
Configuration in this directory creates set of VPC resources to cover issues reported on GitHub: Configuration in this directory creates set of VPC resources to cover issues reported on GitHub:
* https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/44 * https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/44
Usage ## Usage
=====
To run this example you need to execute: To run this example you need to execute:
...@@ -17,3 +15,18 @@ $ terraform apply ...@@ -17,3 +15,18 @@ $ terraform apply
``` ```
Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources. Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources.
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Outputs
| Name | Description |
|------|-------------|
| database_subnets | List of IDs of database subnets |
| elasticache_subnets | List of IDs of elasticache subnets |
| nat_public_ips | NAT gateways |
| private_subnets | Subnets |
| public_subnets | List of IDs of public subnets |
| vpc_id | VPC |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Issue 46 - VPC # Issue 46 - VPC
==============
Configuration in this directory creates set of VPC resources to cover issues reported on GitHub: Configuration in this directory creates set of VPC resources to cover issues reported on GitHub:
* https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/46 * https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/46
Usage ## Usage
=====
To run this example you need to execute: To run this example you need to execute:
...@@ -17,3 +15,18 @@ $ terraform apply ...@@ -17,3 +15,18 @@ $ terraform apply
``` ```
Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources. Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources.
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Outputs
| Name | Description |
|------|-------------|
| database_subnets | List of IDs of database subnets |
| elasticache_subnets | List of IDs of elasticache subnets |
| nat_public_ips | NAT gateways |
| private_subnets | Subnets |
| public_subnets | List of IDs of public subnets |
| vpc_id | VPC |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Manage Default VPC # Manage Default VPC
==================
Configuration in this directory does not create new VPC resources, but it adopts [Default VPC](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html) created by AWS to allow management of it using Terraform. Configuration in this directory does not create new VPC resources, but it adopts [Default VPC](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html) created by AWS to allow management of it using Terraform.
This is not usual type of resource in Terraform, so use it carefully. More information is [here](https://www.terraform.io/docs/providers/aws/r/default_vpc.html). This is not usual type of resource in Terraform, so use it carefully. More information is [here](https://www.terraform.io/docs/providers/aws/r/default_vpc.html).
Usage ## Usage
=====
To run this example you need to execute: To run this example you need to execute:
...@@ -17,3 +15,14 @@ $ terraform apply ...@@ -17,3 +15,14 @@ $ terraform apply
``` ```
Run `terraform destroy` when you don't need these resources. Run `terraform destroy` when you don't need these resources.
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Outputs
| Name | Description |
|------|-------------|
| default_vpc_cidr_block | The CIDR block of the VPC |
| default_vpc_id | Default VPC |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Simple VPC # Simple VPC
==========
Configuration in this directory creates set of VPC resources which may be sufficient for development environment. Configuration in this directory creates set of VPC resources which may be sufficient for development environment.
There is a public and private subnet created per availability zone in addition to single NAT Gateway shared between all 3 availability zones. There is a public and private subnet created per availability zone in addition to single NAT Gateway shared between all 3 availability zones.
Usage ## Usage
=====
To run this example you need to execute: To run this example you need to execute:
...@@ -17,3 +15,16 @@ $ terraform apply ...@@ -17,3 +15,16 @@ $ terraform apply
``` ```
Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources. Note that this example may create resources which can cost money (AWS Elastic IP, for example). Run `terraform destroy` when you don't need these resources.
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Outputs
| Name | Description |
|------|-------------|
| nat_public_ips | NAT gateways |
| private_subnets | Subnets |
| public_subnets | List of IDs of public subnets |
| vpc_id | VPC |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
...@@ -19,3 +19,19 @@ Finished in 4.25 seconds (files took 2.75 seconds to load) ...@@ -19,3 +19,19 @@ Finished in 4.25 seconds (files took 2.75 seconds to load)
``` ```
This will destroy any existing test resources, create the resources afresh, run the tests, report back, and destroy the resources. This will destroy any existing test resources, create the resources afresh, run the tests, report back, and destroy the resources.
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| region | | string | `eu-west-1` | no |
## Outputs
| Name | Description |
|------|-------------|
| region | Region we created the resources in. |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment