Infrastructure as Code in:��15 minutes
Agenda
Traditional infrastructure deployment
Limitations
What is Infrastructure as Code?
Benefits of IaC
Imperative vs Declarative
What to do.
What is wanted.
Imperative vs Declarative
What to do.
What is wanted.
IaC with Terraform
IaC with DevOps Pipelines
Sample Setup
Prerequisites
Configure Jenkins
Prerequisites
Create Jenkins pipeline
Parameterize the Jenkins pipeline
“Choose the action you would like to perform – Terraform Apply or Destroy?”
Add the pipeline code
pipeline {
agent any
� stages {
stage('Checkout') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/terenceluk/tf-iac-az-repo']]])
}
}
stage ("terraform init") {
steps {
sh ('terraform init')
}
}
stage ("terraform plan") {
steps {
sh ('terraform plan')
}
}
stage ("terraform Action") {
steps {
echo "Terraform action is --> ${action}"
sh ('terraform ${action} --auto-approve')
}
}
}
}
Build Pipeline
Questions and Comments?
Thank you for your time!