Skip to content

Commit 36b5070

Browse files
committed
Try terraform plan
1 parent 582fee0 commit 36b5070

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Terraform Plan
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
tf_token_keeper_path:
7+
required: true
8+
type: string
9+
aws_access_key_id_keeper_path:
10+
required: true
11+
type: string
12+
aws_secret_access_key_keeper_path:
13+
required: true
14+
type: string
15+
tf_dir:
16+
required: true
17+
type: string
18+
default: "."
19+
cli_opts:
20+
required: false
21+
type: string
22+
default: " "
23+
secrets:
24+
KSM_CONFIG:
25+
required: true
26+
27+
jobs:
28+
terraform_fmt:
29+
runs-on: self-hosted
30+
container:
31+
image: buildpack-deps:bookworm
32+
steps:
33+
- uses: actions/checkout@v4
34+
name: Checkout source code
35+
- name: Retrieve secrets from Keeper
36+
id: ksecrets
37+
uses: Keeper-Security/ksm-action@master
38+
with:
39+
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
40+
secrets: |-
41+
${{ inputs.tf_token_keeper_path }} > env:TF_TOKEN
42+
${{ inputs.aws_access_key_id_keeper_path }} > env:AWS_ACCESS_KEY_ID
43+
${{ inputs.aws_secret_access_key_keeper_path }} > env:AWS_SECRET_ACCESS_KEY
44+
- name: Setup Nodejs
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: lts/*
48+
check-latest: true
49+
- name: Setup Terraform
50+
uses: hashicorp/setup-terraform@v3
51+
with:
52+
cli_config_credentials_token: ${{ env.TF_TOKEN }}
53+
- name: Terraform Init
54+
run: |
55+
cd ${{ inputs.tf_dir }}
56+
terraform init
57+
- name: Terraform Plan
58+
run: |
59+
cd ${{ inputs.tf_dir }}
60+
terraform plan -lock-timeout=30s
61+
env:
62+
KEEPER_CREDENTIAL: ${{ secrets.KSM_CONFIG }}

0 commit comments

Comments
 (0)