Created
March 23, 2020 22:43
-
-
Save rudolphjacksonm/a0315cf41d17aea21f5999fe304fda97 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parameters: | |
- name: tfVarFileName | |
type: string | |
default: '' # foo.tfvars, for example | |
stages: | |
- stage: | |
displayName: 'Terraform Apply' | |
jobs: | |
- deployment: Deploy | |
displayName: 'Terraform Apply' | |
pool: | |
vmImage: 'ubuntu-latest' | |
environment: 'terraform' | |
strategy: | |
runOnce: | |
deploy: | |
steps: | |
- checkout: none | |
- task: Cache@2 | |
displayName: 'Get Cache for TF Artifact' | |
inputs: | |
key: terraform | $(Agent.OS) | $(Build.SourceVersion) | $(tfComponent) | |
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