2023-03-15 16:00:52 +00:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
2023-11-16 19:59:47 +00:00
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
2023-03-15 16:00:52 +00:00
|
|
|
|
2022-11-16 19:23:58 +00:00
|
|
|
|
|
|
|
terraform {
|
|
|
|
required_providers {
|
|
|
|
enos = {
|
|
|
|
source = "app.terraform.io/hashicorp-qti/enos"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
locals {
|
|
|
|
instances = {
|
|
|
|
for idx in range(var.vault_instance_count) : idx => {
|
|
|
|
public_ip = values(var.vault_instances)[idx].public_ip
|
|
|
|
private_ip = values(var.vault_instances)[idx].private_ip
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "enos_remote_exec" "smoke-verify-replication" {
|
|
|
|
for_each = local.instances
|
|
|
|
|
2023-09-27 16:53:12 +00:00
|
|
|
environment = {
|
|
|
|
VAULT_EDITION = var.vault_edition
|
|
|
|
}
|
|
|
|
|
|
|
|
scripts = [abspath("${path.module}/scripts/smoke-verify-replication.sh")]
|
2022-11-16 19:23:58 +00:00
|
|
|
|
|
|
|
transport = {
|
|
|
|
ssh = {
|
|
|
|
host = each.value.public_ip
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|