Skip to content

Terraform Plan

Terraform Plan #189

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Terraform Plan
# Controls when the workflow will run
on:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions: write-all
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Plan:
# The type of runner that the job will run on
runs-on: [ "csvd-ec2" ]
env:
GITHUB_APP_INSTALLATION_ID: ${{ vars.GH_APP_INSTALLATION_ID }}
GITHUB_APP_PEM_FILE: ${{ secrets.GH_APP_PEM_FILE }}
GITHUB_OWNER: CSVD
GITHUB_BASE_URL: https://github.e.it.census.gov/
TF_WORKSPACE: ${{ vars.terraform_workspace }}
TF_CLI_ARGS_plan: -lock-timeout=30m
TF_CLI_ARGS_apply: -lock-timeout=30m
NO_PROXY: ${{ vars.NO_PROXY }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: AWS Auth
id: aws_auth
uses: CSVD/aws-auth@main
with:
ec2: true
instance_role: Morpheus-InstanceRole
- name: Setup GITHUB Credentials
id: github_credentials
run: |
echo GITHUB_TOKEN=$(python encode_jwt.py "$GITHUB_APP_PEM_FILE" "$GITHUB_APP_INSTALLATION_ID" "$GITHUB_BASE_URL") >> $GITHUB_ENV
- name: Terraform Init
uses: CSVD/terraform-init@main
id: terraform_init
with:
terraform_version: "1.9.1"
workspace: ${{ vars.terraform_workspace }}
setup_terraform: true
terraform_init: true
env:
GITHUB_TOKEN: $GITHUB_TOKEN
NO_PROXY: "*.census.gov"
AWS_ACCESS_KEY_ID: ${{ steps.aws_auth.outputs.aws_access_key_id }}
AWS_SECRET_ACCESS_KEY: $${{ steps.aws_auth.outputs.aws_secret_access_key }}
AWS_SESSION_TOKEN: ${{ steps.aws_auth.outputs.aws_session_token }}
- name: Terraform Plan
uses: CSVD/terraform-plan@main
with:
terraform_version: "1.9.1"
workspace: ${{ vars.terraform_workspace }}
commit_sha: ${{ steps.terraform_init.outputs.commit_sha }}
varfile: varfiles/${{ vars.terraform_workspace }}.tfvars
download_cache: true
setup_terraform: false
env:
AWS_ACCESS_KEY_ID: ${{ steps.aws_auth.outputs.aws_access_key_id }}
AWS_SECRET_ACCESS_KEY: $${{ steps.aws_auth.outputs.aws_secret_access_key }}
AWS_SESSION_TOKEN: ${{ steps.aws_auth.outputs.aws_session_token }}
GITHUB_TOKEN: $GITHUB_TOKEN