Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automating terraform docs #6

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6deab8d
automating terraform docs
angela-lee1 May 6, 2024
d5ff680
another approach to dynamic generate terraform docs
angela-lee1 May 9, 2024
feb4958
change people-depot dev us-east-2 to trigger
angela-lee1 May 9, 2024
5c8b485
modification
angela-lee1 May 9, 2024
55b62aa
modification
angela-lee1 May 9, 2024
0c60928
change people-depot project region us-east-2 for testing
angela-lee1 May 9, 2024
01ba7bb
fix terraform-doc gha not found error
angela-lee1 May 9, 2024
72092a0
set git user
angela-lee1 May 9, 2024
0a11ce7
push changes
angela-lee1 May 9, 2024
38ea3ac
Update Terraform docs
angela-lee1 May 9, 2024
9cc61af
Update Terraform docs
angela-lee1 May 9, 2024
1e45508
Update Terraform docs
angela-lee1 May 9, 2024
5b56750
Update Terraform docs
angela-lee1 May 9, 2024
d99d1c7
Update Terraform docs
angela-lee1 May 9, 2024
5d1494a
Update Terraform docs
angela-lee1 May 9, 2024
fbe43ce
Update Terraform docs
angela-lee1 May 9, 2024
73c1485
Update Terraform docs
angela-lee1 May 9, 2024
f7aff5f
Update Terraform docs
angela-lee1 May 9, 2024
1f48446
Update Terraform docs
angela-lee1 May 9, 2024
c7916fd
Update Terraform docs
angela-lee1 May 9, 2024
e4b0905
Update Terraform docs
angela-lee1 May 9, 2024
77d23ea
Update Terraform docs
angela-lee1 May 9, 2024
00bdf57
Update Terraform docs
angela-lee1 May 9, 2024
d33edae
Update Terraform docs
angela-lee1 May 9, 2024
9df3f8b
Update Terraform docs
angela-lee1 May 9, 2024
4a6ff7e
Update Terraform docs
angela-lee1 May 9, 2024
3161c60
Update Terraform docs
angela-lee1 May 9, 2024
87f6ddf
Update Terraform docs
angela-lee1 May 9, 2024
9f2302e
Update Terraform docs
angela-lee1 May 9, 2024
0140499
Update Terraform docs
angela-lee1 May 9, 2024
cb478b6
Update Terraform docs
angela-lee1 May 9, 2024
951ea25
Update Terraform docs
angela-lee1 May 9, 2024
77ca6cc
Update Terraform docs
angela-lee1 May 9, 2024
a82ecc2
Update Terraform docs
angela-lee1 May 9, 2024
1acbeae
Update Terraform docs
angela-lee1 May 9, 2024
4dc3c77
Update Terraform docs
angela-lee1 May 9, 2024
c4ec9d2
Update Terraform docs
angela-lee1 May 9, 2024
2600735
Update Terraform docs
angela-lee1 May 9, 2024
95f7303
Update Terraform docs
angela-lee1 May 9, 2024
9b7a1f1
Update Terraform docs
angela-lee1 May 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Generate terraform docs
on:
pull_request:
paths:
- "**/*.tf"

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

- name: Install Terraform Docs
run: |
curl -LJO https://github.com/terraform-docs/terraform-docs/releases/download/v0.15.0/terraform-docs-v0.15.0-linux-amd64.tar.gz
tar -xzf terraform-docs-v0.15.0-linux-amd64.tar.gz
sudo mv terraform-docs /usr/local/bin/
rm terraform-docs-v0.15.0-linux-amd64.tar.gz

- name: Set Git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "awlfccamp"

- name: Generate and commit Terraform docs for each directory
run: |
find . -type f -name "*.tf" -exec dirname {} \; | sort -u | while read -r directory; do
echo "Generating Terraform docs for $directory"
terraform-docs markdown "${directory}" > "${directory}/README.md"
git -C "${directory}" add README.md
git -C "${directory}" commit -m "Update Terraform docs"
done

- name: Push changes to GitHub
run: git push
23 changes: 23 additions & 0 deletions incubator/shared-resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Requirements

No requirements.

## Providers

No providers.

## Modules

No modules.

## Resources

No resources.

## Inputs

No inputs.

## Outputs

