From 9f578812f492b1ddd76840a1b0dbf3f07b3fce8a Mon Sep 17 00:00:00 2001 From: Alex English Date: Fri, 17 Oct 2025 21:37:54 -0700 Subject: [PATCH 1/2] docs for ecr and dns-entry --- terraform/modules/dns-entry/main.tf | 13 +++-- terraform/modules/dns-entry/outputs.tf | 1 + terraform/modules/dns-entry/variables.tf | 2 + terraform/modules/ecr/.terraform.docs.yml | 60 ----------------------- terraform/modules/ecr/main.tf | 16 +++--- terraform/modules/ecr/outputs.tf | 2 + 6 files changed, 23 insertions(+), 71 deletions(-) delete mode 100644 terraform/modules/ecr/.terraform.docs.yml diff --git a/terraform/modules/dns-entry/main.tf b/terraform/modules/dns-entry/main.tf index 21f4a5a..97603c0 100644 --- a/terraform/modules/dns-entry/main.tf +++ b/terraform/modules/dns-entry/main.tf @@ -1,15 +1,22 @@ +/** + * # dns-entry + * + * This is used to create a root DNS entry in Route 53, for example "qa.vrms.io" or "staging.homeunite.us". + * The Route 53 DNS entry points to incubator's main ingress (cloudfront or ALB). All services that require + * web access (frontends or API backends) should use this. + * + */ +// terraform-docs-ignore data "aws_route53_zone" "this" { zone_id = var.zone_id } - +// terraform-docs-ignore data "aws_lb" "this" { arn = "arn:aws:elasticloadbalancing:us-west-2:035866691871:loadbalancer/app/incubator-prod-lb/7451adf77133ef36" } - - resource "aws_route53_record" "www" { zone_id = var.zone_id name = var.subdomain diff --git a/terraform/modules/dns-entry/outputs.tf b/terraform/modules/dns-entry/outputs.tf index bd82e80..7ad1c0e 100644 --- a/terraform/modules/dns-entry/outputs.tf +++ b/terraform/modules/dns-entry/outputs.tf @@ -1,3 +1,4 @@ output "full_dns_name" { value = "${var.subdomain}.${data.aws_route53_zone.this.name}" + description = "full dns name, i.e. `qa.vrms.io`" } \ No newline at end of file diff --git a/terraform/modules/dns-entry/variables.tf b/terraform/modules/dns-entry/variables.tf index 28a1ca9..30fd8e6 100644 --- a/terraform/modules/dns-entry/variables.tf +++ b/terraform/modules/dns-entry/variables.tf @@ -1,8 +1,10 @@ variable "zone_id" { type = string + description = "the Route 53 hosted zone id to create the entry" } variable "subdomain" { type = string + description = "DNS entry - for example, in `qa.vrms.io` the subdomain is `qa`" } diff --git a/terraform/modules/ecr/.terraform.docs.yml b/terraform/modules/ecr/.terraform.docs.yml deleted file mode 100644 index 8f17113..0000000 --- a/terraform/modules/ecr/.terraform.docs.yml +++ /dev/null @@ -1,60 +0,0 @@ -formatter: "markdown table" # this is required -version: "" - -header-from: main.tf -footer-from: "" - -recursive: - enabled: false - path: modules - -sections: - hide: [] - show: [] - -content: |- - # ECR - - Add description. - - {{ .Header }} - {{ .Modules }} - {{ .Resources }} - {{ .Inputs }} - {{ .Outputs }} - {{ .Providers }} - {{ .Requirements }} - {{ .Footer }} - To automatically update this documentation, install terraform-docs on your local machine run the following: - cd - terraform-docs -c .terraform.docs.yml . -output: - file: README.md - mode: replace - template: |- - - {{ .Content }} - - -output-values: - enabled: false - from: "" - -sort: - enabled: true - by: name - -settings: - anchor: true - color: true - default: true - description: false - escape: true - hide-empty: true - html: true - indent: 2 - lockfile: true - read-comments: true - required: true - sensitive: true - type: true diff --git a/terraform/modules/ecr/main.tf b/terraform/modules/ecr/main.tf index d0f530d..f519ce5 100644 --- a/terraform/modules/ecr/main.tf +++ b/terraform/modules/ecr/main.tf @@ -1,16 +1,16 @@ -// XXX Decommision - not enough here to merit separate module -// -------------------------- -// General Variables -// -------------------------- +/** + * # ecr + * + * This creates a standard Elastic Container Registry docker registry. + * + */ + variable "project_name" { type = string - description = "The overall name of the project using this infrastructure; used to group related resources by" + description = "HfLA project name (vrms, home-unite-us, etc)" } -// -------------------------- -// Elastic Container Repository -// -------------------------- resource "aws_ecr_repository" "this" { name = var.project_name image_tag_mutability = "MUTABLE" diff --git a/terraform/modules/ecr/outputs.tf b/terraform/modules/ecr/outputs.tf index 7e6ae08..dd56f84 100644 --- a/terraform/modules/ecr/outputs.tf +++ b/terraform/modules/ecr/outputs.tf @@ -1,7 +1,9 @@ output "arn" { value = aws_ecr_repository.this.arn + description = "ARN of the created ECR repository" } output "repository_url" { value = aws_ecr_repository.this.repository_url + description = "URL of the docker repository repo" } \ No newline at end of file From 191cf6285464baa9eb89ce39d1f69c6d6ffeb340 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 18 Oct 2025 04:40:00 +0000 Subject: [PATCH 2/2] terraform-docs: automated updates to Terraform modules README.md --- terraform/modules/container/README.md | 3 ++- terraform/modules/dns-entry/README.md | 14 +++++++++----- terraform/modules/ecr/README.md | 10 +++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/terraform/modules/container/README.md b/terraform/modules/container/README.md index f5ab0df..ecbca09 100644 --- a/terraform/modules/container/README.md +++ b/terraform/modules/container/README.md @@ -35,7 +35,7 @@ No modules. |------|-------------|------|---------|:--------:| | [additional\_host\_urls](#input\_additional\_host\_urls) | n/a | `list(string)` | `[]` | no | | [application\_type](#input\_application\_type) | defines what type of application is running, fullstack, client, backend, etc. will be used for cloudwatch logs | `string` | n/a | yes | -| [container\_cpu](#input\_container\_cpu) | n/a | `number` | `512` | no | +| [container\_cpu](#input\_container\_cpu) | n/a | `number` | `256` | no | | [container\_environment](#input\_container\_environment) | n/a |
list(object({
name = string
value = string
}))
| n/a | yes | | [container\_environment\_secrets](#input\_container\_environment\_secrets) | n/a |
list(object({
name = string
valueFrom = string
}))
| `[]` | no | | [container\_image](#input\_container\_image) | n/a | `string` | n/a | yes | @@ -44,6 +44,7 @@ No modules. | [environment](#input\_environment) | n/a | `string` | n/a | yes | | [health\_check\_path](#input\_health\_check\_path) | n/a | `string` | `"/"` | no | | [hostname](#input\_hostname) | n/a | `string` | n/a | yes | +| [launch\_type](#input\_launch\_type) | n/a | `string` | `"fargate"` | no | | [listener\_priority](#input\_listener\_priority) | n/a | `number` | n/a | yes | | [path](#input\_path) | n/a | `string` | `null` | no | | [project\_name](#input\_project\_name) | The overall name of the project using this infrastructure; used to group related resources by | `any` | n/a | yes | diff --git a/terraform/modules/dns-entry/README.md b/terraform/modules/dns-entry/README.md index 3e13f65..75b310b 100644 --- a/terraform/modules/dns-entry/README.md +++ b/terraform/modules/dns-entry/README.md @@ -1,4 +1,10 @@ +# dns-entry + +This is used to create a root DNS entry in Route 53, for example "qa.vrms.io" or "staging.homeunite.us". +The Route 53 DNS entry points to incubator's main ingress (cloudfront or ALB). All services that require +web access (frontends or API backends) should use this. + ## Requirements No requirements. @@ -18,19 +24,17 @@ No modules. | Name | Type | |------|------| | [aws_route53_record.www](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource | -| [aws_lb.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/lb) | data source | -| [aws_route53_zone.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [subdomain](#input\_subdomain) | n/a | `string` | n/a | yes | -| [zone\_id](#input\_zone\_id) | n/a | `string` | n/a | yes | +| [subdomain](#input\_subdomain) | DNS entry - for example, in `qa.vrms.io` the subdomain is `qa` | `string` | n/a | yes | +| [zone\_id](#input\_zone\_id) | the Route 53 hosted zone id to create the entry | `string` | n/a | yes | ## Outputs | Name | Description | |------|-------------| -| [full\_dns\_name](#output\_full\_dns\_name) | n/a | +| [full\_dns\_name](#output\_full\_dns\_name) | full dns name, i.e. `qa.vrms.io` | \ No newline at end of file diff --git a/terraform/modules/ecr/README.md b/terraform/modules/ecr/README.md index 8439afb..e53fec5 100644 --- a/terraform/modules/ecr/README.md +++ b/terraform/modules/ecr/README.md @@ -1,4 +1,8 @@ +# ecr + +This creates a standard Elastic Container Registry docker registry. + ## Requirements No requirements. @@ -23,12 +27,12 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [project\_name](#input\_project\_name) | The overall name of the project using this infrastructure; used to group related resources by | `string` | n/a | yes | +| [project\_name](#input\_project\_name) | HfLA project name (vrms, home-unite-us, etc) | `string` | n/a | yes | ## Outputs | Name | Description | |------|-------------| -| [arn](#output\_arn) | n/a | -| [repository\_url](#output\_repository\_url) | n/a | +| [arn](#output\_arn) | ARN of the created ECR repository | +| [repository\_url](#output\_repository\_url) | URL of the docker repository repo | \ No newline at end of file