Skip to content

Commit fb1f089

Browse files
committed
Refactor Terraform plan commands in CI/CD workflows: unify variable file usage to terraform.tfvars for consistency.
1 parent d0e0944 commit fb1f089

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/cd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ jobs:
6969

7070
- name: Terraform Plan
7171
if: github.event.inputs.destroy != 'true'
72-
run: terraform plan -var-file=${{ github.event.inputs.environment || 'production' }}.tfvars
72+
run: terraform plan -var-file=terraform.tfvars
7373

7474
- name: Terraform Apply
7575
if: github.event.inputs.destroy != 'true'
76-
run: terraform apply -var-file=${{ github.event.inputs.environment || 'production' }}.tfvars -auto-approve
76+
run: terraform apply -var-file=terraform.tfvars -auto-approve
7777

7878
- name: Terraform Destroy
7979
if: github.event.inputs.destroy == 'true'
80-
run: terraform destroy -var-file=${{ github.event.inputs.environment || 'production' }}.tfvars -auto-approve
80+
run: terraform destroy -var-file=terraform.tfvars -auto-approve
8181

8282
- name: Get Outputs
8383
if: github.event.inputs.destroy != 'true'

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
run: terraform validate
5252

5353
- name: Terraform Plan
54-
run: terraform plan -var-file=staging.tfvars -no-color
54+
run: terraform plan -var-file=terraform.tfvars -no-color
5555

5656
validate-production:
5757
name: Validate Production
@@ -87,4 +87,4 @@ jobs:
8787
run: terraform validate
8888

8989
- name: Terraform Plan
90-
run: terraform plan -var-file=production.tfvars -no-color
90+
run: terraform plan -var-file=terraform.tfvars -no-color

0 commit comments

Comments
 (0)