No outputs.
32 changes: 15 additions & 17 deletions terraform-incubator/access-the-data/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<!-- BEGIN_TF_DOCS -->
# Groups
## Requirements

This module declares all of the resources necessary to create AWS IAM groups.
| Name | Version |
|------|---------|
| <a name="requirement_postgresql"></a> [postgresql](#requirement\_postgresql) | ~> 1.21.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
| <a name="provider_terraform"></a> [terraform](#provider\_terraform) | n/a |

## Modules

Expand All @@ -13,6 +20,7 @@ This module declares all of the resources necessary to create AWS IAM groups.
| <a name="module_datastore_database"></a> [datastore\_database](#module\_datastore\_database) | ../../terraform-modules/database | n/a |
| <a name="module_secrets"></a> [secrets](#module\_secrets) | ../../terraform-modules/cheap-secrets | n/a |
| <a name="module_zone"></a> [zone](#module\_zone) | ../../terraform-modules/project-zone | n/a |

## Resources

| Name | Type |
Expand All @@ -21,20 +29,10 @@ This module declares all of the resources necessary to create AWS IAM groups.
| [aws_ssm_parameter.rds_credentials](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssm_parameter) | data source |
| [terraform_remote_state.shared](https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/data-sources/remote_state) | data source |

## Inputs

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
| <a name="provider_terraform"></a> [terraform](#provider\_terraform) | n/a |
## Requirements
No inputs.

| Name | Version |
|------|---------|
| <a name="requirement_postgresql"></a> [postgresql](#requirement\_postgresql) | ~> 1.21.0 |
## Outputs

To automatically update this documentation, install terraform-docs on your local machine run the following:
cd <directory of README location to update>
terraform-docs -c .terraform.docs.yml .
<!-- END_TF_DOCS -->
No outputs.
28 changes: 28 additions & 0 deletions terraform-incubator/people-depot/dev/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Requirements

No requirements.

## Providers

No providers.

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_dev"></a> [dev](#module\_dev) | ../project | n/a |

## Resources

No resources.

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_app_db_password"></a> [app\_db\_password](#input\_app\_db\_password) | n/a | `string` | n/a | yes |
| <a name="input_root_db_password"></a> [root\_db\_password](#input\_root\_db\_password) | root database password | `string` | n/a | yes |

## Outputs

No outputs.
2 changes: 1 addition & 1 deletion terraform-incubator/people-depot/dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ terraform {
}

provider "aws" {
region = "us-west-2"
region = "us-east-2"
}

variable "root_db_password" {
Expand Down
24 changes: 11 additions & 13 deletions terraform-incubator/people-depot/project/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
<!-- BEGIN_TF_DOCS -->
# Groups
## Requirements

This module declares all of the resources necessary to create AWS IAM groups.
No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_terraform"></a> [terraform](#provider\_terraform) | n/a |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_people_depot"></a> [people\_depot](#module\_people\_depot) | ../../../terraform-modules/service | n/a |

## Resources

| Name | Type |
|------|------|
| [terraform_remote_state.shared](https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/data-sources/remote_state) | data source |

## Inputs

| Name | Description | Type | Default | Required |
Expand All @@ -22,14 +28,6 @@ This module declares all of the resources necessary to create AWS IAM groups.
| <a name="input_container_image"></a> [container\_image](#input\_container\_image) | n/a | `string` | n/a | yes |
| <a name="input_root_db_password"></a> [root\_db\_password](#input\_root\_db\_password) | root database password | `string` | n/a | yes |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_terraform"></a> [terraform](#provider\_terraform) | n/a |

## Outputs

To automatically update this documentation, install terraform-docs on your local machine run the following:
cd <directory of README location to update>
terraform-docs -c .terraform.docs.yml .
<!-- END_TF_DOCS -->
No outputs.
2 changes: 1 addition & 1 deletion terraform-incubator/people-depot/project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ data "terraform_remote_state" "shared" {
dynamodb_table = "terraform-locks"
encrypt = true
key = "terragrunt-states/incubator/./terraform.tfstate"
region = "us-west-2"
region = "us-east-2"
}
}

Expand Down
27 changes: 27 additions & 0 deletions terraform-incubator/shared_resources/acm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Requirements

No requirements.

## Providers

No providers.

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_acm"></a> [acm](#module\_acm) | ../../../terraform-modules/acm | n/a |

## Resources

No resources.

## Inputs

No inputs.

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_acm_certificate_arns"></a> [acm\_certificate\_arns](#output\_acm\_certificate\_arns) | n/a |
38 changes: 38 additions & 0 deletions terraform-incubator/shared_resources/alb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_terraform"></a> [terraform](#provider\_terraform) | n/a |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_alb"></a> [alb](#module\_alb) | ../../../terraform-modules/applicationlb | n/a |

## Resources

| Name | Type |
|------|------|
| [terraform_remote_state.shared](https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/data-sources/remote_state) | data source |

## Inputs

No inputs.

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_alb_https_listener_arn"></a> [alb\_https\_listener\_arn](#output\_alb\_https\_listener\_arn) | n/a |
| <a name="output_alb_id"></a> [alb\_id](#output\_alb\_id) | n/a |
| <a name="output_alb_target_group_arn"></a> [alb\_target\_group\_arn](#output\_alb\_target\_group\_arn) | n/a |
| <a name="output_alb_target_group_id"></a> [alb\_target\_group\_id](#output\_alb\_target\_group\_id) | n/a |
| <a name="output_lb_arn"></a> [lb\_arn](#output\_lb\_arn) | n/a |
| <a name="output_lb_dns_name"></a> [lb\_dns\_name](#output\_lb\_dns\_name) | n/a |
| <a name="output_lb_zone_id"></a> [lb\_zone\_id](#output\_lb\_zone\_id) | n/a |
| <a name="output_security_group_id"></a> [security\_group\_id](#output\_security\_group\_id) | n/a |
41 changes: 41 additions & 0 deletions terraform-incubator/shared_resources/all/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_terraform"></a> [terraform](#provider\_terraform) | n/a |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [terraform_remote_state.shared](https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/data-sources/remote_state) | data source |

## Inputs

No inputs.

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_alb_arn"></a> [alb\_arn](#output\_alb\_arn) | XXX individual outputs are not preferred - instead use the configuration output |
| <a name="output_alb_external_dns"></a> [alb\_external\_dns](#output\_alb\_external\_dns) | n/a |
| <a name="output_alb_https_listener_arn"></a> [alb\_https\_listener\_arn](#output\_alb\_https\_listener\_arn) | n/a |
| <a name="output_alb_security_group_id"></a> [alb\_security\_group\_id](#output\_alb\_security\_group\_id) | n/a |
| <a name="output_alb_zone_id"></a> [alb\_zone\_id](#output\_alb\_zone\_id) | n/a |
| <a name="output_cluster_id"></a> [cluster\_id](#output\_cluster\_id) | n/a |
| <a name="output_cluster_name"></a> [cluster\_name](#output\_cluster\_name) | n/a |
| <a name="output_configuration"></a> [configuration](#output\_configuration) | n/a |
| <a name="output_db_identifier"></a> [db\_identifier](#output\_db\_identifier) | n/a |
| <a name="output_db_instance_endpoint"></a> [db\_instance\_endpoint](#output\_db\_instance\_endpoint) | n/a |
| <a name="output_public_subnet_ids"></a> [public\_subnet\_ids](#output\_public\_subnet\_ids) | n/a |
| <a name="output_task_execution_role_arn"></a> [task\_execution\_role\_arn](#output\_task\_execution\_role\_arn) | n/a |
| <a name="output_vpc_id"></a> [vpc\_id](#output\_vpc\_id) | n/a |
30 changes: 30 additions & 0 deletions terraform-incubator/shared_resources/ecs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_terraform"></a> [terraform](#provider\_terraform) | n/a |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_ecs"></a> [ecs](#module\_ecs) | ../../../terraform-modules/ecs | n/a |

## Resources

| Name | Type |
|------|------|
| [terraform_remote_state.alb](https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/data-sources/remote_state) | data source |
| [terraform_remote_state.network](https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/data-sources/remote_state) | data source |

## Inputs

No inputs.

## Outputs

No outputs.
25 changes: 25 additions & 0 deletions terraform-incubator/shared_resources/network/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Requirements

No requirements.

## Providers

No providers.

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_network"></a> [network](#module\_network) | ../../../terraform-modules/network | n/a |

## Resources

No resources.

## Inputs

No inputs.

## Outputs

No outputs.
Loading