Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Patterns In Infrastructure as Code
Search
Takeshi Kondo
April 24, 2020
Technology
8
5.8k
Patterns In Infrastructure as Code
Infra Study Meetup#1
https://forkwell.connpass.com/event/171560/
Takeshi Kondo
April 24, 2020
Tweet
Share
More Decks by Takeshi Kondo
See All by Takeshi Kondo
SRE の考えをマネジメントに活かす / applying SRE ideas to management
chaspy
7
5.2k
RAGの簡易評価によるフィードバックサイクル実践 / Feedback cycle practice through simplified assessment of RAGs
chaspy
2
4.6k
定量データと定性評価を用いた技術戦略の組織的実践 / Systematic implementation of technology strategies using quantitative data and qualitative evaluation
chaspy
9
1.5k
エンジニアブランディングチームの KPI / KPI's of engineer branding team
chaspy
2
1.8k
「SLO Review」今やるならこうする / If I had to do the "SLO Review" again
chaspy
3
1.7k
開発者とともに作る Site Reliability Engineering / SREing with Developers
chaspy
10
7.7k
自己診断能力の獲得を目指して / Toward the acquisition of self-diagnostic skills
chaspy
1
4.5k
『スタディサプリ 中学講座』における E2E Test の運用と計測による改善 / Improved E2E testing through measurement
chaspy
0
4.2k
『スタディサプリ』における SLI/SLO の継続的改善 / Continuous improvement of SLI/SLO at StudySapuri
chaspy
1
3k
Other Decks in Technology
See All in Technology
[JAWS-UG新潟#20] re:Invent2024 -CloudOperationsアップデートについて-
shintaro_fukatsu
0
120
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
130
.NET 9 のパフォーマンス改善
nenonaninu
0
1.3k
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
280
Oracle Cloud Infrastructure:2024年12月度サービス・アップデート
oracle4engineer
PRO
1
250
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
120
React Routerで実現する型安全なSPAルーティング
sansantech
PRO
2
260
[トレノケ雲の会 mod.13] 3回目のre:Inventで気づいたこと -CloudOperationsを添えて-
shintaro_fukatsu
0
110
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.4k
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
670
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
500
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
280
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
427
64k
Making the Leap to Tech Lead
cromwellryan
133
9k
Typedesign – Prime Four
hannesfritz
40
2.4k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Fireside Chat
paigeccino
34
3.1k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Into the Great Unknown - MozCon
thekraken
33
1.5k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
RailsConf 2023
tenderlove
29
940
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Transcript
Patterns In Infrastructure as Code Takeshi Kondo / @chaspy Infra
Study Meetup #1
Passed
Agenda • Infrastructure as Code in Quipper • Patterns in
Infrastructure as Code 1. Environment Pattern 2. Scaffold Pattern 3. Backup Pattern
Agenda • Infrastructure as Code in Quipper • Patterns in
Infrastructure as Code 1. Environment Pattern 2. Scaffold Pattern 3. Backup Pattern • What • Why • Point • Example
Agenda • Infrastructure as Code in Quipper • Patterns in
Infrastructure as Code 1. Environment Pattern 2. Scaffold Pattern 3. Backup Pattern
Infrastructure as Code in Quipper (1) • Infrastructure / Cloud
(AWS) • Terraform • Codenize.tools (Miam, Roadworker) • Application Platform (Kubernetes) • Kube-aws • Server Provisioning • Ansible
Infrastructure as Code in Quipper (2) • SaaS Configuration •
Datadog • Dashboard • SLO • Monitor • Pingdom • Deadman’s snitch • CircleCI • Environment Variables
Infrastructure as Code in Quipper(2) • SaaS Configuration • Datadog
• Dashboard • SLO • Monitor • Pingdom • Deadman’s snitch • CircleCI • Environment Variables Terraform Codenize.tools (Barkdog) circleci-env (Internal tool)
Infrastructure as Code in Quipper(2) • SaaS Configuration • Datadog
• Dashboard • SLO • Monitor • Pingdom • Deadman’s snitch • CircleCI • Environment Variables Terraform Codenize.tools (Barkdog) circleci-env (Internal tool)
Infrastructure as Code in Quipper(2) • SaaS Configuration • Datadog
• Dashboard • SLO • Monitor • Pingdom • Deadman’s snitch • CircleCI • Environment Variables Terraform Codenize.tools (Barkdog) circleci-env (Internal tool)
Agenda • Infrastructure as Code in Quipper • Patterns in
Infrastructure as Code 1. Environment Pattern 2. Scaffold Pattern 3. Backup Pattern • What • Why • Point • Example
Environment Pattern
Environment Pattern Production Resource Staging Resource Staging Code Production Code
Infrastructure as Code - Chapter 9. Patterns for Defining Infrastructure Apply Apply Change Change
Environment Pattern: Why • To minimize blast radius • To
test before releasing to production
Environment Pattern: Point • Don’t Repeat Yourself • Minimize commonality
• Keep it simple stupid • Enforcing, not communize Infrastructure as Code - 9.2.7 Approaches to Sharing Definitions
Environment Pattern: Example services ᵓᴷᴷ hoge-service ᴹ ᵓᴷᴷ production ᴹ
ᴹ ᵓᴷᴷ aurora.tf ᴹ ᴹ ᵓᴷᴷ main.tf ᴹ ᴹ ᵓᴷᴷ provider.tf ᴹ ᴹ ᵓᴷᴷ terraform.tf ᴹ ᴹ ᵓᴷᴷ terraform.tfvars ᴹ ᴹ ᵓᴷᴷ variables.tf ᴹ ᴹ ᵋᴷᴷ versions.tf ᴹ ᵋᴷᴷ staging ᴹ ᵓᴷᴷ aurora.tf ᴹ ᵓᴷᴷ main.tf ᴹ ᵓᴷᴷ provider.tf ᴹ ᵓᴷᴷ terraform.tf ᴹ ᵓᴷᴷ terraform.tfvars ᴹ ᵓᴷᴷ variables.tf ᴹ ᵋᴷᴷ versions.tf ᵋᴷᴷ modules Terraform ansible ᵋᴷᴷ ubuntu1804 ᵓᴷᴷ reverse-proxy-production ᴹ ᵓᴷᴷ goss ᴹ ᵓᴷᴷ group_vars ᴹ ᴹ ᵓᴷᴷ all.yml ᴹ ᴹ ᵓᴷᴷ development.yml ᴹ ᴹ ᵋᴷᴷ staging.yml ᴹ ᵓᴷᴷ hosts-development ᴹ ᵓᴷᴷ hosts-test ᴹ ᵓᴷᴷ roles ᴹ ᴹ ᵋᴷᴷ nginx ᴹ ᴹ ᵓᴷᴷ files ᴹ ᴹ ᵓᴷᴷ tasks ᴹ ᴹ ᵋᴷᴷ templates ᴹ ᵋᴷᴷ site.yml ᵓᴷᴷ reverse-proxy-staging ᵓᴷᴷ common-roles ᵓᴷᴷ datadog ᵓᴷᴷ td-agent Ansible
Scaffold Pattern
Scaffold Pattern Template Input variable Code Generate
Scaffold Pattern: Why • To make self-service easier • Reduce
cognitive load Infrastructure as Code - 9.1.6 Self-Service Environments
Scaffold Pattern: Point • Write a document • Make each
program do one thing well https://en.wikipedia.org/wiki/Unix_philosophy
Scaffold Pattern: Example • Create new application with Kubernetes manifest
• Create new resource with Terraform HCL • Create AWS Aurora resource definition • Create Datadog SLO Definition
Create AWS Aurora resource definition
Backup Pattern
Backup Pattern Code Resource Import Change manually
Backup Pattern Code Resource Import Change manually Apply
Backup Pattern: Why • Easy to change from GUI (especially
SaaS Configuration) • For backup • For greppability • For bulk replacement
Backup Pattern: Point • Sync Interval • If long, it
may overwrite the actual configuration
Backup Pattern: Example • Datadog Dashboard • Datadog Monitor •
Jenkins Configuration (SCM Sync Plugin)
Datadog Dashboard
Let’s Read http://shop.oreilly.com/product/0636920294382.do
Special Thanks • @suzuki-shunsuke • To lead splitting Terraform state
• To improve CI/CD pipeline • SRE graduates • To introduce of Infrastructure as Code • To build workflow with maintainability
Happy (Infrastructure as) Coding
Thank You! chaspy chaspy_ Site Reliability Engineer at Quipper Takeshi
Kondo Terraform-jp