SlideShare une entreprise Scribd logo
1  sur  44
Terraform:
The Road to
Self-Service
Ryan Boyce
- Bankrate Platform
Engineer
- Ramenhead
GitHub: github.com/majoras-masque
LinkedIn: linkedin.com/in/boyceryan/
2
Overview
What’re we doing here again?
3
Overview
➝ Burning questions
➝ Terraform basics
➝ Where we were
➝ Where we are now
➝ How did WE get here?
➝ Terraform Enterprise basics
➝ Key takeaways
➝ Questions
4
Burning Questions
I know someone is waiting to ask...
5
Burning Questions
➝ Why are using Terraform if you’re an AWS shop?
⇾ Cloud Agnostic
⇾ QoL
⇾ Project Organization and Referencing
6
Burning Questions
➝ What KPI’s did you measure along the way?
⇾ None officially
→ Enabled by leadership buy-in and trust,
developer feedback
⇾ Unplanned Work (Jira)
➝ What KPI’s should I measure?
⇾ Provisioning Time
⇾ Unplanned Work
⇾ Developer Satisfaction
7
Terraform Basics
A map so you’re not lost tonight
8
Terraform Basics
➝ Workflow
⇾ Write, Init, Plan, Apply…
⇾ State file
➝ Modules
9
Terraform Basics
Heads up...
➝ HCL 2.0 released! (Terraform >= 0.12)
⇾ First-class expressions
→ “${var.foo}” becomes var.foo
⇾ For-loops for iterating lists/maps
⇾ Ternary conditionals for all data types
⇾ Rich types in modules (e.g. map with mixed
value types)
⇾ Dynamic child-block generation from
maps/list
⇾ etc...
10
Terraform Basics
Providers
11
➝ 110 official providers, many more community
providers
⇾ Examples: AWS, Rancher, PagerDuty,
DataDog, NewRelic, Fastly, GitHub,
SignalFx, etc.
➝ Provides a set of “resources” than can be
created/managed via Terraform
Terraform Basics
Example
12
Terraform Basics
State Files
13
➝ State File
⇾ Maps resources in code to resources in
cloud
⇾ JSON Format
⇾ Can be stored locally, or remotely
→ Store it remotely, not in VC...
- Great example:
- https://thorsten-hans.com/terraform-state-
demystified
Terraform Basics
State File
14
15
Terraform Basics
Remote State
16
➝ State file can be stored in S3, Artifactory,
Terraform Cloud, etc
⇾ Can even be in custom file server with an api
in front of it
➝ Can be referenced by other projects
⇾ A lot of power here!
Terraform Basics
Remote State Referencing
17
Terraform Basics - Modules
18
Where we were
Stuck in the middle with you
19
Where we were
20
➝ New Infrastructure
⇾ Ticket System
➝ Something Breaks
⇾ In the cloud? Over the wall!
➝ Why it wasn’t sustainable
⇾ Cloud Bottleneck
⇾ All time writing TF
⇾ Cloud wasn’t evolving
→ Content with existing modules, etc
⇾ Developers weren’t learning/growing
→ How their app ran in the cloud
→ How to design cloud-native
Where we were
Aside: Thinking Cloud-Native
21
➝ What does that even mean?
⇾ Asking the right questions:
→ 1.) Are we rebuilding something
someone else already wrote?
→ 2.) Are we using the best tools for the
job?
→ 3.) Are we writing code for our laptops
or for the cloud?
Where we are now
Unicorns and rainbows baby*
22*Okay not quite...
Where we are now
23
➝ New Infrastructure
⇾ Developers write, approve, apply without our
team knowing or helping
⇾ Infra code goes right with app code
➝ Something Breaks
⇾ Developers are involved, often first
responders
➝ Developer Requests Transformed
⇾ Reactive turned Proactive
How did WE get here?
Our journey to self-service, your experience may vary...
24
How’d WE get here?
25
➝ Timeline: Creating new infrastructure
➝ Key Steps
⇾ Developer Education
⇾ Terraform Modules
⇾ Terraform Enterprise
How’d WE get here?
Timeline: Creating new infrastructure
26
➝ Ticket with an app name
➝ Tickets had actual details like “ASG, scales on
CPU, Postgres DB with X,Y Needs, Fastly"
➝ Pairing on infrastructure tickets
➝ Devs write, PR’s in, we fix
➝ Devs write, PR’s in, we merge/apply (longest
phase)
⇾ Opened up QA, Prod still lagging...
➝ Devs write, pair on Terraform Enterprise (TFE)
applies
➝ Devs write, devs apply
How’d WE get here?
Terraform Modules -> Developer Education -> Terraform Enterprise
27
➝ Started monolithic: call once, creates everything
⇾ Not modular, hard to version
➝ Evolved to submodules strategy
➝ Essentials:
⇾ Plug and Play
⇾ Assumptions are defaults, not rails
⇾ Cowpath not railroad tracks
⇾ Purpose
→ Faster than rewriting
→ Enforcing some standards
How’d WE get here?
Terraform Modules -> Developer Education -> Terraform Enterprise
28
➝ Pairing + Lunch & Learns
➝ Documentation, coursework, examples
➝ Peers start teaching each other
⇾ (Unicorns start appearing during this phase)
How’d WE get here?
Terraform Modules -> Developer Education -> Terraform Enterprise
29
➝ Gifts from the Hashicorp Gods:
⇾ Remote-state locking
⇾ Pipelines
⇾ Audit Trails
⇾ Better scoped Access
→ AWS
→ TFE Itself
Terraform Enterprise
Basics
“Enterprise”? It must be better!
30
Terraform Enterprise Basics
Problems to solve as you expand
31
➝ Collab (state issues)
➝ Pipelines
➝ Enforcing code standards
➝ Audit trails
➝ Keeping code consistent between environments
Terraform Enterprise Basics
High Level Overview
32
➝ Workspaces
⇾ Workspace vars
⇾ State files
➝ Modules
⇾ Enter: Semantic Versioning
➝ Sentinel
⇾ Policy enforcement
➝ Workflow
⇾ VCS, CLI, API driven workflows
Terraform Enterprise Basics
Workspaces - Enabling CI/CD, Consistency, and Collab
33
Terraform Enterprise Basics
Modules - Fixing versioning, updates, and consistency
34
➝ Semantic Versioning
Terraform Enterprise Basics
Sentinel - Fixing consistency, upholding standards
35
➝ Policy-as-Code
⇾ Examples:
→ S3 Buckets must be private
→ No IAM Policies that allow IAM:*
→ Mandatory tags
→ Pre-approved modules
36
Terraform Enterprise Basics
Workflow - Fixing CI/CD, enabling experimentation
37
➝ VCS-Driven Workflow
➝ CLI-Driven Workflow
➝ API-Driven Workflow
Terraform Enterprise Basics
Workflow - VCS-Driven Workflow
38
➝ Webhook into GitHub/BitBucket
⇾ Points to folder/branch
⇾ Triggers when change happens on that
branch
➝ My 2-Cents: Terrible
⇾ Doesn’t support release-based dev
⇾ Encourages different code for QA/Prod
⇾ Hard to iterate/test
Terraform Enterprise Basics
Workflow - CLI-Driven Workflow
39
➝ Runs triggered from anywhere via CLI
⇾ Local laptop
⇾ CI/CD
→ https://circleci.com/orbs/registry/orb/ba
nkrate/terraform
➝ Great for automation/pipelines
➝ Great for experimentation, local development
➝ Encourages single copy of code for QA/Prod
Terraform Enterprise Basics
Workflow - API-Driven Workflow
40
➝ Just don’t...
Key Takeaways
But that guy at the meetup told me to...
41
Key Takeaways
Terraform Best Practices
42
➝ Build your own vs the cost of TFE
➝ Modules should be modular
➝ Cow Path not Rail Road
Key Takeaways
Cultural
43
➝ Just build a platform? No.
⇾ Where are you on your journey?
⇾ Work with devs, leaders to determine end
goal
➝ Organization size and needs determine your
course
⇾ Embedded engineers
⇾ Tooling Team
⇾ Treading Water
➝ Devs need to be engaged: this is a cultural shift
⇾ Trust your devs
➝ Leaders need to be educated
⇾ Book Club: Accelerate, DevOps Handbook,
etc
Questions?
Q & maybe A?
44

