Ryan Cragun 27ab988205
[QT-695] Add config_mode variant to some scenarios (#26380)
Add `config_mode` variant to some scenarios so we can dynamically change
how we primarily configure the Vault cluster, either by a configuration
file or with environment variables.

As part of this change we also:
* Start consuming the Enos terraform provider from public Terraform
  registry.
* Remove the old `seal_ha_beta` variant as it is no longer required.
* Add a module that performs a `vault operator step-down` so that we can
  force leader elections in scenarios.
* Wire up an operator step-down into some scenarios to test both the old
  and new multiseal code paths during leader elections.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-04-22 12:34:47 -06:00

54 lines
1.0 KiB
HCL

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
terraform {
required_providers {
enos = {
source = "registry.terraform.io/hashicorp-forge/enos"
}
random = {
source = "hashicorp/random"
version = ">= 3.4.3"
}
}
}
resource "random_pet" "cluster_name" {}
resource "enos_local_kind_cluster" "this" {
name = random_pet.cluster_name.id
kubeconfig_path = var.kubeconfig_path
}
variable "kubeconfig_path" {
type = string
}
output "cluster_name" {
value = random_pet.cluster_name.id
}
output "kubeconfig_base64" {
value = enos_local_kind_cluster.this.kubeconfig_base64
}
output "context_name" {
value = enos_local_kind_cluster.this.context_name
}
output "host" {
value = enos_local_kind_cluster.this.endpoint
}
output "client_certificate" {
value = enos_local_kind_cluster.this.client_certificate
}
output "client_key" {
value = enos_local_kind_cluster.this.client_key
}
output "cluster_ca_certificate" {
value = enos_local_kind_cluster.this.cluster_ca_certificate
}