SlideShare a Scribd company logo
1 of 50
hugs@hashicorp.com | learn.hashicorp.com | discuss.hashicorp.com
Tal Hibner
o Proud owner of this gentleman
o Geek
o Maccabi Tel Aviv Basketball fan
o Master Scuba Diver
o Developer in the past, Devops Engineer in the present
o AWS Community Builder - Dev Tools
o AWS re/Start program mentor - Appleseeds
● Infrastructure is described using a high-level configuration
syntax.(HCL)
● This allows a blueprint of your infrastructure to be versioned, shared,
re-used, and treated as you would any other code.
● For example, This code declares that we want an AWS EC2 instance.
Infrastructure as code
Terraform helps you being both cloud-agnostic and enabling
multiple providers and services to be combined and composed.
Terraform is a universal tool to manage anything that has an API:
https://registry.terraform.io/browse/providers
It enables Terraform to
represent and manage the
entire infrastructure with its
supporting services, instead
of only the subset that exists
within a single provider.
Terraform has a
"planning" step where it
generates an execution
plan showing what
Terraform will do to
reach the desired state.
Once the execution plan
looks good, It executes it
to build the described
infrastructure.
Plan
Apply
● What’s the best way to collaborate on Terraform in a team setting?
● When writing Terraform, there are a number of workflows you can follow.
The simplest workflow is just using master:
● In this workflow, you work on master and run terraform locally.
First Problem - Effective Collaboration
● The problem with this workflow is that there is no collaboration or code
review.
● So we start to use pull request. We still run terraform plan locally, but once
we’re satisfied with the changes we create a pull request for review.
● When the pull request is approved, we run apply locally.
First Problem - Effective Collaboration
The first problem is that it’s hard to review just the diff on the pull request.
To properly review a change, you really need to see the output from
terraform plan. What looks like a small change can have a big plan
This workflow is an improvement,
but there are still problems.
● The second problem is that now it’s easy for master to get out of sync with
what’s actually been applied.
● This can happen if you merge a pull request without running apply or if the
apply has an error halfway through, you forget to fix it and then you merge to
master. Now what’s in master isn’t actually what’s running on production.
● At best, this causes confusion the next time someone runs terraform plan.
● At worst, it causes an outage when someone assumes that what’s in master
is actually running, and depends on it.
● Terraform usually starts out being used by the Ops team.
● As a result of using Terraform, the Ops team becomes much faster at making
infrastructure changes.
● But the way developers request those changes remains the same.
Second Problem - Developers Writing Terraform
Second Problem - Developers Writing Terraform
● Soon however, the Ops team starts to realize that it’s possible for developers
to make some of these small changes, Devs understand code (surprise!)
● Devs can see exactly what is required to make the change. This means
there’s less back and forth over a ticket.
● Developers don’t have the credentials to actually run Terraform commands.
● If you give them credentials, it’s hard to review what is actually being applied.
● It’s often difficult to do seemingly simple things (think adding a security group rule
that also requires peering VPCs). This means that just having access sometimes
isn’t enough. Devs might need help from an expert to get things done.
Third Problem - Developers are locked out!
● Atlantis is an open source tool for Terraform collaboration that’s
been originally created at Hootsuite by Anubhav Mishrar and
maintained by Luke Kysow.
● Atlantis is an application for automating Terraform via pull
requests.
● It is deployed as a standalone application into your infrastructure.
● No third-party has access to your credentials. Access is controlled
through pull request approvals.
What Is Atlantis?
Atlantis listens for GitHub, GitLab or Bitbucket webhooks about Terraform
pull requests.
How does it work?
Step 0 — Generating an Access
Token
● First, Create a new GitHub User named @atlantis so all the comments
that Atlantis writes will come from that user.
A developer creates a pull request with their change
to add a security group rule.
Step 1 — Create a Pull Request
Atlantis automatically runs terraform plan and comments back
on the pull request with the output. Now developers can fix
their Terraform errors before asking for a review.
Step 2 — Create a Pull Request
The developer pushes a
new commit that fixes
their error and Atlantis
comments back with the
valid terraform plan
output. Now the
developer can verify that
the plan output looks
good.
Step 3 — Fix The Terraform
Here the developer tried to apply without getting the pull
request approved, and failed.
Step 4 — Get Approval
Here two changes are
being made to the same
repo.
If I run atlantis plan here,
Atlantis is going to tell me
that someone else is
already working on this
repo.
Step 4 — Get Approval
You can go to Atlantis UI and see your Locks for troubleshooting.
Step 4 — Get Approval
You can go to Atlantis UI and Discard Terraform Plan and Unlock!
Step 4 — Get Approval
An Ops can now come along and review the changes and the output of
terraform plan. It’s easy for the operator to review the changes because
they can see the output of terraform plan.
Step 4 — Get Approval
Conftest Policy Checking
Conftest Policy Checking
To apply the changes, the developer or operator comments
“atlantis apply”.
Step 5 — Apply
Atlantis Binaries
Atlantis with Terragrunt
If you don't want to create/manage
the repo's atlantis.yaml file
yourself, you can use the tool
terragrunt-atlantis-config to
generate it.
Atlantis Deployment
There is an official Atlantis Docker image
Terraform Module for running Atlantis on
AWS Fargate by Anton Babenko
Terraform Module for running Atlantis on
AWS Fargate by Anton Babenko
At Lyft, they manage their own Kubernetes stack
which they leveraged to run Atlantis as well.
Alternatives
https://learn.hashicorp.
com/tutorials/terraform/
automate-
terraform#pre-installed-
plugins
Thank You
hugs@hashicorp.com | learn.hashicorp.com | discuss.hashicorp.com