Contenu connexe

Tendances

Azure仮想マシンと仮想ネットワーク
Azure仮想マシンと仮想ネットワークAzure仮想マシンと仮想ネットワーク
Azure仮想マシンと仮想ネットワーク
Kuninobu SaSaki
 

Tendances (20)

NGINX Back to Basic 2 Part 2 (Japanese Webinar)
NGINX Back to Basic 2 Part 2 (Japanese Webinar)NGINX Back to Basic 2 Part 2 (Japanese Webinar)
NGINX Back to Basic 2 Part 2 (Japanese Webinar)
 
Practical PHP Deployment with Jenkins
Practical PHP Deployment with JenkinsPractical PHP Deployment with Jenkins
Practical PHP Deployment with Jenkins
 
コンテナ未経験新人が学ぶコンテナ技術入門
コンテナ未経験新人が学ぶコンテナ技術入門コンテナ未経験新人が学ぶコンテナ技術入門
コンテナ未経験新人が学ぶコンテナ技術入門
 
Grafana Dashboards as Code
Grafana Dashboards as CodeGrafana Dashboards as Code
Grafana Dashboards as Code
 
Azure仮想マシンと仮想ネットワーク
Azure仮想マシンと仮想ネットワークAzure仮想マシンと仮想ネットワーク
Azure仮想マシンと仮想ネットワーク
 
