2026-04-06 15:48:37 +05:30
|
|
|
# Copyright IBM Corp. 2020, 2026
|
2023-02-02 17:15:17 -08:00
|
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
2023-06-21 11:36:47 -04:00
|
|
|
scenario "e2e_aws_base" {
|
2022-08-31 12:08:46 -04:00
|
|
|
terraform_cli = terraform_cli.default
|
|
|
|
|
terraform = terraform.default
|
|
|
|
|
providers = [
|
|
|
|
|
provider.aws.default,
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
matrix {
|
|
|
|
|
builder = ["local", "crt"]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
locals {
|
2026-04-16 13:42:08 -04:00
|
|
|
aws_ssh_private_key_path = var.aws_ssh_private_key_path != null ? abspath(var.aws_ssh_private_key_path) : null
|
2022-08-31 12:08:46 -04:00
|
|
|
boundary_install_dir = abspath(var.boundary_install_dir)
|
2023-04-27 14:59:46 -04:00
|
|
|
license_path = abspath(var.boundary_license_path != null ? var.boundary_license_path : joinpath(path.root, "./support/boundary.hclic"))
|
2024-07-08 10:18:30 -04:00
|
|
|
local_boundary_dir = var.local_boundary_dir != null ? abspath(var.local_boundary_dir) : null
|
2022-08-31 12:08:46 -04:00
|
|
|
build_path = {
|
|
|
|
|
"local" = "/tmp",
|
|
|
|
|
"crt" = var.crt_bundle_path == null ? null : abspath(var.crt_bundle_path)
|
|
|
|
|
}
|
2022-09-22 13:29:25 -04:00
|
|
|
tags = merge({
|
|
|
|
|
"Project Name" : var.project_name
|
|
|
|
|
"Project" : "Enos",
|
|
|
|
|
"Environment" : "ci"
|
|
|
|
|
}, var.tags)
|
2022-08-31 12:08:46 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
step "find_azs" {
|
2023-10-10 09:28:04 -04:00
|
|
|
module = module.aws_az_finder
|
2022-08-31 12:08:46 -04:00
|
|
|
|
|
|
|
|
variables {
|
|
|
|
|
instance_type = [
|
2025-07-17 16:30:27 -04:00
|
|
|
var.controller_instance_type,
|
2022-08-31 12:08:46 -04:00
|
|
|
var.worker_instance_type,
|
2025-07-17 16:30:27 -04:00
|
|
|
var.target_instance_type
|
2022-08-31 12:08:46 -04:00
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-27 14:59:46 -04:00
|
|
|
step "read_license" {
|
|
|
|
|
skip_step = var.boundary_edition == "oss"
|
|
|
|
|
module = module.read_license
|
|
|
|
|
|
|
|
|
|
variables {
|
2025-01-21 10:37:04 -05:00
|
|
|
license_path = local.license_path
|
2025-05-07 12:47:09 -07:00
|
|
|
license = var.boundary_license
|
2023-04-27 14:59:46 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-31 12:08:46 -04:00
|
|
|
step "create_db_password" {
|
|
|
|
|
module = module.random_stringifier
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
step "build_boundary" {
|
|
|
|
|
module = matrix.builder == "crt" ? module.build_crt : module.build_local
|
|
|
|
|
|
|
|
|
|
variables {
|
2023-09-27 17:40:45 -04:00
|
|
|
path = local.build_path[matrix.builder]
|
|
|
|
|
edition = var.boundary_edition
|
2022-08-31 12:08:46 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
step "create_base_infra" {
|
2023-09-20 11:07:50 -04:00
|
|
|
module = module.aws_vpc
|
2023-02-27 12:27:18 -05:00
|
|
|
depends_on = [
|
|
|
|
|
step.find_azs,
|
|
|
|
|
]
|
2022-08-31 12:08:46 -04:00
|
|
|
|
|
|
|
|
variables {
|
|
|
|
|
availability_zones = step.find_azs.availability_zones
|
2022-09-22 13:29:25 -04:00
|
|
|
common_tags = local.tags
|
2022-08-31 12:08:46 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-16 13:42:08 -04:00
|
|
|
step "generate_ssh_key" {
|
|
|
|
|
module = module.aws_ssh_keypair
|
|
|
|
|
|
|
|
|
|
variables {
|
|
|
|
|
local_key_path = local.aws_ssh_private_key_path
|
|
|
|
|
local_aws_keypair_name = var.aws_ssh_keypair_name != null ? var.aws_ssh_keypair_name : null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-31 12:08:46 -04:00
|
|
|
step "create_boundary_cluster" {
|
2023-10-10 09:28:04 -04:00
|
|
|
module = module.aws_boundary
|
2022-08-31 12:08:46 -04:00
|
|
|
depends_on = [
|
|
|
|
|
step.create_base_infra,
|
2023-02-27 12:27:18 -05:00
|
|
|
step.create_db_password,
|
2026-04-16 13:42:08 -04:00
|
|
|
step.build_boundary,
|
|
|
|
|
step.generate_ssh_key
|
2022-08-31 12:08:46 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
variables {
|
2023-05-08 15:04:26 -04:00
|
|
|
boundary_binary_name = var.boundary_binary_name
|
2022-08-31 12:08:46 -04:00
|
|
|
boundary_install_dir = local.boundary_install_dir
|
2023-04-27 14:59:46 -04:00
|
|
|
boundary_license = var.boundary_edition != "oss" ? step.read_license.license : null
|
2022-09-22 13:29:25 -04:00
|
|
|
common_tags = local.tags
|
2022-08-31 12:08:46 -04:00
|
|
|
controller_instance_type = var.controller_instance_type
|
|
|
|
|
controller_count = var.controller_count
|
|
|
|
|
db_pass = step.create_db_password.string
|
|
|
|
|
kms_key_arn = step.create_base_infra.kms_key_arn
|
|
|
|
|
local_artifact_path = step.build_boundary.artifact_path
|
|
|
|
|
ubuntu_ami_id = step.create_base_infra.ami_ids["ubuntu"]["amd64"]
|
|
|
|
|
vpc_id = step.create_base_infra.vpc_id
|
2023-10-10 09:28:04 -04:00
|
|
|
vpc_tag_module = step.create_base_infra.vpc_tag_module
|
2022-08-31 12:08:46 -04:00
|
|
|
worker_count = var.worker_count
|
|
|
|
|
worker_instance_type = var.worker_instance_type
|
2024-05-28 09:46:01 -04:00
|
|
|
aws_region = var.aws_region
|
2026-04-16 13:42:08 -04:00
|
|
|
aws_ssh_keypair_name = step.generate_ssh_key.key_pair_name
|
|
|
|
|
aws_ssh_private_key_path = step.generate_ssh_key.private_key_path
|
2022-08-31 12:08:46 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-16 11:45:55 -04:00
|
|
|
step "create_target" {
|
2026-04-16 13:42:08 -04:00
|
|
|
module = module.aws_target
|
|
|
|
|
depends_on = [
|
|
|
|
|
step.create_base_infra,
|
|
|
|
|
step.generate_ssh_key
|
|
|
|
|
]
|
2022-08-31 12:08:46 -04:00
|
|
|
|
|
|
|
|
variables {
|
2026-04-16 13:42:08 -04:00
|
|
|
ami_id = step.create_base_infra.ami_ids["ubuntu"]["amd64"]
|
|
|
|
|
aws_ssh_keypair_name = step.generate_ssh_key.key_pair_name
|
|
|
|
|
aws_ssh_private_key_path = step.generate_ssh_key.private_key_path
|
|
|
|
|
enos_user = var.enos_user
|
|
|
|
|
instance_type = var.target_instance_type
|
|
|
|
|
vpc_id = step.create_base_infra.vpc_id
|
|
|
|
|
target_count = var.target_count
|
|
|
|
|
subnet_ids = step.create_boundary_cluster.subnet_ids
|
2022-08-31 12:08:46 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-16 11:45:55 -04:00
|
|
|
step "run_e2e_test" {
|
2022-08-31 12:08:46 -04:00
|
|
|
module = module.test_e2e
|
|
|
|
|
depends_on = [
|
|
|
|
|
step.create_boundary_cluster,
|
2026-04-16 13:42:08 -04:00
|
|
|
step.create_target,
|
|
|
|
|
step.generate_ssh_key
|
2022-08-31 12:08:46 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
variables {
|
2023-06-15 11:51:14 -04:00
|
|
|
test_package = "github.com/hashicorp/boundary/testing/internal/e2e/tests/base"
|
2023-03-02 12:37:12 -05:00
|
|
|
debug_no_run = var.e2e_debug_no_run
|
2022-08-31 12:08:46 -04:00
|
|
|
alb_boundary_api_addr = step.create_boundary_cluster.alb_boundary_api_addr
|
|
|
|
|
auth_method_id = step.create_boundary_cluster.auth_method_id
|
|
|
|
|
auth_login_name = step.create_boundary_cluster.auth_login_name
|
|
|
|
|
auth_password = step.create_boundary_cluster.auth_password
|
|
|
|
|
local_boundary_dir = local.local_boundary_dir
|
2026-04-16 13:42:08 -04:00
|
|
|
aws_ssh_private_key_path = step.generate_ssh_key.private_key_path
|
2024-07-09 10:34:17 -04:00
|
|
|
target_address = step.create_target.target_private_ips[0]
|
2022-09-16 11:45:55 -04:00
|
|
|
target_user = "ubuntu"
|
2023-02-23 12:05:06 -05:00
|
|
|
target_port = "22"
|
2024-02-02 09:21:21 -08:00
|
|
|
max_page_size = step.create_boundary_cluster.max_page_size
|
2024-05-28 09:46:01 -04:00
|
|
|
aws_region = var.aws_region
|
2022-08-31 12:08:46 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output "test_results" {
|
2022-09-16 11:45:55 -04:00
|
|
|
value = step.run_e2e_test.test_results
|
2022-08-31 12:08:46 -04:00
|
|
|
}
|
2024-07-09 10:34:17 -04:00
|
|
|
|
|
|
|
|
output "controller_ips" {
|
|
|
|
|
value = step.create_boundary_cluster.controller_ips
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output "worker_ips" {
|
|
|
|
|
value = step.create_boundary_cluster.worker_ips
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output "target_ips" {
|
|
|
|
|
value = step.create_target.target_public_ips
|
|
|
|
|
}
|
2026-04-16 13:42:08 -04:00
|
|
|
|
|
|
|
|
output "aws_ssh_key_path" {
|
|
|
|
|
value = step.generate_ssh_key.private_key_path
|
|
|
|
|
}
|
2022-08-31 12:08:46 -04:00
|
|
|
}
|