From 369f818f4c39f303e4d41af8130982b765b1c18d Mon Sep 17 00:00:00 2001 From: Jaymala Date: Tue, 16 Aug 2022 13:07:19 -0400 Subject: [PATCH] Update Enos run (#2326) * Rotate the credential used for the Enos SSH Key * Use the enos provider from TFC Signed-off-by: Jaymala Sinha --- .github/workflows/enos-run.yml | 8 ++++---- enos/enos.hcl | 15 +-------------- enos/modules/bats_deps/main.tf | 2 +- enos/modules/binary_finder/main.tf | 2 +- enos/modules/build_local/main.tf | 2 +- enos/modules/test_cli_ui/tests.tf | 6 +++--- enos/modules/test_smoke/main.tf | 2 +- 7 files changed, 12 insertions(+), 25 deletions(-) diff --git a/.github/workflows/enos-run.yml b/.github/workflows/enos-run.yml index e0b6828f1..7acf5fe9c 100644 --- a/.github/workflows/enos-run.yml +++ b/.github/workflows/enos-run.yml @@ -70,7 +70,7 @@ jobs: - name: Set up AWS SSH private key run: | mkdir -p ./enos/support - echo "${{ secrets.ENOS_CI_SSH_KEYPAIR }}" > ./enos/support/private_key.pem + echo "${{ secrets.ENOS_CI_SSH_KEY }}" > ./enos/support/private_key.pem chmod 600 ./enos/support/private_key.pem - name: Set up Bats CLI UI tests dependency cache if: matrix.test == 'cli_ui' @@ -129,7 +129,7 @@ jobs: continue-on-error: true env: ENOS_VAR_aws_region: us-east-1 - ENOS_VAR_aws_ssh_keypair_name: enos-ci-ssh-keypair + ENOS_VAR_aws_ssh_keypair_name: enos-ci-ssh-key ENOS_VAR_aws_ssh_private_key_path: ./support/private_key.pem ENOS_VAR_local_boundary_dir: ./support/ ENOS_VAR_crt_bundle_path: ./support/boundary.zip @@ -145,7 +145,7 @@ jobs: if: steps.run.outcome == 'failure' env: ENOS_VAR_aws_region: us-east-1 - ENOS_VAR_aws_ssh_keypair_name: enos-ci-ssh-keypair + ENOS_VAR_aws_ssh_keypair_name: enos-ci-ssh-key ENOS_VAR_aws_ssh_private_key_path: ./support/private_key.pem ENOS_VAR_local_boundary_dir: ./support/ ENOS_VAR_crt_bundle_path: ./support/boundary.zip @@ -159,7 +159,7 @@ jobs: if: ${{ always() }} env: ENOS_VAR_aws_region: us-east-1 - ENOS_VAR_aws_ssh_keypair_name: enos-ci-ssh-keypair + ENOS_VAR_aws_ssh_keypair_name: enos-ci-ssh-key ENOS_VAR_aws_ssh_private_key_path: ./support/private_key.pem ENOS_VAR_local_boundary_dir: ./support/ ENOS_VAR_crt_bundle_path: ./support/boundary.zip diff --git a/enos/enos.hcl b/enos/enos.hcl index 3969e8c86..0423b6738 100644 --- a/enos/enos.hcl +++ b/enos/enos.hcl @@ -1,18 +1,6 @@ terraform_cli "default" { plugin_cache_dir = abspath("./terraform-plugin-cache") - provider_installation { - network_mirror { - url = "https://enos-provider-stable.s3.amazonaws.com/" - include = ["hashicorp.com/qti/enos"] - } - direct { - exclude = [ - "hashicorp.com/qti/enos" - ] - } - } - credentials "app.terraform.io" { token = var.tfc_api_token } @@ -23,8 +11,7 @@ terraform "default" { required_providers { enos = { - source = "hashicorp.com/qti/enos" - version = ">= 0.2.1" + source = "app.terraform.io/hashicorp-qti/enos" } aws = { diff --git a/enos/modules/bats_deps/main.tf b/enos/modules/bats_deps/main.tf index 6821a3ca6..45ec3b665 100644 --- a/enos/modules/bats_deps/main.tf +++ b/enos/modules/bats_deps/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { enos = { - source = "hashicorp.com/qti/enos" + source = "app.terraform.io/hashicorp-qti/enos" } } } diff --git a/enos/modules/binary_finder/main.tf b/enos/modules/binary_finder/main.tf index 2817e07e2..b2a3fae1d 100644 --- a/enos/modules/binary_finder/main.tf +++ b/enos/modules/binary_finder/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { enos = { - source = "hashicorp.com/qti/enos" + source = "app.terraform.io/hashicorp-qti/enos" } } } diff --git a/enos/modules/build_local/main.tf b/enos/modules/build_local/main.tf index 3470db923..f53056fb8 100644 --- a/enos/modules/build_local/main.tf +++ b/enos/modules/build_local/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { enos = { - source = "hashicorp.com/qti/enos" + source = "app.terraform.io/hashicorp-qti/enos" } } } diff --git a/enos/modules/test_cli_ui/tests.tf b/enos/modules/test_cli_ui/tests.tf index 4d751801c..ecfc4e4da 100644 --- a/enos/modules/test_cli_ui/tests.tf +++ b/enos/modules/test_cli_ui/tests.tf @@ -1,7 +1,7 @@ terraform { required_providers { enos = { - source = "hashicorp.com/qti/enos" + source = "app.terraform.io/hashicorp-qti/enos" } } } @@ -62,9 +62,9 @@ resource "enos_local_exec" "create_account" { environment = { BOUNDARY_ADDR = var.alb_boundary_api_addr, BOUNDARY_TOKEN = local.auth_token, - BP = local.test_password + BP = local.test_password } - inline = ["${var.local_boundary_dir}/boundary accounts create password -auth-method-id ${var.auth_method_id} -login-name ${local.test_user} -name ${local.test_user} -password env://BP -description 'test user' -format json"] + inline = ["${var.local_boundary_dir}/boundary accounts create password -auth-method-id ${var.auth_method_id} -login-name ${local.test_user} -name ${local.test_user} -password env://BP -description 'test user' -format json"] } resource "enos_local_exec" "create_role" { diff --git a/enos/modules/test_smoke/main.tf b/enos/modules/test_smoke/main.tf index 1a10b3589..ad057ca61 100644 --- a/enos/modules/test_smoke/main.tf +++ b/enos/modules/test_smoke/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { enos = { - source = "hashicorp.com/qti/enos" + source = "app.terraform.io/hashicorp-qti/enos" } } }