TripleOの光と闇
TripleOの光と闇TripleOの光と闇
TripleOの光と闇
 
Anthos Security: modernize your security posture for cloud native applications
Anthos Security: modernize your security posture for cloud native applicationsAnthos Security: modernize your security posture for cloud native applications
Anthos Security: modernize your security posture for cloud native applications
 
猿でもわかる Helm
猿でもわかる Helm猿でもわかる Helm
猿でもわかる Helm
 
GitOps is IaC done right
GitOps is IaC done rightGitOps is IaC done right
GitOps is IaC done right
 
明日からはじめるネットワーク運用自動化
明日からはじめるネットワーク運用自動化明日からはじめるネットワーク運用自動化
明日からはじめるネットワーク運用自動化
 
Openshift Container Platform
Openshift Container PlatformOpenshift Container Platform
Openshift Container Platform
 
GKE multi-cluster Ingress
GKE multi-cluster IngressGKE multi-cluster Ingress
GKE multi-cluster Ingress
 
Kubernetes or OpenShift - choosing your container platform for Dev and Ops
Kubernetes or OpenShift - choosing your container platform for Dev and OpsKubernetes or OpenShift - choosing your container platform for Dev and Ops
Kubernetes or OpenShift - choosing your container platform for Dev and Ops
 
Cgroupあれこれ-第4回コンテナ型仮想化の情報交換会資料
Cgroupあれこれ-第4回コンテナ型仮想化の情報交換会資料Cgroupあれこれ-第4回コンテナ型仮想化の情報交換会資料
Cgroupあれこれ-第4回コンテナ型仮想化の情報交換会資料
 
ログ+メトリック+トレースの組み合わせで構築する一元的なオブザーバビリティ
ログ+メトリック+トレースの組み合わせで構築する一元的なオブザーバビリティログ+メトリック+トレースの組み合わせで構築する一元的なオブザーバビリティ
ログ+メトリック+トレースの組み合わせで構築する一元的なオブザーバビリティ
 
Helm - Application deployment management for Kubernetes
Helm - Application deployment management for KubernetesHelm - Application deployment management for Kubernetes
Helm - Application deployment management for Kubernetes
 
root権限無しでKubernetesを動かす
root権限無しでKubernetesを動かす root権限無しでKubernetesを動かす
root権限無しでKubernetesを動かす
 
HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計
 
突破困境:資安開源工具之應用分享 [2019/03/21] @臺灣資安大會
突破困境:資安開源工具之應用分享 [2019/03/21] @臺灣資安大會突破困境:資安開源工具之應用分享 [2019/03/21] @臺灣資安大會
突破困境:資安開源工具之應用分享 [2019/03/21] @臺灣資安大會
 
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOpsMeetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOps
 

Similaire à Terraform - The Road to Self-Service

The elements of kubernetes
The elements of kubernetesThe elements of kubernetes
The elements of kubernetes
Aaron Schlesinger
 

Similaire à Terraform - The Road to Self-Service (20)

"The life beyond Terraform, or the rise of Platform Engineering", Stanislav ...
"The life beyond Terraform, or the rise of Platform Engineering",  Stanislav ..."The life beyond Terraform, or the rise of Platform Engineering",  Stanislav ...
"The life beyond Terraform, or the rise of Platform Engineering", Stanislav ...
 
