Skip to content

fix chap07

fix chap07 #88

Workflow file for this run

name: 'Terraform'
defaults:
run:
shell: bash
working-directory: CHAP12/cert/
on:
push:
branches:
- main
permissions:
contents: read
jobs:
terraform:
runs-on: ubuntu-latest
name: Terraform
environment: dev
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install terraform-plan-summary
run: |
REPO="dineshba/terraform-plan-summary"
curl -LO https://github.com/$REPO/releases/latest/download/tf-summarize_linux_amd64.zip
tmpDir=$(mktemp -d -t tmp.XXXXXXXXXX)
mv tf-summarize_linux_amd64.zip $tmpDir
cd $tmpDir
unzip tf-summarize_linux_amd64.zip
chmod +x tf-summarize
echo $PWD >> $GITHUB_PATH
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.4.6
terraform_wrapper: false
- name: Terraform Init
id: init
run: terraform init
- name: Terraform Plan
id: plan
run: terraform plan -input=false -no-color -out tf.plan
- name: summary in draw table format
run: |
rm -rf tf-summarize-table-output.md
terraform show -json tf.plan | tf-summarize -md > tf-summarize-table-output.md
- name: Adding markdown
run: |
cat tf-summarize-table-output.md > $GITHUB_STEP_SUMMARY
- name: Terraform Apply
run: terraform apply -input=false tf.plan