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
システム基盤としてのAWS活用 / System foundation by AWS
Search
cohalz
January 30, 2019
Programming
4
4.3k
システム基盤としてのAWS活用 / System foundation by AWS
Hatena Engineer Seminar #11
cohalz
January 30, 2019
Tweet
Share
More Decks by cohalz
See All by cohalz
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
2
2.6k
はてなのSRE組織2024 / Road to SRE NEXT@福岡
cohalz
2
1.6k
SREのキャリア、 あるいは生態 / #ya8
cohalz
11
1.6k
カンファレンスのボランティアスタッフって何やるの? / DAIMYO Meetup #4
cohalz
0
140
小さなものでも Step Functions / Serverless Meetup Fukuoka Re:boot
cohalz
0
180
ECSのCI/CD改善と標準化の取り組み / JAWS FESTA 2023 in Kyushu
cohalz
8
6.8k
ecspressoへの貢献を振り返る / JAWS-UG コンテナ支部 #24 ecspresso MeetUp
cohalz
1
6.4k
はてなフォトライフをECSに移行した話 / Hatena Engineer Seminar #20
cohalz
1
19k
SREの異動と働き方 〜はてなブログ編〜 / Hatena Engineer Seminar #13
cohalz
0
2.3k
Other Decks in Programming
See All in Programming
Оптимизируем производительность блока Казначейство
lamodatech
0
950
AppRouterを用いた大規模サービス開発におけるディレクトリ構成の変遷と問題点
eiganken
1
440
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
6
1.4k
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
知られざるDMMデータエンジニアの生態 〜かつてツチノコと呼ばれし者〜
takaha4k
1
140
HTML/CSS超絶浅い説明
yuki0329
0
190
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
940
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1.1k
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
130
Androidアプリの One Experience リリース
nein37
0
1.1k
Alba: Why, How and What's So Interesting
okuramasafumi
0
200
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
The Cost Of JavaScript in 2023
addyosmani
46
7.2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
570
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Being A Developer After 40
akosma
89
590k
The Power of CSS Pseudo Elements
geoffreycrofte
74
5.4k
Code Review Best Practice
trishagee
65
17k
Designing for humans not robots
tammielis
250
25k
Transcript
γεςϜج൫ͱͯ͠ͷ AWS׆༻ Hatena Engineer Seminar #11 id:cohalz
ࣗݾհ • id:cohalz / @cohalz • 2018৽ଔೖࣾ • γεςϜϓϥοτϑΥʔϜ෦ॴଐSRE
γεςϜج൫ͱ
γεςϜج൫ͱ • αʔϏε։ൃͷΛ্ͤ͞ΔΑ͏ͳɼ ଞͷSREΞϓϦέʔγϣϯΤϯδχΞ͏πʔϧ • αʔϏεͷʹεέʔϧ͢ΔΑ͏ͳͷ • σϓϩΠπʔϧӡ༻ΦϖϨʔγϣϯπʔϧͳͲछྨ༷ʑ
طଘͷγεςϜج൫ͷ՝ • खݩͰ࣮ߦ • ڥͷඋ͔Βඞཁ • ΦϖϨʔγϣϯ༻αʔόͰ࣮ߦ • ΦϖϨʔγϣϯαʔόͷอक͕ඞཁ •
ͦͦख࡞ۀͩͱ͍͏
γεςϜج൫ʹ͏AWSαʔϏε
AWS Lambda • AWSͷαʔόϨείϯϐϡʔςΟϯάڥ • ଞAWSαʔϏεͷ࿈ܞ
AWS LambdaͷϝϦοτ • AWSαʔϏεͱͷ࿈ܞ • APIܦ༝ͰෳαʔϏεͷΞΫγϣϯΛࣗಈԽ • ݖݶཧLambdaʹدͤΒΕΔ
αʔόϨεͷϝϦοτ αʔό͕ͳ͍͜ͱʹΑΔϝϦοτେ͖͍ • Մ༻ੑ • SLA99.95% • อकੑ • ΦϖϨʔγϣϯ༻αʔόɾόοναʔό͔Βͷղ์
AWS CloudFormation • YAMLϑΝΠϧͰهड़ͯ͠ɼAWSϦιʔεΛσϓϩΠͰ͖Δ • ݕূڥΛ͙͢࡞ΕΔ • มߋͷࣄલϨϏϡʔ • υΩϡϝϯτԽ
• ෆ۩߹࣌ͷΓ͠ • Infrastructure as Codeͷ࣮ફ
Lambda + CloudFormation ͷ։ൃεϐʔυΛ্͛ΔͨΊʹ
Serverless Application Model • ௨শSAM • AWSެࣜʹΑΔαʔόϨεڥϑϨʔϜϫʔΫ • CloudFormationͷ֦ு •
هड़ྔͷݮ • ։ൃʹศརͳCLIπʔϧ܈ • ϩʔΧϧ࣮ߦɾσϓϩΠ
AWSΛ׆༻͍ͯ͠Δج൫ͷྫ
ʮεέδϡʔϧ͞ΕͨΠϕϯτʯ ͷରԠ
Ϟνϕʔγϣϯ • EC2ͷΠϯελϯε࠶ىಈϦλΠΞ༧ࠂ͕དྷΔ • ࣄલʹରԠ͠ͳ͍ͱোʹͳΔ͜ͱ • Πϕϯτ͕͋ͬͨΒSlackʹ௨͢Δόον͕ಈ͍͍ͯͨ • Slack௨ΛݟͯissueʹखಈͰՃ͍ͯͨ͠ •
όοναʔόͷ໘ݟ͍ͯͨ
ొͷࣗಈԽ • ʮεέδϡʔϧ͞ΕͨΠϕϯτʯCloudWatch EventsͰΠ ϕϯτΛड͚औΔࣄ͕Ͱ͖Δ • LambdaΛ࣮ߦ͠ɼAPIܦ༝ͰGitHubͱGoogleΧϨϯμʔʹ ࣗಈͰՃ͢Δ
issue͕ࣗಈͰొ͞ΕΔ
خ͔ͬͨ͜͠ͱ • ຊདྷͷΠϕϯτରԠҎ֎ʹඞཁͳख࡞ۀͳ͘ͳͬͨ • ຊདྷΔ͖ରԠ͚ͩʹूதͰ͖ͨ • όοναʔόΛࢭΊΔ͜ͱ͕Ͱ͖ͨ
Let's Encryptূ໌ॻͷ ߋ৽ɾཧͷࣗಈԽ
Ϟνϕʔγϣϯ • ख࡞ۀͳ্ʹෳࡶ • ΦϖϨʔγϣϯαʔόͰ࣮ߦ • ূ໌ॻͷసૹͳͲؾΛ͚ͭͳ͍ͱ͍͚ͳ͍෦͋Δ • ఆظతʹൃੜ͢ΔׂΓࠐΈ •
ূ໌ॻͷ༗ޮظݶࡾϲ݄
ΞʔΩςΫνϟ 1. ར༻ऀऔಘ͍ͨ͠ূ໌ॻ༻ͷ CloudWatch EventsΛՃ 2. ఆظ࣮ߦ͞ΕɼLambda͕ূ໌ॻΛ औಘɾS3อଘ 3. S3όέοτ͔Βূ໌ॻΛऔಘͯ͠
Ϧϩʔυ
࣮ࡍͷಈ࡞ ϒϩά: http://developer.hatenastaff.com/entry/2018/12/11/133000
خ͔ͬͨ͜͠ͱ • ख࡞ۀ࠷ॳ͚ͩ • CloudWatch EventsʹΑΔఆظ࣮ߦ • ৴པੑ্ • Lambdaࣗମͷ৴པੑʹدͤΒΕΔ
• ূ໌ॻΛ҆શʹѻ͑ΔΑ͏ʹ • S3 + KMSʹΑΔՄ༻ੑͱػີੑ
OSSԽ • ࣾϦιʔεʹґଘͯ͠ͳ͍ͷͰOSSԽ • https://github.com/cohalz/CertUpdater
AWSͷγεςϜج൫Ͱେࣄͳ͜ͱ
ଞͷਓ͕ϝϯςͰ͖ΔΑ͏ʹ͢Δ • ࠓ·Ͱͷج൫ʹൺͯن͕େ͖͘ͳΓ͕ͪ • υΩϡϝϯτΛ͔ͬ͠Γ༻ҙ͢Δ • ͳΔ͘ެࣜͷπʔϧΛ͏ • Θ͔Βͳ͔ͬͨΒαϙʔτʹฉ͘
είʔϓɾڥք • ج൫͕Ͳ͜·ͰΔͷ͔͖ͬΓͤ͞Δ • ࿈ܞ͕͍͔͢͠Βܾͦ͜ΊΔ • ར༻ऀͷ͜ͱΛߟ͑Δ • Βͳ͍͍ͯ͘͜ͱΛҙࣝ
͜Ε͔ΒͷγεςϜج൫ • ΨΠυϥΠϯΛ࡞Δ • AWS୭Ͱ؆୯ʹѻ͑ͯ͠·͏ • ϚϧνΞΧϯτରԠ • ڞ௨ج൫ΛͲ͏ల։͍͔ͯ͘͠ʁ
·ͱΊ • ৴པੑͷͨΊʹLambdaΛج൫ͱͯ͠ར༻͍ͯ͠Δ • CloudFormationڞ௨ݴޠͱͯ͠ར༻ • SAMͷొʹΑΓɼαʔόϨεج൫ͷ։ൃ্ͨ͠ • AWS͔ͩΒͦ͜ߟ͑ͳ͍ͱ͍͚ͳ͍෦͋Δ