DevOps Fest 2020. immutable infrastructure as code. True story.
DevOps Fest 2020. immutable infrastructure as code. True story.DevOps Fest 2020. immutable infrastructure as code. True story.
DevOps Fest 2020. immutable infrastructure as code. True story.
 
Dev Ops for systems of record - Talk at Agile Australia 2015
Dev Ops for systems of record - Talk at Agile Australia 2015Dev Ops for systems of record - Talk at Agile Australia 2015
Dev Ops for systems of record - Talk at Agile Australia 2015
 
DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...
DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...
DOES15 - Mirco Hering - Adopting DevOps Practices for Systems of Record – An ...
 
Mirco hering devops for systems of record final
Mirco hering devops for systems of record finalMirco hering devops for systems of record final
Mirco hering devops for systems of record final
 
DevOps: The New Face Of Application Development - Global Azure Bootcamp
DevOps: The New Face Of Application Development - Global Azure BootcampDevOps: The New Face Of Application Development - Global Azure Bootcamp
DevOps: The New Face Of Application Development - Global Azure Bootcamp
 
Idi2018 - Serverless does not mean Opsless
Idi2018 - Serverless does not mean OpslessIdi2018 - Serverless does not mean Opsless
Idi2018 - Serverless does not mean Opsless
 
How to get started with Site Reliability Engineering
How to get started with Site Reliability EngineeringHow to get started with Site Reliability Engineering
How to get started with Site Reliability Engineering
 
Enterprise Frameworks: Java & .NET
Enterprise Frameworks: Java & .NETEnterprise Frameworks: Java & .NET
Enterprise Frameworks: Java & .NET
 
Hacking for fun & profit - The Kubernetes Way - Demi Ben-Ari - Panorays
Hacking for fun & profit - The Kubernetes Way - Demi Ben-Ari - PanoraysHacking for fun & profit - The Kubernetes Way - Demi Ben-Ari - Panorays
Hacking for fun & profit - The Kubernetes Way - Demi Ben-Ari - Panorays
 
IT SIMPLY WORKS! … UNTIL IT BREAKS. STANDARDS, BEST PRACTICE AND ENTERPRISE P...
IT SIMPLY WORKS! … UNTIL IT BREAKS. STANDARDS, BEST PRACTICE AND ENTERPRISE P...IT SIMPLY WORKS! … UNTIL IT BREAKS. STANDARDS, BEST PRACTICE AND ENTERPRISE P...
IT SIMPLY WORKS! … UNTIL IT BREAKS. STANDARDS, BEST PRACTICE AND ENTERPRISE P...
 
Design is a process, not a Document
Design is a process, not a DocumentDesign is a process, not a Document
Design is a process, not a Document
 
Kubecon seattle 2018 workshop slides
Kubecon seattle 2018 workshop slidesKubecon seattle 2018 workshop slides
Kubecon seattle 2018 workshop slides
 
Productionalizing Models through CI/CD Design with MLflow
Productionalizing Models through CI/CD Design with MLflowProductionalizing Models through CI/CD Design with MLflow
Productionalizing Models through CI/CD Design with MLflow
 
DevOps: Infrastructure as Code
DevOps: Infrastructure as CodeDevOps: Infrastructure as Code
DevOps: Infrastructure as Code
 
From Mess To Masterpiece - JFokus 2017
From Mess To Masterpiece - JFokus 2017From Mess To Masterpiece - JFokus 2017
From Mess To Masterpiece - JFokus 2017
 
Deploying Python Machine Learning Models with Apache Spark with Brandon Hamri...
Deploying Python Machine Learning Models with Apache Spark with Brandon Hamri...Deploying Python Machine Learning Models with Apache Spark with Brandon Hamri...
Deploying Python Machine Learning Models with Apache Spark with Brandon Hamri...
 
The elements of kubernetes
The elements of kubernetesThe elements of kubernetes
The elements of kubernetes
 
From HDFS to S3: Migrate Pinterest Apache Spark Clusters
From HDFS to S3: Migrate Pinterest Apache Spark ClustersFrom HDFS to S3: Migrate Pinterest Apache Spark Clusters
From HDFS to S3: Migrate Pinterest Apache Spark Clusters
 
