2022-10-26 16:07:19 -04:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
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,
|
|
|
|
|
provider.enos.default
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
matrix {
|
|
|
|
|
builder = ["local", "crt"]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
locals {
|
|
|
|
|
aws_ssh_private_key_path = abspath(var.aws_ssh_private_key_path)
|
|
|
|
|
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 = [
|
|
|
|
|
var.worker_instance_type,
|
|
|
|
|
var.controller_instance_type
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-27 14:59:46 -04:00
|
|
|
step "read_license" {
|
|
|
|
|
skip_step = var.boundary_edition == "oss"
|
|
|
|
|
module = module.read_license
|
|
|
|
|
|
|
|
|
|
variables {
|
|
|
|
|
file_name = local.license_path
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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,
|
2022-08-31 12:08:46 -04:00
|
|
|
step.build_boundary
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
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
|
2022-08-31 12:08:46 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-16 11:45:55 -04:00
|
|
|
step "create_target" {
|
2023-10-10 09:28:04 -04:00
|
|
|
module = module.aws_target
|
2022-08-31 12:08:46 -04:00
|
|
|
depends_on = [step.create_base_infra]
|
|
|
|
|
|
|
|
|
|
variables {
|
|
|
|
|
ami_id = step.create_base_infra.ami_ids["ubuntu"]["amd64"]
|
|
|
|
|
aws_ssh_keypair_name = var.aws_ssh_keypair_name
|
|
|
|
|
enos_user = var.enos_user
|
|
|
|
|
instance_type = var.target_instance_type
|
|
|
|
|
vpc_id = step.create_base_infra.vpc_id
|
2022-09-16 11:45:55 -04:00
|
|
|
target_count = 1
|
2023-04-12 14:21:23 -06:00
|
|
|
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,
|
2022-09-16 11:45:55 -04:00
|
|
|
step.create_target
|
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
|
|
|
|
|
aws_ssh_private_key_path = local.aws_ssh_private_key_path
|
2023-09-06 17:29:35 -04:00
|
|
|
target_address = step.create_target.target_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
|
|
|
}
|
|
|
|
|
}
|