Skip to content

Commit

Permalink
Merge pull request #4830 from hashicorp/backport/moduli-e2e-aws-regio…
Browse files Browse the repository at this point in the history
…n/smoothly-suitable-vervet

This pull request was automerged via backport-assistant
  • Loading branch information
hc-github-team-secure-boundary authored May 28, 2024
2 parents 3dc6912 + a0f7955 commit fcf45bd
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions enos/enos-scenario-e2e-aws-base-with-vault.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ scenario "e2e_aws_base_with_vault" {
vpc_tag_module = step.create_base_infra.vpc_tag_module
worker_count = var.worker_count
worker_instance_type = var.worker_instance_type
aws_region = var.aws_region
}
}

Expand Down Expand Up @@ -159,6 +160,7 @@ scenario "e2e_aws_base_with_vault" {
target_port = "22"
vault_addr = step.create_vault_cluster.instance_public_ips[0]
vault_root_token = step.create_vault_cluster.vault_root_token
aws_region = var.aws_region
}
}

Expand Down
2 changes: 2 additions & 0 deletions enos/enos-scenario-e2e-aws-base.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ scenario "e2e_aws_base" {
vpc_tag_module = step.create_base_infra.vpc_tag_module
worker_count = var.worker_count
worker_instance_type = var.worker_instance_type
aws_region = var.aws_region
}
}

Expand Down Expand Up @@ -135,6 +136,7 @@ scenario "e2e_aws_base" {
target_user = "ubuntu"
target_port = "22"
max_page_size = step.create_boundary_cluster.max_page_size
aws_region = var.aws_region
}
}

Expand Down
2 changes: 2 additions & 0 deletions enos/enos-scenario-e2e-aws.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ scenario "e2e_aws" {
vpc_tag_module = step.create_base_infra.vpc_tag_module
worker_count = var.worker_count
worker_instance_type = var.worker_instance_type
aws_region = var.aws_region
}
}

Expand Down Expand Up @@ -239,6 +240,7 @@ scenario "e2e_aws" {
target_address = step.create_isolated_target.target_ips[0]
worker_tag_egress = local.egress_tag
max_page_size = step.create_boundary_cluster.max_page_size
aws_region = var.aws_region
}
}

Expand Down
1 change: 1 addition & 0 deletions enos/enos-scenario-e2e-database.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ scenario "e2e_database" {
aws_secret_access_key = step.iam_setup.secret_access_key
aws_host_set_filter1 = step.create_tag_inputs.tag_string
max_page_size = 10
aws_region = var.aws_region
}
}

Expand Down
1 change: 1 addition & 0 deletions enos/enos-scenario-e2e-ui-aws.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ scenario "e2e_ui_aws" {
worker_count = var.worker_count
worker_instance_type = var.worker_instance_type
worker_type_tags = [local.egress_tag]
aws_region = var.aws_region
}
}

