Created
December 17, 2020 18:43
-
-
Save Jagdeep1/77145a2cbd5f83db4e6374d24e04992e to your computer and use it in GitHub Desktop.
Azure DevOps pipeline to trigger terraform
This file contains hidden or 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
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