Code Pipeline with approvals in AzureDevOps

If like me you assumed that the functionality is missing, you are mistaken. The functionality can be included, it just does not match its counterpart within the UI — By Craig Godden-Payne@beardy.digital

Image for post
Image for post
variables:
awsCredentials: 'aws-craig-godden-payne-credentials'
terraformVersion: '0.12.24'
stages:
- stage: InfrastructurePlan
jobs:
- deployment: Plan
displayName: Plan
environment: development
strategy:
runOnce:
deploy:
steps:
- checkout: self
displayName: Pull Git
persistCredentials: true
- task: TerraformInstaller@0
displayName: Install Terraform
inputs:
terraformVersion: '$(terraformVersion)'
- task: AWSShellScript@1
displayName: Terraform Plan
inputs:
awsCredentials: '$(awsCredentials)'
regionName: 'eu-west-2'
scriptType: 'inline'
inlineScript: |
terraform init
terraform plan
- stage: InfrastructureApply
jobs:
- deployment: Apply
displayName: Apply
environment: developmentWithApproval
strategy:
runOnce:
deploy:
steps:
- checkout: self
displayName: Pull Git
persistCredentials: true
- task: TerraformInstaller@0
displayName: Install Terraform
inputs:
terraformVersion: '$(terraformVersion)'
- task: AWSShellScript@1
displayName: Apply Terraform
inputs:
awsCredentials: '$(awsCredentials)'
regionName: 'eu-west-2'
scriptType: 'inline'
inlineScript: |
terraform init
terraform apply
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Written by

Technologist who enjoys writing and working with software and infra. I write up all the things I learn as I go along to share the knowledge! beardy.digital

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store