-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (35 loc) · 1.19 KB
/
Copy pathterraform_pipeline.yml
File metadata and controls
46 lines (35 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Terraform pipeline
on:
push:
branches:
main
paths:
- 'terraform_infra/**'
jobs:
plan_terraform:
runs-on: ubuntu-latest
defaults:
run:
working-directory: terraform_infra
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.15.6
- name: Initialize Terraform
run: terraform init
- name: Format correction
run: terraform fmt -check -recursive
- name: Validate the configuration
run: terraform validate
- name: Plan the infra
id: plan
run: terraform plan -out=tfplan