-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (57 loc) · 2.24 KB
/
terraform.yml
File metadata and controls
67 lines (57 loc) · 2.24 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: "Terraform"
on:
push:
branches:
- main
jobs:
terraform:
name: "Terraform"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
############## Version 4 ##############
## TODO url should be configurable in this repo
#- name: Import Secrets
# id: import-secrets
# uses: hashicorp/vault-action@v2
# with:
# url: https://sample-cluster-public-vault-0a2cacb2.cee53a21.z1.hashicorp.cloud:8200
# token: ${{ secrets.VAULT_TOKEN }}
# namespace: admin
# secrets: |
# secret/data/sample-secret accessKey | AWS_ACCESS_KEY_ID ;
# secret/data/sample-secret secretKey | AWS_SECRET_ACCESS_KEY ;
#######################################
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
- name: Terraform Format
id: fmt
run: cd iac && terraform fmt -check
- name: Terraform Init
id: init
run: cd iac && terraform init
- name: Terraform Validate
id: validate
run: cd iac && terraform validate -no-color
- name: Terraform Plan
id: plan
run: cd iac && terraform plan -no-color -input=false -out=execution-plan.binary && terraform show --json execution-plan.binary > execution-plan.json
env:
############## Version 0 ##############
# Note: These are Canary Tokens (https://canarytokens.org/).
AWS_ACCESS_KEY_ID: AKIA2UC3BSXMEAZIFDJD
AWS_SECRET_ACCESS_KEY: ovKR7Y1JRzcqpXhYV2b8kuwVd4TUjnBEtQV7kXX1
#######################################
############## Version 3 ##############
## (replaces Version 0)
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
#######################################
############## Version 4 ##############
## (replaces Version 3)
# AWS_ACCESS_KEY_ID: "${{ steps.import-secrets.outputs.AWS_ACCESS_KEY_ID }}"
# AWS_SECRET_ACCESS_KEY: "${{ steps.import-secrets.outputs.AWS_SECRET_ACCESS_KEY }}"
#######################################