forked from kousikm/azure-devops-terraform-k8s-pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-k8s-cluster-pipelines.yml
33 lines (29 loc) · 1.01 KB
/
create-k8s-cluster-pipelines.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
trigger:
- master
pool:
- vmlmage: 'ubuntu-latest'
steps:
- script: echo K8S Terraform Azure!
displayName: 'Run a one-line script'
- task: DownloadSecureFile@l
name: publickey
inputs:
secureFile: 'azure rsa.pub'
- task: TerraformCLI@0
inputs:
comand: 'init'
workingDirectory: '$(System.DefaultWorkingDirectory)/configuration/iaac/azure'
backendType: 'azurerm'
backendServiceArm: 'azure-service-connection'
ensureBackend: true
backendAzureRmResourceGroupName: 'backend-rg'
backendAzureRmResourceGroupLocation: 'eastus'
backendAzureRmStorageAccountName: 'storageacctnamexm1'
backendAzureRmContainerName: 'storageaccntcon'
backendAzureRmKey: 'k8.tfstate'
- task: TerraformCLI@0
inputs:
command: 'apply'
workingDirectory: '$(System.DefaultWorkingDirectory)/configuration/iaac/azure'
environmentServiceName: 'azure-service-connection'
commandOptions: '-var client_id=$(client_id) -var client_secret=$(client_secret) -var ssh_public_key=$(publickey.secureFilePath)'