Skip to content

Instantly share code, notes, and snippets.

@Jagdeep1
Created December 17, 2020 18:43
Show Gist options
  • Save Jagdeep1/77145a2cbd5f83db4e6374d24e04992e to your computer and use it in GitHub Desktop.
Save Jagdeep1/77145a2cbd5f83db4e6374d24e04992e to your computer and use it in GitHub Desktop.
Azure DevOps pipeline to trigger terraform
trigger:
branches:
include:
- development
pool:
name: AWS_AGENT_POOL # Name of the agent pool that has AWS agent created in step 1
resources:
containers:
- container: terraform-runtime
image: foo.dkr.ecr.eu-west-1.amazonaws.com/terraform-runtime # Use the docker image with required dependencies
endpoint: ECR_Conn # Azure DevOps service connection to the ECR
stages:
- stage: Terraform
displayName: Terraform Create
jobs:
- job: Trigger Terraform
displayName: Trigger Terraform
container: terraform-runtime
steps:
- bash: terraform init
displayName: "Initialize Terraform"
- bash: terraform plan
displayName: "Planning Terraform"
- bash: terraform apply
displayName: "Apply terraform"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment