-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtf-apply-pipeline-d.yaml
52 lines (45 loc) · 1.38 KB
/
tf-apply-pipeline-d.yaml
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
trigger:
- none
variables:
- name: environmentServiceNameAzureRM
value: ENVServiceConnection
- name: backendServiceArm
value: ENVServiceConnection
pool:
vmImage: ubuntu-latest
steps:
- task: TerraformInstaller@0
displayName: Terraform Installer
inputs:
terraformVersion: 'latest'
- task: TerraformTaskV3@3
displayName: Terraform Init
inputs:
provider: 'azurerm'
command: 'init'
commandOptions: '-reconfigure -lock=false'
backendServiceArm: $(backendServiceArm)
backendAzureRmResourceGroupName: 'myrg'
backendAzureRmStorageAccountName: 'yourbackendstorage2024'
backendAzureRmContainerName: 'cterraformstate'
backendAzureRmKey: 'terraform.tfstate'
- task: TerraformTaskV3@3
displayName: Terraform Validate
inputs:
provider: 'azurerm'
command: 'validate'
environmentServiceNameAzureRM: $(environmentServiceNameAzureRM)
- task: TerraformTaskV3@3
displayName: Terraform Plan
inputs:
provider: 'azurerm'
command: 'plan'
commandOptions: '-var-file="./environment/development.tfvars"'
environmentServiceNameAzureRM: $(environmentServiceNameAzureRM)
# - task: TerraformTaskV3@3
# displayName: Terraform Apply
# inputs:
# provider: 'azurerm'
# command: 'apply'
# commandOptions: '-auto-approve -var-file="./environment/development.tfvars"'
# environmentServiceNameAzureRM: $(environmentServiceNameAzureRM)