vault/enos/modules/k8s_vault_verify_replication/main.tf
Vault Automation 0c6c13dd38
license: update headers to IBM Corp. (#10229) (#10233)
* license: update headers to IBM Corp.
* `make proto`
* update offset because source file changed

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

42 lines
969 B
HCL

# Copyright IBM Corp. 2016, 2025
# SPDX-License-Identifier: BUSL-1.1
terraform {
required_providers {
enos = {
source = "registry.terraform.io/hashicorp-forge/enos"
}
}
}
locals {
instances = toset([for idx in range(var.vault_instance_count) : tostring(idx)])
}
resource "enos_remote_exec" "replication_status" {
for_each = local.instances
inline = ["vault read -format=json sys/replication/status"]
transport = {
kubernetes = {
kubeconfig_base64 = var.kubeconfig_base64
context_name = var.context_name
pod = var.vault_pods[each.key].name
namespace = var.vault_pods[each.key].namespace
}
}
}
resource "enos_local_exec" "verify_replication_status" {
for_each = enos_remote_exec.replication_status
environment = {
STATUS = each.value.stdout
VAULT_EDITION = var.vault_edition
}
content = abspath("${path.module}/scripts/smoke-verify-replication.sh")
}