Skip to content

Commit a5d866f

Browse files
committed
added the plan yml content using gcp sa and tf variables as environment variables
1 parent 3637f69 commit a5d866f

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: 'Terraform'
2+
3+
on: workflow_dispatch # for manual runs, can be replaced by push, pull_request, etc.
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
terraform:
10+
name: 'Terraform'
11+
runs-on: ubuntu-latest
12+
environment: development
13+
defaults:
14+
run:
15+
shell: bash
16+
17+
steps:
18+
# Checkout the repository to the GitHub Actions runner
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
# Install the latest version of Terraform
23+
- name: Setup Terraform
24+
uses: hashicorp/setup-terraform@v3
25+
26+
27+
# Run Terraform commands
28+
- name: Terraform Init
29+
run: terraform init
30+
env:
31+
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
32+
33+
- name: Terraform Validate
34+
run: terraform validate
35+
env:
36+
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
37+
38+
- name: Terraform Plan
39+
run: terraform plan -input=false
40+
env:
41+
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
42+
43+
TF_VAR_mx_password: ${{ secrets.MX_PASSWORD }}
44+
TF_VAR_vpc_network: ${{ vars.VPC_NETWORK }}
45+
TF_VAR_subnet_name: ${{ vars.SUBNET_NAME }}
46+
TF_VAR_zone: ${{ vars.GCP_ZONE }}
47+
TF_VAR_instance_type: ${{ vars.INSTANCE_TYPE }}
48+
TF_VAR_waf_version: ${{ vars.WAF_VERSION }}
49+
TF_VAR_timezone: ${{ vars.TIMEZONE }}
50+
TF_VAR_ssh_access_source_ranges: ${{ vars.SSH_ACCESS_SOURCE_RANGES }}
51+
TF_VAR_ui_access_source_ranges: ${{ vars.UI_ACCESS_SOURCE_RANGES }}

0 commit comments

Comments
 (0)