Expand Down
1 change: 1 addition & 0 deletions enos/enos-variables.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ variable "go_test_timeout" {
variable "aws_region" {
description = "AWS region where the resources will be created"
type = string
default = "us-east-1"
}

variable "go_version" {
Expand Down
2 changes: 1 addition & 1 deletion enos/enos.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ terraform "default" {
}

provider "aws" "default" {
region = "us-east-1"
region = var.aws_region
}

provider "enos" "default" {
Expand Down
4 changes: 2 additions & 2 deletions testing/internal/e2e/boundary/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func AddHostToHostSetCli(t testing.TB, ctx context.Context, hostSetId string, ho

// CreateAwsHostCatalogCli uses the cli to create a new AWS dynamic host catalog.
// Returns the id of the new host catalog.
func CreateAwsHostCatalogCli(t testing.TB, ctx context.Context, projectId string, accessKeyId string, secretAccessKey string) (string, error) {
func CreateAwsHostCatalogCli(t testing.TB, ctx context.Context, projectId, accessKeyId, secretAccessKey, region string) (string, error) {
name, err := base62.Random(16)
if err != nil {
return "", err
Expand All @@ -215,7 +215,7 @@ func CreateAwsHostCatalogCli(t testing.TB, ctx context.Context, projectId string
"-scope-id", projectId,
"-plugin-name", "aws",
"-attr", "disable_credential_rotation=true",
"-attr", "region=us-east-1",
"-attr", fmt.Sprintf("region=%s", region),
"-secret", "access_key_id=env://E2E_AWS_ACCESS_KEY_ID",
"-secret", "secret_access_key=env://E2E_AWS_SECRET_ACCESS_KEY",
"-name", fmt.Sprintf("e2e Host Catalog %s", name),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestCliCreateAwsDynamicHostCatalogWithEmptyHostSet(t *testing.T) {
})
projectId, err := boundary.CreateProjectCli(t, ctx, orgId)
require.NoError(t, err)
hostCatalogId, err := boundary.CreateAwsHostCatalogCli(t, ctx, projectId, c.AwsAccessKeyId, c.AwsSecretAccessKey)
hostCatalogId, err := boundary.CreateAwsHostCatalogCli(t, ctx, projectId, c.AwsAccessKeyId, c.AwsSecretAccessKey, c.AwsRegion)
require.NoError(t, err)

// Set up a host set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestCliCreateAwsDynamicHostCatalogWithHostSet(t *testing.T) {
})
projectId, err := boundary.CreateProjectCli(t, ctx, orgId)
require.NoError(t, err)
hostCatalogId, err := boundary.CreateAwsHostCatalogCli(t, ctx, projectId, c.AwsAccessKeyId, c.AwsSecretAccessKey)
hostCatalogId, err := boundary.CreateAwsHostCatalogCli(t, ctx, projectId, c.AwsAccessKeyId, c.AwsSecretAccessKey, c.AwsRegion)
require.NoError(t, err)

// Set up a host set
Expand Down Expand Up @@ -178,7 +178,7 @@ func TestApiCreateAwsDynamicHostCatalog(t *testing.T) {
hostcatalogs.WithPluginName("aws"),
hostcatalogs.WithAttributes(map[string]any{
"disable_credential_rotation": true,
"region": "us-east-1",
"region": c.AwsRegion,
}),
hostcatalogs.WithSecrets(map[string]any{
"access_key_id": c.AwsAccessKeyId,
Expand Down
1 change: 1 addition & 0 deletions testing/internal/e2e/tests/database/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type config struct {
AwsAccessKeyId string `envconfig:"E2E_AWS_ACCESS_KEY_ID" required:"true"`
AwsSecretAccessKey string `envconfig:"E2E_AWS_SECRET_ACCESS_KEY" required:"true"`
AwsHostSetFilter string `envconfig:"E2E_AWS_HOST_SET_FILTER" required:"true"` // e.g. "tag:testtag=true"
AwsRegion string `envconfig:"E2E_AWS_REGION" required:"true"` // e.g. "us-east-1"
}

func loadTestConfig() (*config, error) {
Expand Down
2 changes: 1 addition & 1 deletion testing/internal/e2e/tests/database/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func populateBoundaryDatabase(t testing.TB, ctx context.Context, c *config, te T
require.NoError(t, err)

// Create AWS dynamic host catalog
awsHostCatalogId, err := boundary.CreateAwsHostCatalogCli(t, ctx, projectId, c.AwsAccessKeyId, c.AwsSecretAccessKey)
awsHostCatalogId, err := boundary.CreateAwsHostCatalogCli(t, ctx, projectId, c.AwsAccessKeyId, c.AwsSecretAccessKey, c.AwsRegion)
require.NoError(t, err)
awsHostSetId, err := boundary.CreateAwsHostSetCli(t, ctx, awsHostCatalogId, c.AwsHostSetFilter)
require.NoError(t, err)
Expand Down

0 comments on commit fcf45bd

Please sign in to comment.