DevOps: Automate all the things
DevOps: Automate all the thingsDevOps: Automate all the things
DevOps: Automate all the things
 

Dernier

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Dernier (20)

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

Terraform - The Road to Self-Service

  • 2. Ryan Boyce - Bankrate Platform Engineer - Ramenhead GitHub: github.com/majoras-masque LinkedIn: linkedin.com/in/boyceryan/ 2
  • 4. Overview ➝ Burning questions ➝ Terraform basics ➝ Where we were ➝ Where we are now ➝ How did WE get here? ➝ Terraform Enterprise basics ➝ Key takeaways ➝ Questions 4
  • 5. Burning Questions I know someone is waiting to ask... 5
  • 6. Burning Questions ➝ Why are using Terraform if you’re an AWS shop? ⇾ Cloud Agnostic ⇾ QoL ⇾ Project Organization and Referencing 6
  • 7. Burning Questions ➝ What KPI’s did you measure along the way? ⇾ None officially → Enabled by leadership buy-in and trust, developer feedback ⇾ Unplanned Work (Jira) ➝ What KPI’s should I measure? ⇾ Provisioning Time ⇾ Unplanned Work ⇾ Developer Satisfaction 7
  • 8. Terraform Basics A map so you’re not lost tonight 8
  • 9. Terraform Basics ➝ Workflow ⇾ Write, Init, Plan, Apply… ⇾ State file ➝ Modules 9
  • 10. Terraform Basics Heads up... ➝ HCL 2.0 released! (Terraform >= 0.12) ⇾ First-class expressions → “${var.foo}” becomes var.foo ⇾ For-loops for iterating lists/maps ⇾ Ternary conditionals for all data types ⇾ Rich types in modules (e.g. map with mixed value types) ⇾ Dynamic child-block generation from maps/list ⇾ etc... 10
  • 11. Terraform Basics Providers 11 ➝ 110 official providers, many more community providers ⇾ Examples: AWS, Rancher, PagerDuty, DataDog, NewRelic, Fastly, GitHub, SignalFx, etc. ➝ Provides a set of “resources” than can be created/managed via Terraform
  • 13. Terraform Basics State Files 13 ➝ State File ⇾ Maps resources in code to resources in cloud ⇾ JSON Format ⇾ Can be stored locally, or remotely → Store it remotely, not in VC... - Great example: - https://thorsten-hans.com/terraform-state- demystified
  • 15. 15
  • 16. Terraform Basics Remote State 16 ➝ State file can be stored in S3, Artifactory, Terraform Cloud, etc ⇾ Can even be in custom file server with an api in front of it ➝ Can be referenced by other projects ⇾ A lot of power here!
  • 18. Terraform Basics - Modules 18
  • 19. Where we were Stuck in the middle with you 19
  • 20. Where we were 20 ➝ New Infrastructure ⇾ Ticket System ➝ Something Breaks ⇾ In the cloud? Over the wall! ➝ Why it wasn’t sustainable ⇾ Cloud Bottleneck ⇾ All time writing TF ⇾ Cloud wasn’t evolving → Content with existing modules, etc ⇾ Developers weren’t learning/growing → How their app ran in the cloud → How to design cloud-native
  • 21. Where we were Aside: Thinking Cloud-Native 21 ➝ What does that even mean? ⇾ Asking the right questions: → 1.) Are we rebuilding something someone else already wrote? → 2.) Are we using the best tools for the job? → 3.) Are we writing code for our laptops or for the cloud?
  • 22. Where we are now Unicorns and rainbows baby* 22*Okay not quite...
  • 23. Where we are now 23 ➝ New Infrastructure ⇾ Developers write, approve, apply without our team knowing or helping ⇾ Infra code goes right with app code ➝ Something Breaks ⇾ Developers are involved, often first responders ➝ Developer Requests Transformed ⇾ Reactive turned Proactive
  • 24. How did WE get here? Our journey to self-service, your experience may vary... 24
  • 25. How’d WE get here? 25 ➝ Timeline: Creating new infrastructure ➝ Key Steps ⇾ Developer Education ⇾ Terraform Modules ⇾ Terraform Enterprise
  • 26. How’d WE get here? Timeline: Creating new infrastructure 26 ➝ Ticket with an app name ➝ Tickets had actual details like “ASG, scales on CPU, Postgres DB with X,Y Needs, Fastly" ➝ Pairing on infrastructure tickets ➝ Devs write, PR’s in, we fix ➝ Devs write, PR’s in, we merge/apply (longest phase) ⇾ Opened up QA, Prod still lagging... ➝ Devs write, pair on Terraform Enterprise (TFE) applies ➝ Devs write, devs apply
  • 27. How’d WE get here? Terraform Modules -> Developer Education -> Terraform Enterprise 27 ➝ Started monolithic: call once, creates everything ⇾ Not modular, hard to version ➝ Evolved to submodules strategy ➝ Essentials: ⇾ Plug and Play ⇾ Assumptions are defaults, not rails ⇾ Cowpath not railroad tracks ⇾ Purpose → Faster than rewriting → Enforcing some standards
  • 28. How’d WE get here? Terraform Modules -> Developer Education -> Terraform Enterprise 28 ➝ Pairing + Lunch & Learns ➝ Documentation, coursework, examples ➝ Peers start teaching each other ⇾ (Unicorns start appearing during this phase)
  • 29. How’d WE get here? Terraform Modules -> Developer Education -> Terraform Enterprise 29 ➝ Gifts from the Hashicorp Gods: ⇾ Remote-state locking ⇾ Pipelines ⇾ Audit Trails ⇾ Better scoped Access → AWS → TFE Itself
  • 31. Terraform Enterprise Basics Problems to solve as you expand 31 ➝ Collab (state issues) ➝ Pipelines ➝ Enforcing code standards ➝ Audit trails ➝ Keeping code consistent between environments
  • 32. Terraform Enterprise Basics High Level Overview 32 ➝ Workspaces ⇾ Workspace vars ⇾ State files ➝ Modules ⇾ Enter: Semantic Versioning ➝ Sentinel ⇾ Policy enforcement ➝ Workflow ⇾ VCS, CLI, API driven workflows
  • 33. Terraform Enterprise Basics Workspaces - Enabling CI/CD, Consistency, and Collab 33
  • 34. Terraform Enterprise Basics Modules - Fixing versioning, updates, and consistency 34 ➝ Semantic Versioning
  • 35. Terraform Enterprise Basics Sentinel - Fixing consistency, upholding standards 35 ➝ Policy-as-Code ⇾ Examples: → S3 Buckets must be private → No IAM Policies that allow IAM:* → Mandatory tags → Pre-approved modules
  • 36. 36
  • 37. Terraform Enterprise Basics Workflow - Fixing CI/CD, enabling experimentation 37 ➝ VCS-Driven Workflow ➝ CLI-Driven Workflow ➝ API-Driven Workflow
  • 38. Terraform Enterprise Basics Workflow - VCS-Driven Workflow 38 ➝ Webhook into GitHub/BitBucket ⇾ Points to folder/branch ⇾ Triggers when change happens on that branch ➝ My 2-Cents: Terrible ⇾ Doesn’t support release-based dev ⇾ Encourages different code for QA/Prod ⇾ Hard to iterate/test
  • 39. Terraform Enterprise Basics Workflow - CLI-Driven Workflow 39 ➝ Runs triggered from anywhere via CLI ⇾ Local laptop ⇾ CI/CD → https://circleci.com/orbs/registry/orb/ba nkrate/terraform ➝ Great for automation/pipelines ➝ Great for experimentation, local development ➝ Encourages single copy of code for QA/Prod
  • 40. Terraform Enterprise Basics Workflow - API-Driven Workflow 40 ➝ Just don’t...
  • 41. Key Takeaways But that guy at the meetup told me to... 41
  • 42. Key Takeaways Terraform Best Practices 42 ➝ Build your own vs the cost of TFE ➝ Modules should be modular ➝ Cow Path not Rail Road
  • 43. Key Takeaways Cultural 43 ➝ Just build a platform? No. ⇾ Where are you on your journey? ⇾ Work with devs, leaders to determine end goal ➝ Organization size and needs determine your course ⇾ Embedded engineers ⇾ Tooling Team ⇾ Treading Water ➝ Devs need to be engaged: this is a cultural shift ⇾ Trust your devs ➝ Leaders need to be educated ⇾ Book Club: Accelerate, DevOps Handbook, etc

Notes de l'éditeur

  1. Notes