From e442f9c9587c918dbff3d32d347a42e27c996140 Mon Sep 17 00:00:00 2001 From: Adrian Stobbe Date: Thu, 26 Oct 2023 16:52:58 +0200 Subject: [PATCH] rename role + declare iam dep --- .github/workflows/aws-terraform-module.yml | 7 ++++--- terraform/aws-constellation/main.tf | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/aws-terraform-module.yml b/.github/workflows/aws-terraform-module.yml index 6a1917c557..c672b33ce6 100644 --- a/.github/workflows/aws-terraform-module.yml +++ b/.github/workflows/aws-terraform-module.yml @@ -36,7 +36,8 @@ jobs: - name: Install dependencies run: | - wget https://github.com/mikefarah/yq/releases/download/v4.35.2/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq + sudo wget https://github.com/mikefarah/yq/releases/download/v4.35.2/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq + yq --version sudo apt update && sudo apt install gpg wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg gpg --no-default-keyring --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg --fingerprint @@ -69,13 +70,13 @@ jobs: cd terraform-module/aws-constellation cp ../../build/constellation . terraform init - terraform apply -var 'name=e2eAwsTF' -var 'region=eu-west-1' -var 'zone=eu-west-1b' -var 'name_prefix=e2eAwsTF' -auto-approve + terraform apply -var 'name=e2eAwsTFM' -var 'region=eu-west-1' -var 'zone=eu-west-1b' -var 'name_prefix=e2eAwsTFM' -auto-approve - name: Destroy Terraform Cluster if: always() && (steps.apply_terraform.outcome == 'failure' || steps.apply_terraform.outcome == 'success') run: | cd terraform-module/aws-constellation - terraform destroy -var 'name=e2eAwsTF' -var 'region=eu-west-1' -var 'zone=eu-west-1b' -var 'name_prefix=e2eAwsTF' -auto-approve + terraform destroy -var 'name=e2eAwsTFM' -var 'region=eu-west-1' -var 'zone=eu-west-1b' -var 'name_prefix=e2eAwsTFM' -auto-approve - name: Verify cleanup run: | diff --git a/terraform/aws-constellation/main.tf b/terraform/aws-constellation/main.tf index b4da949b6f..a872df363f 100644 --- a/terraform/aws-constellation/main.tf +++ b/terraform/aws-constellation/main.tf @@ -25,7 +25,7 @@ module "fetch_ami" { attestation_variant = "aws-sev-snp" region = var.region image = var.image - depends_on = [null_resource.ensure_yq] + depends_on = [module.aws_iam,null_resource.ensure_yq] } @@ -41,6 +41,8 @@ module "aws" { debug = var.debug enable_snp = var.enable_snp custom_endpoint = var.custom_endpoint + + depends_on = [module.aws_iam] } module "constellation" {