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
はてなのSRE組織2024 / Road to SRE NEXT@福岡
cohalz
2
1.5k
SREのキャリア、 あるいは生態 / #ya8
cohalz
11
1.5k
カンファレンスのボランティアスタッフって何やるの? / DAIMYO Meetup #4
cohalz
0
120
小さなものでも Step Functions / Serverless Meetup Fukuoka Re:boot
cohalz
0
160
ECSのCI/CD改善と標準化の取り組み / JAWS FESTA 2023 in Kyushu
cohalz
8
6.5k
ecspressoへの貢献を振り返る / JAWS-UG コンテナ支部 #24 ecspresso MeetUp
cohalz
1
6k
はてなフォトライフをECSに移行した話 / Hatena Engineer Seminar #20
cohalz
1
19k
SREの異動と働き方 〜はてなブログ編〜 / Hatena Engineer Seminar #13
cohalz
0
2.3k
Envoy.なんか / Kyoto.なんか #5
cohalz
1
180
Other Decks in Programming
See All in Programming
プロダクトの品質に コミットする / Commit to Product Quality
pekepek
2
770
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
270
たのしいparse.y
ydah
3
120
Jakarta EE meets AI
ivargrimstad
0
240
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
急成長期の品質とスピードを両立するフロントエンド技術基盤
soarteclab
0
930
CSC305 Lecture 25
javiergs
PRO
0
130
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
2
460
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
110
あれやってみてー駆動から成長を加速させる / areyattemite-driven
nashiusagi
1
200
From Translations to Multi Dimension Entities
alexanderschranz
2
130
Featured
See All Featured
How GitHub (no longer) Works
holman
311
140k
KATA
mclloyd
29
14k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Cult of Friendly URLs
andyhume
78
6.1k
Building an army of robots
kneath
302
44k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
440
Designing for Performance
lara
604
68k
The World Runs on Bad Software
bkeepers
PRO
65
11k
GraphQLとの向き合い方2022年版
quramy
44
13k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
A better future with KSS
kneath
238
17k
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͔ͩΒͦ͜ߟ͑ͳ͍ͱ͍͚ͳ͍෦͋Δ