Skip to content

Commit d25ae6a

Browse files
mark-00mark854542
andauthored
feat: add vault_update_policy_type parameter (#125)
* add vault_update_policy_type parameter * generate_docs * generate docs using developpertools 0.12.0 Co-authored-by: Mark Vinkx <[email protected]>
1 parent 1be9da6 commit d25ae6a

File tree

7 files changed

+18
-2
lines changed

7 files changed

+18
-2
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Make will use bash instead of sh
1919
SHELL := /usr/bin/env bash
2020

21-
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0
21+
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0.12.0
2222
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
2323
REGISTRY_URL := gcr.io/cloud-foundation-cicd
2424

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ done
227227
| vault\_tls\_kms\_key\_project | Project ID where the KMS key is stored. By default, same as `project_id` | string | `""` | no |
228228
| vault\_tls\_require\_and\_verify\_client\_cert | Always use client certificates. You may want to disable this if users will not be authenticating to Vault with client certificates. | string | `"false"` | no |
229229
| vault\_ui\_enabled | Controls whether the Vault UI is enabled and accessible. | string | `"true"` | no |
230+
| vault\_update\_policy\_type | Options are OPPORTUNISTIC or PROACTIVE. If `PROACTIVE`, the instance group manager proactively executes actions in order to bring instances to their target versions | string | `"OPPORTUNISTIC"` | no |
230231
| vault\_version | Version of vault to install. This version must be 1.0+ and must be published on the HashiCorp releases service. | string | `"1.6.0"` | no |
231232
232233
## Outputs

main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ module "cluster" {
7676
vault_min_num_servers = var.vault_min_num_servers
7777
vault_machine_type = var.vault_machine_type
7878
vault_max_num_servers = var.vault_max_num_servers
79+
vault_update_policy_type = var.vault_update_policy_type
7980
vault_port = var.vault_port
8081
vault_proxy_port = var.vault_proxy_port
8182
vault_tls_disable_client_certs = var.vault_tls_disable_client_certs

modules/cluster/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ module "vault_cluster" {
7878
| vault\_tls\_kms\_key\_project | Project ID where the KMS key is stored. By default, same as `project_id` | string | `""` | no |
7979
| vault\_tls\_require\_and\_verify\_client\_cert | Always use client certificates. You may want to disable this if users will not be authenticating to Vault with client certificates. | string | `"false"` | no |
8080
| vault\_ui\_enabled | Controls whether the Vault UI is enabled and accessible. | string | `"true"` | no |
81+
| vault\_update\_policy\_type | Options are OPPORTUNISTIC or PROACTIVE. If `PROACTIVE`, the instance group manager proactively executes actions in order to bring instances to their target versions | string | `"OPPORTUNISTIC"` | no |
8182
| vault\_version | Version of vault to install. This version must be 1.0+ and must be published on the HashiCorp releases service. | string | `"1.6.0"` | no |
8283
| zones | The zones to distribute instances across. If empty, all zones in the region are used. ['us-west1-a', 'us-west1-b', 'us-west1-c'] | list(string) | `<list>` | no |
8384

modules/cluster/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ resource "google_compute_region_instance_group_manager" "vault" {
201201
}
202202

203203
update_policy {
204-
type = "OPPORTUNISTIC"
204+
type = var.vault_update_policy_type
205205
minimal_action = "REPLACE"
206206
max_unavailable_fixed = length(local.zones)
207207
min_ready_sec = var.min_ready_sec

modules/cluster/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ variable "user_startup_script" {
289289
description = "Additional user-provided code injected after Vault is setup"
290290
}
291291

292+
variable "vault_update_policy_type" {
293+
type = string
294+
default = "OPPORTUNISTIC"
295+
description = "Options are OPPORTUNISTIC or PROACTIVE. If `PROACTIVE`, the instance group manager proactively executes actions in order to bring instances to their target versions"
296+
}
297+
292298
variable "min_ready_sec" {
293299
description = "Minimum number of seconds to wait before considering a new or restarted instance as updated. This value must be from range. [0,3600]"
294300
type = number

variables.tf

+7
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,13 @@ variable "vault_max_num_servers" {
411411
description = "Maximum number of Vault server nodes to run at one time. The group will not autoscale beyond this number."
412412
}
413413

414+
415+
variable "vault_update_policy_type" {
416+
type = string
417+
default = "OPPORTUNISTIC"
418+
description = "Options are OPPORTUNISTIC or PROACTIVE. If `PROACTIVE`, the instance group manager proactively executes actions in order to bring instances to their target versions"
419+
}
420+
414421
variable "vault_port" {
415422
type = string
416423
default = "8200"

0 commit comments

Comments
 (0)