-
Notifications
You must be signed in to change notification settings - Fork 5
62 lines (49 loc) · 1.62 KB
/
destroy.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
name: 'Terraform Destroy All Resources'
on:
workflow_dispatch:
inputs:
action:
description: "Terraform Destroy All Resources"
required: false
default: "destroy"
permissions:
id-token: write
contents: read
jobs:
pack_deploy:
name: Build and Destroy DataLake
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: HashiCorp - Setup Terraform
uses: hashicorp/setup-terraform@v1.2.1
- name: 'Az CLI login'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: 'IaC Apply'
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_SECRET: ${{ secrets.AZURE_SECRET }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
COMMAND_IAC: terraform
run: |
export ARM_CLIENT_ID=$AZURE_CLIENT_ID
export ARM_CLIENT_SECRET=$AZURE_SECRET
export ARM_SUBSCRIPTION_ID=$AZURE_SUBSCRIPTION_ID
export ARM_TENANT_ID=$AZURE_TENANT_ID
cd k8s/resources/AKS
$COMMAND_IAC init
$COMMAND_IAC destroy -auto-approve
cd ..
cd resources_1
$COMMAND_IAC init
$COMMAND_IAC destroy -auto-approve
cd ..
cd resources_2
$COMMAND_IAC init
$COMMAND_IAC destroy --target azurerm_data_factory_pipeline.CopySqlServerToBronzeBlobContainer -auto-approve
$COMMAND_IAC destroy -auto-approve