Skip to content

Commit caf4cfd

Browse files
committed
Welcome to Stack Simplify
1 parent 1807cca commit caf4cfd

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

25-Azure-DevOps-Terraform-Azure-AKS/README.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,51 @@ Public File: aks-terraform-devops-ssh-key-ububtu.pub (To be uploaded to Azure De
210210
- **Step-2:** Install Latest Terraform (0.13.5) (Ideally not needed if we use default Agents)
211211
- **Step-3:** Validate Terraform Manifests
212212
```yaml
213-
213+
trigger:
214+
- main
215+
216+
pool:
217+
vmImage: 'ubuntu-latest'
218+
219+
# Stage-1: Terraform Validate Stage
220+
## Step-1: Publish Artifacts to Pipeline (Pipeline artifacts provide a way to share files between stages in a pipeline or between different pipelines. )
221+
## Step-2: Install Latest Terraform (0.13.5) (Ideally not needed if we use default Ubuntu Agents)
222+
## Step-3: Validate Terraform Manifests (terraform init, terraform validate)
223+
224+
stages:
225+
- stage: TerraformValidate
226+
jobs:
227+
- job: TerraformValidateJob
228+
continueOnError: false
229+
steps:
230+
- task: PublishPipelineArtifact@1
231+
displayName: Publish Artifacts
232+
inputs:
233+
targetPath: '$(System.DefaultWorkingDirectory)/terraform-manifests'
234+
artifact: 'terraform-manifests-out'
235+
publishLocation: 'pipeline'
236+
- task: TerraformInstaller@0
237+
displayName: Terraform Install
238+
inputs:
239+
terraformVersion: 'latest'
240+
- task: TerraformCLI@0
241+
displayName: Terraform Init
242+
inputs:
243+
command: 'init'
244+
workingDirectory: '$(System.DefaultWorkingDirectory)/terraform-manifests'
245+
backendType: 'azurerm'
246+
backendServiceArm: 'terraform-aks-azurerm-svc-con'
247+
backendAzureRmResourceGroupName: 'terraform-storage-rg'
248+
backendAzureRmStorageAccountName: 'terraformstatexlrwdrzs'
249+
backendAzureRmContainerName: 'tfstatefiles'
250+
backendAzureRmKey: 'aks-base.tfstate'
251+
allowTelemetryCollection: false
252+
- task: TerraformCLI@0
253+
displayName: Terraform Validate
254+
inputs:
255+
command: 'validate'
256+
workingDirectory: '$(System.DefaultWorkingDirectory)/terraform-manifests'
257+
allowTelemetryCollection: false
214258
```
215259
216260

0 commit comments

Comments
 (0)