Skip to content

Commit

Permalink
Update Infracost configuration and variable descriptions (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcurtis authored Dec 10, 2023
1 parent b1759ba commit 6b21dfa
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 7 deletions.
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ repos:
- id: check-symlinks
- id: no-commit-to-branch

- repo: local
hooks:
- id: infracost_generate_config
name: Infracost generate config
entry: bash -c 'infracost generate config --repo-path=. --template-path=infracost.yml.tmpl --out-file=infracost.yml'
language: system
files: ^infracost\.yml\.tmpl$
verbose: false

- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.83.6
hooks:
Expand All @@ -33,3 +42,4 @@ repos:
args:
- --args=--config-file=infracost.yml
- --args=--sync-usage-file
verbose: false
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

Monthly cost estimates for this module based on these usage values:

- [default cloud sql](test/fixtures/default_cloud_sql/infracost.yml)
- [default cloud sql](test/fixtures/default_cloud_sql/infracost-usage.yml)

## Repository Description

Expand Down
2 changes: 1 addition & 1 deletion infracost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ version: 0.1
projects:
- path: test/fixtures/default_cloud_sql
name: "default_cloud_sql"
usage_file: test/fixtures/default_cloud_sql/infracost.yml
usage_file: test/fixtures/default_cloud_sql/infracost-usage.yml
2 changes: 1 addition & 1 deletion infracost.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ projects:
{{- if ne $project.name "shared"}}
- path: {{ print $project._dir "/" $project.name }}
name: "{{ $project.name }}"
usage_file: {{ print $project._dir "/" $project.name "/infracost.yml" }}
usage_file: {{ print $project._dir "/" $project.name "/infracost-usage.yml" }}
{{- end }}
{{- end}}
4 changes: 2 additions & 2 deletions regional/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ No modules.
| <a name="input_availability_type"></a> [availability\_type](#input\_availability\_type) | The availability type of the Cloud SQL instance | `string` | `"REGIONAL"` | no |
| <a name="input_backup_start_time"></a> [backup\_start\_time](#input\_backup\_start\_time) | Time indicating when backup configuration starts | `string` | `"04:00"` | no |
| <a name="input_client_certs"></a> [client\_certs](#input\_client\_certs) | A set of client cert names, note: 10 max per instance | `set(string)` | `[]` | no |
| <a name="input_cost_center"></a> [cost\_center](#input\_cost\_center) | The cost center to label the project with | `string` | n/a | yes |
| <a name="input_cost_center"></a> [cost\_center](#input\_cost\_center) | The cost center to use for resource labels | `string` | n/a | yes |
| <a name="input_database_flags"></a> [database\_flags](#input\_database\_flags) | The database flags for Cloud SQL. See [PostgreSQL Flags](https://cloud.google.com/sql/docs/postgres/flags) | <pre>list(object({<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
| <a name="input_database_version"></a> [database\_version](#input\_database\_version) | The MySQL, PostgreSQL or SQL Server version to use. | `string` | `"POSTGRES_15"` | no |
| <a name="input_deletion_protection"></a> [deletion\_protection](#input\_deletion\_protection) | Whether or not to allow Terraform to destroy the instance | `bool` | `true` | no |
| <a name="input_host_project_id"></a> [host\_project\_id](#input\_host\_project\_id) | Host project ID for the shared VPC | `string` | `""` | no |
| <a name="input_instance_name"></a> [instance\_name](#input\_instance\_name) | The name of the instance | `string` | n/a | yes |
| <a name="input_labels"></a> [labels](#input\_labels) | A set of key/value label pairs to assign to the project | `map(string)` | `{}` | no |
| <a name="input_labels"></a> [labels](#input\_labels) | A map of key/value pairs to assign to the resources being created | `map(string)` | `{}` | no |
| <a name="input_machine_tier"></a> [machine\_tier](#input\_machine\_tier) | The machine type to use. Postgres supports only shared-core machine types, and custom machine types such as db-custom-2-13312 | `string` | `"db-f1-micro"` | no |
| <a name="input_mw_day"></a> [mw\_day](#input\_mw\_day) | Maintenance window day | `number` | `4` | no |
| <a name="input_mw_hour"></a> [mw\_hour](#input\_mw\_hour) | Maintenance window hour | `number` | `17` | no |
Expand Down
4 changes: 2 additions & 2 deletions regional/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ variable "client_certs" {
}

variable "cost_center" {
description = "The cost center to label the project with"
description = "The cost center to use for resource labels"
type = string
}

Expand Down Expand Up @@ -54,7 +54,7 @@ variable "instance_name" {
}

variable "labels" {
description = "A set of key/value label pairs to assign to the project"
description = "A map of key/value pairs to assign to the resources being created"
type = map(string)
default = {}
}
Expand Down

0 comments on commit 6b21dfa

Please sign in to comment.