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

Automate running terraform docs 66 #67

39 changes: 39 additions & 0 deletions .github/workflows/terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Generate terraform docs

on:
pull_request:
paths:
- "**/*.tf"

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

- name: Generate Terraform docs terraform-modules
uses: terraform-docs/[email protected]
with:
working-dir: terraform-modules
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want to run terraform docs in directories that don't have a tf file. this is one of those instances, but we do want to run it inside of the other directories in terraform-modules. i wonder if there's a way to refactor this a little where we get a list of the directories and then loop through it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Chelsey! Great idea, will look into it.

output-file: README.md
output-method: inject
git-push: "true"
- name: Generate Terraform docs terraform-incubator access-the-data
uses: terraform-docs/[email protected]
with:
working-dir: terraform-incubator/access-the-data
output-file: README.md
output-method: inject
git-push: "true"

- name: Generate Terraform docs terraform-incubator shared_resources vrms-backend people-depot
uses: terraform-docs/[email protected]
with:
working-dir: terraform-incubator/shared_resources,terraform-incubator/vrms-backend, terraform-incubator/people-depot
output-file: README.md
recursive: true
recursive-path: .
output-method: inject
git-push: "true"
25 changes: 25 additions & 0 deletions terraform-incubator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

No requirements.

## Providers

No providers.

## Modules

No modules.

## Resources

No resources.

## Inputs

No inputs.

## Outputs

No outputs.
<!-- END_TF_DOCS -->
30 changes: 15 additions & 15 deletions terraform-incubator/access-the-data/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
<!-- 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 +21,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 +30,11 @@ 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 .
No outputs.
<!-- END_TF_DOCS -->
25 changes: 25 additions & 0 deletions terraform-incubator/people-depot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

No requirements.

## Providers

No providers.

## Modules

No modules.

## Resources

No resources.

## Inputs

No inputs.

## Outputs

No outputs.
<!-- END_TF_DOCS -->
30 changes: 30 additions & 0 deletions terraform-incubator/people-depot/dev/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!-- BEGIN_TF_DOCS -->
## 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.
<!-- END_TF_DOCS -->
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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious about this change. this is to a main.tf file, not a readme...and the region should prob be us-west-2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to trigger the workflow. I probably should have noted that in the PR.

}

variable "root_db_password" {
Expand Down
22 changes: 11 additions & 11 deletions terraform-incubator/people-depot/project/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
<!-- 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 +29,7 @@ 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 .
No outputs.
<!-- END_TF_DOCS -->
25 changes: 25 additions & 0 deletions terraform-incubator/shared_resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

No requirements.

## Providers

No providers.

## Modules

No modules.

## Resources

No resources.

## Inputs

No inputs.

## Outputs

No outputs.
<!-- END_TF_DOCS -->
29 changes: 29 additions & 0 deletions terraform-incubator/shared_resources/acm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!-- BEGIN_TF_DOCS -->
## 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 |
<!-- END_TF_DOCS -->
40 changes: 40 additions & 0 deletions terraform-incubator/shared_resources/alb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!-- BEGIN_TF_DOCS -->
## 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 |
<!-- END_TF_DOCS -->
43 changes: 43 additions & 0 deletions terraform-incubator/shared_resources/all/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!-- BEGIN_TF_DOCS -->
## 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 |
<!-- END_TF_DOCS -->
Loading
Loading