-
Notifications
You must be signed in to change notification settings - Fork 243
/
destroy-aks-deployment.yml
50 lines (46 loc) · 1.54 KB
/
destroy-aks-deployment.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
name: $(BuildDefinitionName)_$(date:yyyyMMdd)$(rev:.r)
trigger: none
pr: none
variables:
- group: global-variables
- name: azureSubscription
value: AzureSubscription
- name: terraformVersion
value: 1.0.7
- name: terraformPath
value: terraform
- name: tfstatePath
value: terraform.tfstate
pool:
vmImage: ubuntu-latest
stages :
- stage: destroy
displayName: 'Terraform Destroy'
jobs:
- job: destroy
displayName: 'Terraform Destroy'
continueOnError: false
steps:
- task: TerraformInstaller@0
displayName: 'Terraform Install'
inputs:
terraformVersion: $(terraformVersion)
- task: TerraformTaskV2@2
displayName: 'Terraform Init'
inputs:
provider: 'azurerm'
command: 'init'
backendServiceArm: $(azureSubscription)
backendAzureRmResourceGroupName: $(terraformBackendResourceGroupName)
backendAzureRmStorageAccountName: $(terraformBackendStorageAccountName)
backendAzureRmContainerName: '$(terraformBackendContainerName)'
backendAzureRmKey: $(tfstatePath)
workingDirectory: '$(System.DefaultWorkingDirectory)/$(terraformPath)/'
- task: TerraformTaskV1@0
displayName: 'Terraform Destroy'
inputs:
provider: 'azurerm'
command: 'destroy'
commandOptions: '-input=false -auto-approve -var ssh_public_key="$(sshPublicKey)'
environmentServiceNameAzureRM: $(azureSubscription)
workingDirectory: '$(System.DefaultWorkingDirectory)/$(terraformPath)/'