More Related Content

What's hot

(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWSAmazon Web Services
 
AWS Black Belt Techシリーズ AWS Direct Connect
AWS Black Belt Techシリーズ AWS Direct ConnectAWS Black Belt Techシリーズ AWS Direct Connect
AWS Black Belt Techシリーズ AWS Direct ConnectAmazon Web Services Japan
 
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...Amazon Web Services Japan
 
VMware Tanzu Introduction- June 11, 2020
VMware Tanzu Introduction- June 11, 2020VMware Tanzu Introduction- June 11, 2020
VMware Tanzu Introduction- June 11, 2020VMware Tanzu
 
Unlocking the Cloud Operating Model: People, Process, Tools
Unlocking the Cloud Operating Model: People, Process, ToolsUnlocking the Cloud Operating Model: People, Process, Tools
Unlocking the Cloud Operating Model: People, Process, ToolsMitchell Pronschinske
 
Terraform introduction
Terraform introductionTerraform introduction
Terraform introductionJason Vance
 
【12/5 最新版】AWS Black Belt Online Seminar AWS re:Invent 2018 アップデート情報
【12/5 最新版】AWS Black Belt Online Seminar AWS re:Invent 2018 アップデート情報【12/5 最新版】AWS Black Belt Online Seminar AWS re:Invent 2018 アップデート情報
【12/5 最新版】AWS Black Belt Online Seminar AWS re:Invent 2018 アップデート情報Amazon Web Services Japan
 
Kubernetes Summit 2021: Multi-Cluster - The Good, the Bad and the Ugly
Kubernetes Summit 2021: Multi-Cluster - The Good, the Bad and the UglyKubernetes Summit 2021: Multi-Cluster - The Good, the Bad and the Ugly
Kubernetes Summit 2021: Multi-Cluster - The Good, the Bad and the Uglysmalltown
 
Jenkinsとamazon ecsで コンテナCI
Jenkinsとamazon ecsで コンテナCIJenkinsとamazon ecsで コンテナCI
Jenkinsとamazon ecsで コンテナCIshigeyuki azuchi
 
Cloud for Kubernetes : Session4
Cloud for Kubernetes : Session4Cloud for Kubernetes : Session4
Cloud for Kubernetes : Session4WhaTap Labs
 
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Amazon Web Services
 
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPNAmazon Web Services Japan
 

What's hot (20)

CI/CD on AWS
CI/CD on AWSCI/CD on AWS
CI/CD on AWS
 
AWS Cloud Adoption Framework
AWS Cloud Adoption Framework AWS Cloud Adoption Framework
AWS Cloud Adoption Framework
 
AWS Black Belt Online Seminar AWS Amplify
AWS Black Belt Online Seminar AWS AmplifyAWS Black Belt Online Seminar AWS Amplify
AWS Black Belt Online Seminar AWS Amplify
 
AWS Black Belt Techシリーズ Amazon EMR
AWS Black Belt Techシリーズ  Amazon EMRAWS Black Belt Techシリーズ  Amazon EMR
AWS Black Belt Techシリーズ Amazon EMR
 
(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS
 
AWS Black Belt Techシリーズ AWS Direct Connect
AWS Black Belt Techシリーズ AWS Direct ConnectAWS Black Belt Techシリーズ AWS Direct Connect
AWS Black Belt Techシリーズ AWS Direct Connect
 
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
 
VMware Tanzu Introduction- June 11, 2020
VMware Tanzu Introduction- June 11, 2020VMware Tanzu Introduction- June 11, 2020
VMware Tanzu Introduction- June 11, 2020
 
Amazon CloudFront
Amazon CloudFrontAmazon CloudFront
Amazon CloudFront
 
Terraform
TerraformTerraform
Terraform
 
Unlocking the Cloud Operating Model: People, Process, Tools
Unlocking the Cloud Operating Model: People, Process, ToolsUnlocking the Cloud Operating Model: People, Process, Tools
Unlocking the Cloud Operating Model: People, Process, Tools
 
Terraform introduction
Terraform introductionTerraform introduction
Terraform introduction
 
【12/5 最新版】AWS Black Belt Online Seminar AWS re:Invent 2018 アップデート情報
【12/5 最新版】AWS Black Belt Online Seminar AWS re:Invent 2018 アップデート情報【12/5 最新版】AWS Black Belt Online Seminar AWS re:Invent 2018 アップデート情報
【12/5 最新版】AWS Black Belt Online Seminar AWS re:Invent 2018 アップデート情報
 
Kubernetes Summit 2021: Multi-Cluster - The Good, the Bad and the Ugly
Kubernetes Summit 2021: Multi-Cluster - The Good, the Bad and the UglyKubernetes Summit 2021: Multi-Cluster - The Good, the Bad and the Ugly
Kubernetes Summit 2021: Multi-Cluster - The Good, the Bad and the Ugly
 
Jenkinsとamazon ecsで コンテナCI
Jenkinsとamazon ecsで コンテナCIJenkinsとamazon ecsで コンテナCI
Jenkinsとamazon ecsで コンテナCI
 
(ARC307) Infrastructure as Code
(ARC307) Infrastructure as Code(ARC307) Infrastructure as Code
(ARC307) Infrastructure as Code
 
Microsoft Workloads on AWS
Microsoft Workloads on AWSMicrosoft Workloads on AWS
Microsoft Workloads on AWS
 
Cloud for Kubernetes : Session4
Cloud for Kubernetes : Session4Cloud for Kubernetes : Session4
Cloud for Kubernetes : Session4
 
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
 
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
 

Similar to Hashiconf Israel 2022 - Terraform Pull Request Automation.pptx

Collaborative Terraform with Atlantis
Collaborative Terraform with AtlantisCollaborative Terraform with Atlantis
Collaborative Terraform with AtlantisFerenc Kovács
 
High Availability SOA APP with GlusterFS
High Availability SOA APP with GlusterFSHigh Availability SOA APP with GlusterFS
High Availability SOA APP with GlusterFSzeridon
 
System design for Web Application
System design for Web ApplicationSystem design for Web Application
System design for Web ApplicationMichael Choi
 
Tackling Terraform at Ticketmaster
Tackling Terraform at TicketmasterTackling Terraform at Ticketmaster
Tackling Terraform at TicketmasterFastly
 
A case study why Zoominfo uses Terraform Cloud in high-scale environment.
A case study why Zoominfo uses Terraform Cloud in high-scale environment. A case study why Zoominfo uses Terraform Cloud in high-scale environment.
A case study why Zoominfo uses Terraform Cloud in high-scale environment. Tal Hibner
 
Meetup 2020 - Back to the Basics part 101 : IaC
Meetup 2020 - Back to the Basics part 101 : IaCMeetup 2020 - Back to the Basics part 101 : IaC
Meetup 2020 - Back to the Basics part 101 : IaCDamienCarpy
 
CNCF_ A step to step guide to platforming your delivery setup.pdf
CNCF_ A step to step guide to platforming your delivery setup.pdfCNCF_ A step to step guide to platforming your delivery setup.pdf
CNCF_ A step to step guide to platforming your delivery setup.pdfLibbySchulze
 
Cloud Academy Webinar: Recipe for DevOps Success: Capital One Style
Cloud Academy Webinar: Recipe for DevOps Success: Capital One StyleCloud Academy Webinar: Recipe for DevOps Success: Capital One Style
Cloud Academy Webinar: Recipe for DevOps Success: Capital One StyleMark Andersen
 
Start Up Austin 2017: Manual vs Automation - When to Start Automating your Pr...
Start Up Austin 2017: Manual vs Automation - When to Start Automating your Pr...Start Up Austin 2017: Manual vs Automation - When to Start Automating your Pr...
Start Up Austin 2017: Manual vs Automation - When to Start Automating your Pr...Amazon Web Services
 
Devops interview questions 2 www.bigclasses.com
Devops interview questions  2  www.bigclasses.comDevops interview questions  2  www.bigclasses.com
Devops interview questions 2 www.bigclasses.combigclasses.com
 
Self-service PR-based Terraform
Self-service PR-based TerraformSelf-service PR-based Terraform
Self-service PR-based TerraformAndrew Kirkpatrick
 
Planning for a (Mostly) Hassle-Free Cloud Migration | VTUG 2016 Winter Warmer
Planning for a (Mostly) Hassle-Free Cloud Migration | VTUG 2016 Winter WarmerPlanning for a (Mostly) Hassle-Free Cloud Migration | VTUG 2016 Winter Warmer
Planning for a (Mostly) Hassle-Free Cloud Migration | VTUG 2016 Winter WarmerJoe Conlin
 
Agile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_pptAgile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_pptHitesh Kumar
 
Advanced dev ops governance with terraform
Advanced dev ops governance with terraformAdvanced dev ops governance with terraform
Advanced dev ops governance with terraformJames Counts
 
Scaling DevOps from Ground Zero to Enterprise
Scaling DevOps from Ground Zero to EnterpriseScaling DevOps from Ground Zero to Enterprise
Scaling DevOps from Ground Zero to Enterprisematthewabq
 
Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021NeerajKumar1965
 
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Brian Brazil
 
DevOps - Continuous Integration, Continuous Delivery - let's talk
DevOps - Continuous Integration, Continuous Delivery - let's talkDevOps - Continuous Integration, Continuous Delivery - let's talk
DevOps - Continuous Integration, Continuous Delivery - let's talkD Z
 
Production Experience: Some Insights from Using Vercel and Next.js for Over 3...
Production Experience: Some Insights from Using Vercel and Next.js for Over 3...Production Experience: Some Insights from Using Vercel and Next.js for Over 3...
Production Experience: Some Insights from Using Vercel and Next.js for Over 3...KosukeMatano1
 

Similar to Hashiconf Israel 2022 - Terraform Pull Request Automation.pptx (20)

Collaborative Terraform with Atlantis
Collaborative Terraform with AtlantisCollaborative Terraform with Atlantis
Collaborative Terraform with Atlantis
 
High Availability SOA APP with GlusterFS
High Availability SOA APP with GlusterFSHigh Availability SOA APP with GlusterFS
High Availability SOA APP with GlusterFS
 
System design for Web Application
System design for Web ApplicationSystem design for Web Application
System design for Web Application
 
Tackling Terraform at Ticketmaster
Tackling Terraform at TicketmasterTackling Terraform at Ticketmaster
Tackling Terraform at Ticketmaster
 
A case study why Zoominfo uses Terraform Cloud in high-scale environment.
A case study why Zoominfo uses Terraform Cloud in high-scale environment. A case study why Zoominfo uses Terraform Cloud in high-scale environment.
A case study why Zoominfo uses Terraform Cloud in high-scale environment.
 
Meetup 2020 - Back to the Basics part 101 : IaC
Meetup 2020 - Back to the Basics part 101 : IaCMeetup 2020 - Back to the Basics part 101 : IaC
Meetup 2020 - Back to the Basics part 101 : IaC
 
CNCF_ A step to step guide to platforming your delivery setup.pdf
CNCF_ A step to step guide to platforming your delivery setup.pdfCNCF_ A step to step guide to platforming your delivery setup.pdf
CNCF_ A step to step guide to platforming your delivery setup.pdf
 
Cloud Academy Webinar: Recipe for DevOps Success: Capital One Style
Cloud Academy Webinar: Recipe for DevOps Success: Capital One StyleCloud Academy Webinar: Recipe for DevOps Success: Capital One Style
Cloud Academy Webinar: Recipe for DevOps Success: Capital One Style
 
Start Up Austin 2017: Manual vs Automation - When to Start Automating your Pr...
Start Up Austin 2017: Manual vs Automation - When to Start Automating your Pr...Start Up Austin 2017: Manual vs Automation - When to Start Automating your Pr...
Start Up Austin 2017: Manual vs Automation - When to Start Automating your Pr...
 
Devops interview questions 2 www.bigclasses.com
Devops interview questions  2  www.bigclasses.comDevops interview questions  2  www.bigclasses.com
Devops interview questions 2 www.bigclasses.com
 
Self-service PR-based Terraform
Self-service PR-based TerraformSelf-service PR-based Terraform
Self-service PR-based Terraform
 
Planning for a (Mostly) Hassle-Free Cloud Migration | VTUG 2016 Winter Warmer
Planning for a (Mostly) Hassle-Free Cloud Migration | VTUG 2016 Winter WarmerPlanning for a (Mostly) Hassle-Free Cloud Migration | VTUG 2016 Winter Warmer
Planning for a (Mostly) Hassle-Free Cloud Migration | VTUG 2016 Winter Warmer
 
Agile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_pptAgile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_ppt
 
Advanced dev ops governance with terraform
Advanced dev ops governance with terraformAdvanced dev ops governance with terraform
Advanced dev ops governance with terraform
 
Scaling DevOps from Ground Zero to Enterprise
Scaling DevOps from Ground Zero to EnterpriseScaling DevOps from Ground Zero to Enterprise
Scaling DevOps from Ground Zero to Enterprise
 
Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021
 
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
 
DevOps - Continuous Integration, Continuous Delivery - let's talk
DevOps - Continuous Integration, Continuous Delivery - let's talkDevOps - Continuous Integration, Continuous Delivery - let's talk
DevOps - Continuous Integration, Continuous Delivery - let's talk
 
Why Learn Terraform?
Why Learn Terraform?Why Learn Terraform?
Why Learn Terraform?
 
Production Experience: Some Insights from Using Vercel and Next.js for Over 3...
Production Experience: Some Insights from Using Vercel and Next.js for Over 3...Production Experience: Some Insights from Using Vercel and Next.js for Over 3...
Production Experience: Some Insights from Using Vercel and Next.js for Over 3...
 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 

Recently uploaded (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 

Hashiconf Israel 2022 - Terraform Pull Request Automation.pptx

  • 2.
  • 3. Tal Hibner o Proud owner of this gentleman o Geek o Maccabi Tel Aviv Basketball fan o Master Scuba Diver o Developer in the past, Devops Engineer in the present o AWS Community Builder - Dev Tools o AWS re/Start program mentor - Appleseeds
  • 4.
  • 5. ● Infrastructure is described using a high-level configuration syntax.(HCL) ● This allows a blueprint of your infrastructure to be versioned, shared, re-used, and treated as you would any other code. ● For example, This code declares that we want an AWS EC2 instance. Infrastructure as code
  • 6.
  • 7. Terraform helps you being both cloud-agnostic and enabling multiple providers and services to be combined and composed.
  • 8. Terraform is a universal tool to manage anything that has an API: https://registry.terraform.io/browse/providers
  • 9. It enables Terraform to represent and manage the entire infrastructure with its supporting services, instead of only the subset that exists within a single provider.
  • 10. Terraform has a "planning" step where it generates an execution plan showing what Terraform will do to reach the desired state. Once the execution plan looks good, It executes it to build the described infrastructure. Plan Apply
  • 11.
  • 12. ● What’s the best way to collaborate on Terraform in a team setting? ● When writing Terraform, there are a number of workflows you can follow. The simplest workflow is just using master: ● In this workflow, you work on master and run terraform locally. First Problem - Effective Collaboration
  • 13. ● The problem with this workflow is that there is no collaboration or code review. ● So we start to use pull request. We still run terraform plan locally, but once we’re satisfied with the changes we create a pull request for review. ● When the pull request is approved, we run apply locally. First Problem - Effective Collaboration
  • 14. The first problem is that it’s hard to review just the diff on the pull request. To properly review a change, you really need to see the output from terraform plan. What looks like a small change can have a big plan This workflow is an improvement, but there are still problems.
  • 15. ● The second problem is that now it’s easy for master to get out of sync with what’s actually been applied. ● This can happen if you merge a pull request without running apply or if the apply has an error halfway through, you forget to fix it and then you merge to master. Now what’s in master isn’t actually what’s running on production. ● At best, this causes confusion the next time someone runs terraform plan. ● At worst, it causes an outage when someone assumes that what’s in master is actually running, and depends on it.
  • 16. ● Terraform usually starts out being used by the Ops team. ● As a result of using Terraform, the Ops team becomes much faster at making infrastructure changes. ● But the way developers request those changes remains the same. Second Problem - Developers Writing Terraform
  • 17. Second Problem - Developers Writing Terraform ● Soon however, the Ops team starts to realize that it’s possible for developers to make some of these small changes, Devs understand code (surprise!) ● Devs can see exactly what is required to make the change. This means there’s less back and forth over a ticket.
  • 18. ● Developers don’t have the credentials to actually run Terraform commands. ● If you give them credentials, it’s hard to review what is actually being applied. ● It’s often difficult to do seemingly simple things (think adding a security group rule that also requires peering VPCs). This means that just having access sometimes isn’t enough. Devs might need help from an expert to get things done. Third Problem - Developers are locked out!
  • 19.
  • 20. ● Atlantis is an open source tool for Terraform collaboration that’s been originally created at Hootsuite by Anubhav Mishrar and maintained by Luke Kysow. ● Atlantis is an application for automating Terraform via pull requests. ● It is deployed as a standalone application into your infrastructure. ● No third-party has access to your credentials. Access is controlled through pull request approvals. What Is Atlantis?
  • 21. Atlantis listens for GitHub, GitLab or Bitbucket webhooks about Terraform pull requests. How does it work?
  • 22. Step 0 — Generating an Access Token ● First, Create a new GitHub User named @atlantis so all the comments that Atlantis writes will come from that user.
  • 23. A developer creates a pull request with their change to add a security group rule. Step 1 — Create a Pull Request
  • 24. Atlantis automatically runs terraform plan and comments back on the pull request with the output. Now developers can fix their Terraform errors before asking for a review. Step 2 — Create a Pull Request
  • 25. The developer pushes a new commit that fixes their error and Atlantis comments back with the valid terraform plan output. Now the developer can verify that the plan output looks good. Step 3 — Fix The Terraform
  • 26. Here the developer tried to apply without getting the pull request approved, and failed. Step 4 — Get Approval
  • 27. Here two changes are being made to the same repo. If I run atlantis plan here, Atlantis is going to tell me that someone else is already working on this repo. Step 4 — Get Approval
  • 28. You can go to Atlantis UI and see your Locks for troubleshooting. Step 4 — Get Approval
  • 29. You can go to Atlantis UI and Discard Terraform Plan and Unlock! Step 4 — Get Approval
  • 30. An Ops can now come along and review the changes and the output of terraform plan. It’s easy for the operator to review the changes because they can see the output of terraform plan. Step 4 — Get Approval
  • 33. To apply the changes, the developer or operator comments “atlantis apply”. Step 5 — Apply
  • 35. Atlantis with Terragrunt If you don't want to create/manage the repo's atlantis.yaml file yourself, you can use the tool terragrunt-atlantis-config to generate it.
  • 37. There is an official Atlantis Docker image
  • 38. Terraform Module for running Atlantis on AWS Fargate by Anton Babenko
  • 39. Terraform Module for running Atlantis on AWS Fargate by Anton Babenko
  • 40. At Lyft, they manage their own Kubernetes stack which they leveraged to run Atlantis as well.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50. Thank You hugs@hashicorp.com | learn.hashicorp.com | discuss.hashicorp.com