Skip to content

Commit

Permalink
rename role + declare iam dep
Browse files Browse the repository at this point in the history
  • Loading branch information
elchead committed Oct 26, 2023
1 parent 72693c4 commit e442f9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/aws-terraform-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand Down
4 changes: 3 additions & 1 deletion terraform/aws-constellation/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}


Expand All @@ -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" {
Expand Down

0 comments on commit e442f9c

Please sign in to comment.