test(e2e): Update worker module to create recordings directory if defined (#3340)

pull/3388/head
Michael Li 3 years ago committed by GitHub
parent 8d9222bec3
commit e39f0406f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -174,12 +174,13 @@ resource "enos_file" "worker_config" {
destination = "/etc/boundary/boundary.hcl"
content = templatefile("${path.module}/${var.config_file_path}", {
id = random_pet.worker.id
kms_key_id = data.aws_kms_key.kms_key.id
public_addr = aws_instance.worker.public_ip
type = jsonencode(var.worker_type_tags)
region = data.aws_availability_zone.worker_az.region
controller_addresses = jsonencode(var.controller_addresses)
id = random_pet.worker.id
kms_key_id = data.aws_kms_key.kms_key.id
public_addr = aws_instance.worker.public_ip
type = jsonencode(var.worker_type_tags)
region = data.aws_availability_zone.worker_az.region
controller_addresses = jsonencode(var.controller_addresses)
recording_storage_path = var.recording_storage_path
})
transport = {
@ -195,8 +196,9 @@ resource "enos_boundary_start" "worker_start" {
aws_vpc_security_group_ingress_rule.worker_to_controller,
]
bin_path = "/opt/boundary/bin"
config_path = "/etc/boundary"
bin_path = "/opt/boundary/bin"
config_path = "/etc/boundary"
recording_storage_path = var.recording_storage_path != "" ? var.recording_storage_path : null
transport = {
ssh = {
host = aws_instance.worker.public_ip

@ -0,0 +1,33 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
listener "tcp" {
purpose = "proxy"
tls_disable = true
address = "0.0.0.0"
}
worker {
# Name attr must be unique across workers
name = "worker-${id}"
description = "Enos Boundary worker ${id}"
# Workers must be able to reach controllers on :9201
initial_upstreams = ${controller_addresses}
public_addr = "${public_addr}"
tags {
region = ["${region}"]
type = ${type}
}
recording_storage_path = "${recording_storage_path}"
}
# must be same key as used on controller config
kms "awskms" {
purpose = "worker-auth"
region = "${region}"
kms_key_id = "${kms_key_id}"
}

@ -133,4 +133,11 @@ variable "controller_sg_id" {
variable "config_file_path" {
description = "Path to a config file (relative to module directory)"
type = string
default = "templates/worker.hcl"
}
variable "recording_storage_path" {
description = "Path on instance to store recordings"
type = string
default = ""
}

Loading…
Cancel
Save