From d5b3d4fd6f74824d920200ecd5846fa349c52ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wei=C3=9Fe?= <66256922+daniel-weisse@users.noreply.github.com> Date: Mon, 4 Mar 2024 13:48:30 +0100 Subject: [PATCH] ci: use collision resistant name for Terraform e2e test (#2967) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use collision resistant name for Terraform e2e test * Remove test suffix from Terraform provider examples --------- Signed-off-by: Daniel Weiße --- .../workflows/e2e-test-provider-example.yml | 18 ++++++++++-------- .../examples/full/azure/main.tf | 4 ++-- .../examples/full/gcp/main.tf | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/e2e-test-provider-example.yml b/.github/workflows/e2e-test-provider-example.yml index 6f2d92063..5359358c8 100644 --- a/.github/workflows/e2e-test-provider-example.yml +++ b/.github/workflows/e2e-test-provider-example.yml @@ -83,14 +83,6 @@ jobs: ref: main stream: nightly - - name: Create resource prefix - id: create-prefix - shell: bash - run: | - run_id=${{ github.run_id }} - last_three="${run_id: -3}" - echo "prefix=e2e-${last_three}" | tee -a "$GITHUB_OUTPUT" - - name: Determine cloudprovider from attestation variant id: determine shell: bash @@ -124,6 +116,16 @@ jobs: buildBuddyApiKey: ${{ secrets.BUILDBUDDY_ORG_API_KEY }} nixTools: terraform + - name: Create prefix + id: create-prefix + shell: bash + run: | + uuid=$(uuidgen | tr "[:upper:]" "[:lower:]") + uuid="${uuid%%-*}" + uuid="${uuid: -3}" # Final resource name must be no longer than 10 characters on AWS + echo "uuid=${uuid}" | tee -a "${GITHUB_OUTPUT}" + echo "prefix=e2e-${uuid}" | tee -a "${GITHUB_OUTPUT}" + - name: Build Constellation provider and CLI # CLI is needed for the upgrade assert and container push is needed for the microservice upgrade working-directory: ${{ github.workspace }} id: build diff --git a/terraform-provider-constellation/examples/full/azure/main.tf b/terraform-provider-constellation/examples/full/azure/main.tf index 629f07e2d..46a5f8f9b 100644 --- a/terraform-provider-constellation/examples/full/azure/main.tf +++ b/terraform-provider-constellation/examples/full/azure/main.tf @@ -44,8 +44,8 @@ module "azure_iam" { // replace $VERSION with the Constellation version you want to use, e.g., v2.14.0 source = "https://github.com/edgelesssys/constellation/releases/download/$VERSION/terraform-module.zip//terraform-module/iam/azure" location = local.location - service_principal_name = "${local.name}-test-sp" - resource_group_name = "${local.name}-test-rg" + service_principal_name = "${local.name}-sp" + resource_group_name = "${local.name}-rg" } module "azure_infrastructure" { diff --git a/terraform-provider-constellation/examples/full/gcp/main.tf b/terraform-provider-constellation/examples/full/gcp/main.tf index 1db0f63fb..f7ac80b04 100644 --- a/terraform-provider-constellation/examples/full/gcp/main.tf +++ b/terraform-provider-constellation/examples/full/gcp/main.tf @@ -46,7 +46,7 @@ module "gcp_iam" { // replace $VERSION with the Constellation version you want to use, e.g., v2.14.0 source = "https://github.com/edgelesssys/constellation/releases/download/$VERSION/terraform-module.zip//terraform-module/iam/gcp" project_id = local.project_id - service_account_id = "${local.name}-test-sa" + service_account_id = "${local.name}-sa" zone = local.zone region = local.region }