Skip to content

Ad-hoc Terraform Plan #127

Ad-hoc Terraform Plan

Ad-hoc Terraform Plan #127

Workflow file for this run

name: Ad-hoc Terraform Plan
on:
workflow_dispatch:
inputs:
dev:
description: 'dev'
type: boolean
required: false
dev2:
description: 'dev2'
type: boolean
required: false
dev3:
description: 'dev3'
type: boolean
required: false
dev4:
description: 'dev4'
type: boolean
required: false
dev5:
description: 'dev5'
type: boolean
required: false
dev6:
description: 'dev6'
type: boolean
required: false
dev7:
description: 'dev7'
type: boolean
required: false
pentest:
description: 'pentest'
type: boolean
required: false
stg:
description: 'stg'
type: boolean
required: false
prod:
description: 'prod'
type: boolean
required: false
jobs:
terraform-plan:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- if: ${{ github.event.inputs.dev == true }}
env: dev
- if: ${{ github.event.inputs.dev2 == true }}
env: dev2
- if: ${{ github.event.inputs.dev3 == true }}
env: dev3
- if: ${{ github.event.inputs.dev4 == true }}
env: dev4
- if: ${{ github.event.inputs.dev5 == true }}
env: dev5
- if: ${{ github.event.inputs.dev6 == true }}
env: dev6
- if: ${{ github.event.inputs.dev7 == true }}
env: dev7
- if: ${{ github.event.inputs.pentest == true }}
env: pentest
- if: ${{ github.event.inputs.test == true }}
env: test
- if: ${{ github.event.inputs.demo == true }}
env: demo
- if: ${{ github.event.inputs.training == true }}
env: training
- if: ${{ github.event.inputs.stg == true }}
env: stg
- if: ${{ github.event.inputs.prod == true }}
env: prod
defaults:
run:
working-directory: ./ops
env: # all Azure interaction is through Terraform
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 }}
steps:
- uses: actions/checkout@v4
- 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 }}