From ac797c8f81ede770853c25fd04102da9f5e109bf Mon Sep 17 00:00:00 2001 From: Zachary Winnerman <98712682+zwinnerman-fleetdm@users.noreply.github.com> Date: Thu, 20 Jul 2023 14:33:15 -0400 Subject: [PATCH] Fix variable consistency for optional in fleet_config (#12874) # Checklist for submitter If some of the following don't apply, delete the relevant line. - [ ] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [ ] Documented any API changes (docs/Using-Fleet/REST-API.md or docs/Contributing/API-for-contributors.md) - [ ] Documented any permissions changes - [ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features. - [ ] Added/updated tests - [ ] Manual QA for all new/changed functionality - For Orbit and Fleet Desktop changes: - [ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux. - [ ] Auto-update manual QA, from released version of component to new version (see [tools/tuf/test](../tools/tuf/test/README.md)). --- terraform/byo-vpc/byo-db/variables.tf | 22 ++++++++++++++++++---- terraform/byo-vpc/variables.tf | 22 ++++++++++++++++++---- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/terraform/byo-vpc/byo-db/variables.tf b/terraform/byo-vpc/byo-db/variables.tf index c5bd5ed0c4..84ac8cb473 100644 --- a/terraform/byo-vpc/byo-db/variables.tf +++ b/terraform/byo-vpc/byo-db/variables.tf @@ -70,16 +70,25 @@ variable "fleet_config" { }), { name = "fleet" }) - database = object({ + database = optional(object({ password_secret_arn = string user = string database = string address = string rr_address = optional(string, null) + }), { + password_secret_arn = null + user = null + database = null + address = null + rr_address = null }) - redis = object({ + redis = optional(object({ address = string use_tls = optional(bool, true) + }), { + address = null + use_tls = true }) awslogs = optional(object({ name = optional(string, null) @@ -93,12 +102,17 @@ variable "fleet_config" { prefix = "fleet" retention = 5 }) - loadbalancer = object({ + loadbalancer = optional(object({ arn = string + }), { + arn = null }) - networking = object({ + networking = optional(object({ subnets = list(string) security_groups = optional(list(string), null) + }), { + subnets = null + security_groups = null }) autoscaling = optional(object({ max_capacity = optional(number, 5) diff --git a/terraform/byo-vpc/variables.tf b/terraform/byo-vpc/variables.tf index 1ec5f3627d..04e086cc77 100644 --- a/terraform/byo-vpc/variables.tf +++ b/terraform/byo-vpc/variables.tf @@ -160,16 +160,25 @@ variable "fleet_config" { }), { name = "fleet" }) - database = object({ + database = optional(object({ password_secret_arn = string user = string database = string address = string rr_address = optional(string, null) + }), { + password_secret_arn = null + user = null + database = null + address = null + rr_address = null }) - redis = object({ + redis = optional(object({ address = string use_tls = optional(bool, true) + }), { + address = null + use_tls = true }) awslogs = optional(object({ name = optional(string, null) @@ -183,12 +192,17 @@ variable "fleet_config" { prefix = "fleet" retention = 5 }) - loadbalancer = object({ + loadbalancer = optional(object({ arn = string + }), { + arn = null }) - networking = object({ + networking = optional(object({ subnets = list(string) security_groups = optional(list(string), null) + }), { + subnets = null + security_groups = null }) autoscaling = optional(object({ max_capacity = optional(number, 5)