Skip to content

Commit e198dc4

Browse files
jmlclaude
andauthored
feat: set team/squad variable defaults to 'unknown' (#1020)
## Summary Set default values for `team` and `squad` variables to "unknown" across all Terraform modules. ## Impact This lets us distinguish between: - could be labeled with a team but we haven't set the value yet, and - haven't done the work to make it label-able ## Follow-up The "is required" variables are no longer meaningful. My plan is to do one pass to strip out the logic, then find all our call sites & remove it there, then remove it here and release as a breaking change. --------- Co-authored-by: Claude <[email protected]>
1 parent ff6e54b commit e198dc4

File tree

44 files changed

+61
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+61
-104
lines changed

modules/alerting/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ No modules.
7474
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | n/a | `string` | n/a | yes |
7575
| <a name="input_scaling_issue_filter"></a> [scaling\_issue\_filter](#input\_scaling\_issue\_filter) | additional filter to apply to scaling issue alert policy | `string` | `""` | no |
7676
| <a name="input_signal_filter"></a> [signal\_filter](#input\_signal\_filter) | additional filter to apply to signal alert policy | `string` | `""` | no |
77-
| <a name="input_squad"></a> [squad](#input\_squad) | squad to filter on if non-empty | `string` | `""` | no |
77+
| <a name="input_squad"></a> [squad](#input\_squad) | squad to filter on if non-empty | `string` | `"unknown"` | no |
7878
| <a name="input_timeout_filter"></a> [timeout\_filter](#input\_timeout\_filter) | additional filter to apply to timeout alert policy | `string` | `""` | no |
7979

8080
## Outputs

modules/alerting/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ EOT
124124
variable "squad" {
125125
description = "squad to filter on if non-empty"
126126
type = string
127-
default = ""
127+
default = "unknown"
128128
}
129129

130130
variable "global_only_alerts" {

modules/bastion/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ No modules.
160160
| <a name="input_patch_time_utc"></a> [patch\_time\_utc](#input\_patch\_time\_utc) | Time of day in HH:MM (UTC) when patching runs. | `string` | `"03:00"` | no |
161161
| <a name="input_product"></a> [product](#input\_product) | Product label to apply to the service. | `string` | `"unknown"` | no |
162162
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | Project in which to deploy the bastion host. | `string` | n/a | yes |
163-
| <a name="input_squad"></a> [squad](#input\_squad) | Squad or team label applied to the instance (required). | `string` | n/a | yes |
163+
| <a name="input_squad"></a> [squad](#input\_squad) | Squad or team label applied to the instance (required). | `string` | `"unknown"` | no |
164164
| <a name="input_startup_script"></a> [startup\_script](#input\_startup\_script) | additional startup script snippet to execute on bastion. | `string` | `""` | no |
165165
| <a name="input_subnetwork"></a> [subnetwork](#input\_subnetwork) | Subnetwork name the bastion joins (must be private). | `string` | n/a | yes |
166166
| <a name="input_zone"></a> [zone](#input\_zone) | Compute Engine zone for the bastion VM (e.g. us-central1-a). | `string` | n/a | yes |

modules/bastion/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ variable "dev_principals" {
3636
variable "squad" {
3737
description = "Squad or team label applied to the instance (required)."
3838
type = string
39+
default = "unknown"
3940

4041
validation {
4142
condition = length(trim(var.squad, " \t\n\r")) > 0

modules/bucket-events/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ No requirements.
129129
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | n/a | `string` | n/a | yes |
130130
| <a name="input_regions"></a> [regions](#input\_regions) | A map from region names to a network and subnetwork. The bucket must be in one of these regions. | <pre>map(object({<br/> network = string<br/> subnet = string<br/> }))</pre> | n/a | yes |
131131
| <a name="input_require_squad"></a> [require\_squad](#input\_require\_squad) | Whether to require squad variable to be specified | `bool` | `false` | no |
132-
| <a name="input_squad"></a> [squad](#input\_squad) | squad label to apply to the service. | `string` | `""` | no |
132+
| <a name="input_squad"></a> [squad](#input\_squad) | squad label to apply to the service. | `string` | `"unknown"` | no |
133133

134134
## Outputs
135135

modules/bucket-events/variables.tf

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ variable "deletion_protection" {
5555
default = true
5656
}
5757

58+
5859
variable "require_squad" {
5960
description = "Whether to require squad variable to be specified"
6061
type = bool
@@ -64,12 +65,8 @@ variable "require_squad" {
6465
variable "squad" {
6566
description = "squad label to apply to the service."
6667
type = string
67-
default = ""
68+
default = "unknown"
6869

69-
validation {
70-
condition = !var.require_squad || var.squad != ""
71-
error_message = "squad needs to specified or disable check by setting require_squad = false"
72-
}
7370
}
7471

7572
variable "labels" {

modules/cloudevent-broker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ No requirements.
120120
| <a name="input_regions"></a> [regions](#input\_regions) | A map from region names to a network and subnetwork. A pub/sub topic and ingress service (publishing to the respective topic) will be created in each region, with the ingress service configured to egress all traffic via the specified subnetwork. | <pre>map(object({<br/> network = string<br/> subnet = string<br/> }))</pre> | n/a | yes |
121121
| <a name="input_require_squad"></a> [require\_squad](#input\_require\_squad) | Whether to require squad variable to be specified | `bool` | `false` | no |
122122
| <a name="input_scaling"></a> [scaling](#input\_scaling) | The scaling configuration for the service. | <pre>object({<br/> min_instances = optional(number, 0)<br/> max_instances = optional(number, 100)<br/> max_instance_request_concurrency = optional(number)<br/> })</pre> | `{}` | no |
123-
| <a name="input_squad"></a> [squad](#input\_squad) | squad label to apply to the service. | `string` | `""` | no |
123+
| <a name="input_squad"></a> [squad](#input\_squad) | squad label to apply to the service. | `string` | `"unknown"` | no |
124124

125125
## Outputs
126126

modules/cloudevent-broker/variables.tf

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ variable "enable_profiler" {
4444
description = "Enable cloud profiler."
4545
}
4646

47+
4748
variable "require_squad" {
4849
description = "Whether to require squad variable to be specified"
4950
type = bool
@@ -53,12 +54,8 @@ variable "require_squad" {
5354
variable "squad" {
5455
description = "squad label to apply to the service."
5556
type = string
56-
default = ""
57+
default = "unknown"
5758

58-
validation {
59-
condition = !var.require_squad || var.squad != ""
60-
error_message = "squad needs to specified or disable check by setting require_squad = false"
61-
}
6259
}
6360

6461
variable "labels" {

modules/cloudevent-pull-trigger/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ No modules.
115115
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | n/a | `string` | n/a | yes |
116116
| <a name="input_raw_filter"></a> [raw\_filter](#input\_raw\_filter) | Raw PubSub filter to apply, ignores other variables. https://cloud.google.com/pubsub/docs/subscription-message-filter#filtering_syntax | `string` | `""` | no |
117117
| <a name="input_require_team"></a> [require\_team](#input\_require\_team) | Whether to require team variable to be specified | `bool` | `true` | no |
118-
| <a name="input_team"></a> [team](#input\_team) | team label to apply to the service. | `string` | `""` | no |
118+
| <a name="input_team"></a> [team](#input\_team) | team label to apply to the service. | `string` | `"unknown"` | no |
119119

120120
## Outputs
121121

modules/cloudevent-pull-trigger/variables.tf

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ variable "ack_deadline_seconds" {
103103
default = 300
104104
}
105105

106+
106107
variable "require_team" {
107108
description = "Whether to require team variable to be specified"
108109
type = bool
@@ -112,12 +113,8 @@ variable "require_team" {
112113
variable "team" {
113114
description = "team label to apply to the service."
114115
type = string
115-
default = ""
116+
default = "unknown"
116117

117-
validation {
118-
condition = !var.require_team || var.team != ""
119-
error_message = "team needs to specified or disable check by setting require_team = false"
120-
}
121118
}
122119

123120
variable "allowed_persistence_regions" {

0 commit comments

Comments
 (0)