Skip to content

Ad-hoc Terraform Plan #137

Ad-hoc Terraform Plan

Ad-hoc Terraform Plan #137

Workflow file for this run

name: Ad-hoc Terraform Plan
on:
workflow_dispatch:
inputs:
env:
description: 'The environment to deploy to'
required: true
type: choice
options:
- ""
- dev
- dev2
- dev3
- dev4
- dev5
- dev6
- dev7
- pentest
- test
- demo
- training
- stg
- prod
- all
env:
ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN_NONPROD }}
jobs:
matrix_prep:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set_matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set_matrix
run: |
if [[ "${{ inputs.env }}" == "all" ]]; then
matrix=[{\"env\":\"dev\"},{\"env\":\"dev2\"},{\"env\":\"dev3\"}]
fi
echo "matrix={\"include\":$(echo $matrix)}" >> $GITHUB_OUTPUT
terraform-plan:
runs-on: ubuntu-latest
strategy:
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
defaults:
run:
working-directory: ./ops
steps:
- uses: actions/checkout@v4
- name: Print env
run: echo "env ${{ matrix.env }}"
# - uses: azure/login@v1
# with:
# creds: ${{ secrets.AZURE_CREDENTIALS }}
# - name: Use prod Okta token if required
# if: ${{ matrix.env == 'prod' || matrix.env == 'stg' }}
# run: |
# echo "OKTA_API_TOKEN=${{ secrets.OKTA_API_TOKEN }}" >> "$GITHUB_ENV"
# - uses: hashicorp/[email protected]
# with:
# terraform_version: 1.3.3
# - name: Terraform Init
# run: make init-${{ matrix.env }}
# - name: Build ReportStream function app
# uses: ./.github/actions/build-reportstream-functions
# with:
# deploy-env: ${{ matrix.env }}
# - name: Terraform plan
# run: make plan-${{ matrix.env }}