-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (35 loc) · 1.08 KB
/
terraform_provision.yml
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 Provision
on:
# push:
# branches: [main]
workflow_dispatch:
jobs:
provision-terraform:
runs-on: ubuntu-latest
env:
TF_VAR_awskey01: ${{ secrets.ssh_private_key }}
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_key }}
TF_VAR_db_user_name: ${{ secrets.db_user_name }}
TF_VAR_db_password: ${{ secrets.db_password }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: set up terraform
uses: hashicorp/setup-terraform@v2
id: setupterraform
- name: terraform init
id: initailizeterraform
run: terraform init -migrate-state
- name: format terraform
id: formatterraform
run: terraform fmt
- name: terraform validate
id: validateterraform
run: terraform validate
- name: terraform plan
id: plan
run: terraform plan -input=false
- name: terraform apply
id: apply
run: terraform apply --auto-approve