Vault Automation 01c88db77d
Backport license: update headers to IBM Corp. into release/1.20.x+ent (#10238) (#10251)
* license: update headers to IBM Corp.
* `make proto`
* update offset because source file changed
* update licenses in files that were not included in backport

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-10-21 15:20:27 -06:00

52 lines
1.2 KiB
HCL

# Copyright IBM Corp. 2016, 2025
# SPDX-License-Identifier: BUSL-1.1
// An arithmetic module for calculating inputs and outputs for various replication steps.
variable "added_hosts" {
type = map(object({
ipv6 = string
private_ip = string
public_ip = string
}))
default = {}
}
variable "initial_hosts" {
description = "The initial set of Vault cluster hosts before removing and adding hosts"
type = map(object({
ipv6 = string
private_ip = string
public_ip = string
}))
default = {}
}
variable "removed_primary_host" {
type = object({
ipv6 = string
private_ip = string
public_ip = string
})
default = null
}
variable "removed_follower_host" {
type = object({
ipv6 = string
private_ip = string
public_ip = string
})
default = null
}
locals {
remaining_initial = setsubtract(values(var.initial_hosts), [var.removed_primary_host, var.removed_follower_host])
remaining_hosts_list = tolist(setunion(values(var.added_hosts), local.remaining_initial))
remaining_hosts = { for idx in range(length(local.remaining_hosts_list)) : idx => local.remaining_hosts_list[idx] }
}
output "remaining_hosts" {
value = local.remaining_hosts
}