Skip to content

Instantly share code, notes, and snippets.

@rudolphjacksonm
Last active June 6, 2020 20:49
Show Gist options
  • Save rudolphjacksonm/1f1bc63ad0f9badbb57e62b184318ac4 to your computer and use it in GitHub Desktop.
Save rudolphjacksonm/1f1bc63ad0f9badbb57e62b184318ac4 to your computer and use it in GitHub Desktop.
azdevops-terraform-apply
---
- task: Cache@2
displayName: 'Get Cache for TF Artifact'
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 Apply'
inputs:
provider: 'azurerm'
command: 'apply'
commandOptions: '${BUILD_BUILDNUMBER}.tfplan' # pass plan file to terraform apply
workingDirectory: '$(tfExecutionDir)'
environmentServiceNameAzureRM: '$(serviceConnectionName)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment