-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (59 loc) · 2.04 KB
/
scenario1.terraform.hub.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: 'Scenario 1: Terraform HUB Multi-tenant Secure Baseline'
on:
workflow_dispatch:
inputs:
destroy:
description: 'Destroy resources?'
required: true
type: boolean
default: false
push:
branches:
- main
paths:
- '.github/workflows/terraform.scenario1.hub.yml'
- '.github/workflows/_template.terraform.yml'
- 'scenarios/secure-baseline-multitenant/terraform/solutions/hub/**'
- '!scenarios/secure-baseline-multitenant/terraform/solutions/hub/**.md'
pull_request:
branches:
- main
- feature/*
paths:
- '.github/workflows/terraform.scenario1.hub.yml'
- '.github/workflows/_template.terraform.yml'
- 'scenarios/secure-baseline-multitenant/terraform/solutions/hub/**'
- '!scenarios/secure-baseline-multitenant/terraform/solutions/hub/**.md'
permissions:
id-token: write
contents: read
pull-requests: write
env:
modulePath: 'scenarios/secure-baseline-multitenant/terraform/solutions/hub'
terraformVersion: 1.3.9 # must be greater than or equal to 1.2 for OIDC
backendStateKey: 'scenario1.hub.tfstate'
tfvarPath: 'Parameters/uat.tfvars'
jobs:
prepare-environment:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@main
outputs:
modulePath: ${{ env.modulePath }}
terraformVersion: ${{ env.terraformVersion }}
backendStateKey: ${{ env.backendStateKey }}
tfvarPath: ${{ env.tfvarPath }}
call-workflow-passing-data:
name: 'Terraform CICD'
needs:
- prepare-environment
uses: ./.github/workflows/.template.terraform.yml
with:
modulePath: ${{ needs.prepare-environment.outputs.modulePath }}
terraformVersion: ${{ needs.prepare-environment.outputs.terraformVersion }}
backendStateKey: ${{ needs.prepare-environment.outputs.backendStateKey }}
tfvarPath: ${{ needs.prepare-environment.outputs.tfvarPath }}
# Ensure this value is a boolean
destroy: ${{ github.event.inputs.destroy == 'true' }}
secrets: inherit