Skip to content

Commit e2ab2e2

Browse files
committed
Third Commit - QA AKS Cluster Provision via terraform
1 parent 27e112c commit e2ab2e2

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

01-terraform-provision-aks-cluster-pipeline.yml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
trigger:
2-
- main
2+
- master
33

44
pool:
55
vmImage: 'ubuntu-latest'
@@ -103,3 +103,53 @@ stages:
103103
environmentServiceName: 'terraform-aks-azurerm-svc-con'
104104
commandOptions: '$(Pipeline.Workspace)/terraform-manifests-out/$(DEV_ENVIRONMENT)-$(Build.BuildId).out'
105105
allowTelemetryCollection: false
106+
107+
# Stage-2: Deploy Stages for Dev & QA
108+
# Deployment-2: Deploy QA AKS Cluster
109+
## Step-1: Download Secure File
110+
## Step-2: Terraform Initialize (State Storage to store in Azure Storage Account)
111+
## Step-3: Terraform Plan
112+
## Step-4: Terraform Apply
113+
114+
- deployment: DeployQAAKSCluster
115+
displayName: DeployQAAKSCluster
116+
pool:
117+
vmImage: 'ubuntu-latest'
118+
environment: $(QA_ENVIRONMENT)
119+
strategy:
120+
runOnce:
121+
deploy:
122+
steps:
123+
- task: DownloadSecureFile@1
124+
displayName: Download SSH Key
125+
name: sshkey
126+
inputs:
127+
secureFile: 'aks-terraform-devops-ssh-key-ububtu.pub'
128+
- task: TerraformCLI@0
129+
displayName: Terraform Init
130+
inputs:
131+
command: 'init'
132+
workingDirectory: '$(Pipeline.Workspace)/terraform-manifests-out'
133+
backendType: 'azurerm'
134+
backendServiceArm: 'terraform-aks-azurerm-svc-con'
135+
backendAzureRmResourceGroupName: 'terraform-storage-rg'
136+
backendAzureRmStorageAccountName: 'terraformstatexlrwdrzs'
137+
backendAzureRmContainerName: 'tfstatefiles'
138+
backendAzureRmKey: 'aks-$(QA_ENVIRONMENT).tfstate'
139+
allowTelemetryCollection: false
140+
- task: TerraformCLI@0
141+
displayName: Terraform Plan
142+
inputs:
143+
command: 'plan'
144+
workingDirectory: '$(Pipeline.Workspace)/terraform-manifests-out'
145+
environmentServiceName: 'terraform-aks-azurerm-svc-con'
146+
commandOptions: '-var ssh_public_key=$(sshkey.secureFilePath) -var environment=$(QA_ENVIRONMENT) -out $(Pipeline.Workspace)/terraform-manifests-out/$(QA_ENVIRONMENT)-$(Build.BuildId).out'
147+
allowTelemetryCollection: false
148+
- task: TerraformCLI@0
149+
displayName: Terraform Apply
150+
inputs:
151+
command: 'apply'
152+
workingDirectory: '$(Pipeline.Workspace)/terraform-manifests-out'
153+
environmentServiceName: 'terraform-aks-azurerm-svc-con'
154+
commandOptions: '$(Pipeline.Workspace)/terraform-manifests-out/$(QA_ENVIRONMENT)-$(Build.BuildId).out'
155+
allowTelemetryCollection: false

0 commit comments

Comments
 (0)