Skip to content

Commit e009f7b

Browse files
committed
First Pipeline Commit - Validate terraform manifests
[skip ci]
1 parent e1f84a4 commit e009f7b

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
trigger:
2+
- main
3+
4+
pool:
5+
vmImage: 'ubuntu-latest'
6+
7+
# Stage-1: Terraform Validate Stage
8+
## Step-1: Publish Artifacts to Pipeline (Pipeline artifacts provide a way to share files between stages in a pipeline or between different pipelines. )
9+
## Step-2: Install Latest Terraform (0.13.5) (Ideally not needed if we use default Ubuntu Agents)
10+
## Step-3: Validate Terraform Manifests (terraform init, terraform validate)
11+
12+
stages:
13+
- stage: TerraformValidate
14+
jobs:
15+
- job: TerraformValidateJob
16+
continueOnError: false
17+
steps:
18+
- task: PublishPipelineArtifact@1
19+
displayName: Publish Artifacts
20+
inputs:
21+
targetPath: '$(System.DefaultWorkingDirectory)/terraform-manifests'
22+
artifact: 'terraform-manifests-out'
23+
publishLocation: 'pipeline'
24+
- task: TerraformInstaller@0
25+
displayName: Terraform Install
26+
inputs:
27+
terraformVersion: 'latest'
28+
- task: TerraformCLI@0
29+
displayName: Terraform Init
30+
inputs:
31+
command: 'init'
32+
workingDirectory: '$(System.DefaultWorkingDirectory)/terraform-manifests'
33+
backendType: 'azurerm'
34+
backendServiceArm: 'terraform-aks-azurerm-svc-con'
35+
backendAzureRmResourceGroupName: 'terraform-storage-rg'
36+
backendAzureRmStorageAccountName: 'terraformstatexlrwdrzs'
37+
backendAzureRmContainerName: 'tfstatefiles'
38+
backendAzureRmKey: 'aks-base.tfstate'
39+
allowTelemetryCollection: false
40+
- task: TerraformCLI@0
41+
displayName: Terraform Validate
42+
inputs:
43+
command: 'validate'
44+
workingDirectory: '$(System.DefaultWorkingDirectory)/terraform-manifests'
45+
allowTelemetryCollection: false

0 commit comments

Comments
 (0)