Skip to content

Instantly share code, notes, and snippets.

@rudolphjacksonm
Created June 8, 2020 20:00
Show Gist options
  • Save rudolphjacksonm/dbdd1535c09b6536d9822f080502e81a to your computer and use it in GitHub Desktop.
Save rudolphjacksonm/dbdd1535c09b6536d9822f080502e81a to your computer and use it in GitHub Desktop.
steps:
- task: Cache@2
displayName: 'Register TF cache'
inputs:
key: terraform | $(Agent.OS) | "$(Build.BuildNumber)" | $(Build.SourceVersion) | $(tfComponent) | "$(tfVarFileName)"
path: $(tfExecutionDir)
- task: TerraformInstaller@0
displayName: 'Install Terraform'
inputs:
terraformVersion: '$(terraformVersion)'
- task: TerraformTaskV1@0
displayName: 'Terraform Init'
inputs:
provider: 'azurerm'
command: 'init'
workingDirectory: '$(tfExecutionDir)'
backendServiceArm: '$(serviceConnectionName)'
backendAzureRmResourceGroupName: '$(backendAzureRmResourceGroupName)'
backendAzureRmStorageAccountName: '$(backendAzureRmStorageAccountName)'
backendAzureRmContainerName: '$(backendAzureRmContainerName)'
backendAzureRmKey: '$(backendAzureRmKey)'
- task: TerraformTaskV1@0
displayName: 'Terraform Plan'
inputs:
provider: 'azurerm'
command: 'plan'
commandOptions: '-var-file=../zone/sandboxuks1.tfvars -out=${BUILD_BUILDNUMBER}.tfplan'
workingDirectory: '$(tfExecutionDir)'
environmentServiceNameAzureRM: '$(serviceConnectionName)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment