Skip to content

Commit bcdb109

Browse files
committed
update tfplan output command
1 parent 0e9429a commit bcdb109

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.github/workflows/tf_cloud_aws.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,27 @@ jobs:
4747
working-directory: ${{ env.tfcode_path }}
4848

4949
- name: Terraform Plan
50+
id: plan
5051
run: |
5152
echo "** Running Terraform Plan**"
52-
# terraform plan -out=tfplan
53-
terraform plan
53+
terraform plan -out=tfplan
54+
# echo "::set-output name=plan_id::tfplan"
5455
working-directory: ${{ env.tfcode_path }}
5556

57+
- name: Terraform Plan Output
58+
uses: hashicorp/tfc-workflows-github/actions/plan-output@v1.3.0
59+
id: plan-output
60+
with:
61+
plan: ${{ steps.plan.outputs.plan_id }}
62+
63+
- name: Reference Plan Output
64+
run: |
65+
echo "Plan status: ${{ steps.plan-output.outputs.plan_status }}"
66+
echo "Resources to Add: ${{ steps.plan-output.outputs.add }}"
67+
echo "Resources to Change: ${{ steps.plan-output.outputs.change }}"
68+
echo "Resources to Destroy: ${{ steps.plan-output.outputs.destroy }}"
69+
70+
5671
# Once the user verifies the Terraform Plan, the user can run the Terraform Apply and Destroy commands
5772
apply_terraform_plan:
5873
needs: aws_tfc_job

youtube_tf_demo/.terraform.lock.hcl

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)