Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .github/workflows/k8s_terraform_apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ permissions:
contents: read
id-token: write
packages: read
pull-requests: write

jobs:
terraform:
Expand All @@ -26,7 +25,8 @@ jobs:
TF_WORKSPACE: prod
TF_IN_AUTOMATION: true
TF_INPUT: 0
runs-on: acmapp-builder
# Kubernetes-mode pool. This job container is a pod, so Terraform uses in-cluster config.
runs-on: acmapp-k8s
container:
image: ghcr.io/acm-uic/iac-runner:latest
credentials:
Expand Down Expand Up @@ -67,10 +67,9 @@ jobs:

- name: 'Terraform Apply'
id: apply
uses: dflook/terraform-apply@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: "kubernetes/terraform/stacks/${{ matrix.stack }}"
workspace: ${{ env.TF_WORKSPACE }}
var_file: "kubernetes/terraform/stacks/${{ matrix.stack }}/configuration/${{ env.TF_WORKSPACE }}.tfvars"
run: |
workspace="$TF_WORKSPACE"
unset TF_WORKSPACE
terraform init -input=false -reconfigure
terraform workspace select "$workspace" || terraform workspace new "$workspace"
terraform apply -input=false -auto-approve -no-color -var-file="configuration/${workspace}.tfvars"
17 changes: 8 additions & 9 deletions .github/workflows/k8s_terraform_plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ permissions:
contents: read
id-token: write
packages: read
pull-requests: write

jobs:
terraform:
Expand All @@ -23,7 +22,8 @@ jobs:
TF_WORKSPACE: prod
TF_IN_AUTOMATION: true
TF_INPUT: 0
runs-on: acmapp-builder
# Kubernetes-mode pool. This job container is a pod, so Terraform uses in-cluster config.
runs-on: acmapp-k8s
container:
image: ghcr.io/acm-uic/iac-runner:latest
credentials:
Expand Down Expand Up @@ -63,10 +63,9 @@ jobs:

- name: 'Terraform Plan'
id: plan
uses: dflook/terraform-plan@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: "kubernetes/terraform/stacks/${{ matrix.stack }}"
workspace: ${{ env.TF_WORKSPACE }}
var_file: "kubernetes/terraform/stacks/${{ matrix.stack }}/configuration/${{ env.TF_WORKSPACE }}.tfvars"
run: |
workspace="$TF_WORKSPACE"
unset TF_WORKSPACE
terraform init -input=false -reconfigure
terraform workspace select "$workspace" || terraform workspace new "$workspace"
terraform plan -input=false -no-color -var-file="configuration/${workspace}.tfvars"
Loading