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
ECSとSQSでスケーラブルなバッチを作った
Search
Takafumi Yoshida
August 17, 2019
Technology
2
1.2k
ECSとSQSでスケーラブルなバッチを作った
Takafumi Yoshida
August 17, 2019
Tweet
Share
More Decks by Takafumi Yoshida
See All by Takafumi Yoshida
DynamoDB Step Zero to One
zephiransas
0
620
ECSとALBで始めるblue/greenデプロイメント
zephiransas
2
310
DynamoDB関連のアップデート紹介 #reinvent2018
zephiransas
0
720
CloudGarageでGitBucketサーバをたててみた
zephiransas
0
500
プログラマが知っておくといいかもしれないCSSのハナシ
zephiransas
1
980
ラクして学ぶ英語(LT版)
zephiransas
0
190
あなたとCrystal、いますぐダウンロード
zephiransas
1
1.7k
使ってみようLombok
zephiransas
0
240
Modern Web Development with ninjaframework
zephiransas
0
3.1k
Other Decks in Technology
See All in Technology
kargoの魅力について伝える
magisystem0408
0
200
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
740
非機能品質を作り込むための実践アーキテクチャ
knih
3
1.1k
AWS re:Invent 2024 ふりかえり
kongmingstrap
0
130
Amazon SageMaker Unified Studio(Preview)、Lakehouse と Amazon S3 Tables
ishikawa_satoru
0
150
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
180
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
13
3.6k
TSKaigi 2024 の登壇から広がったコミュニティ活動について
tsukuha
0
160
Qiita埋め込み用スライド
naoki_0531
0
3.7k
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
280
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
130
PHPからGoへのマイグレーション for DMMアフィリエイト
yabakokobayashi
1
170
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
33
1.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Writing Fast Ruby
sferik
628
61k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Designing for humans not robots
tammielis
250
25k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Building Applications with DynamoDB
mza
91
6.1k
What's in a price? How to price your products and services
michaelherold
243
12k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
How STYLIGHT went responsive
nonsquared
95
5.2k
Adopting Sorbet at Scale
ufuk
73
9.1k
Transcript
&$4ͱ424Ͱ εέʔϥϒϧͳόονΛ࡞ͬͨ ٢ాوจ ![FQIJSBOTBT Ϋϥεϝιουגࣜձࣾ
εϥΠυޙͰೖख͢Δ͜ͱ͕ग़དྷ·͢ͷͰ ൃදதͷ༰ΛϝϞ͢Δඞཁ͋Γ·ͤΜɻ ࣸਅࡱӨΛ͢Δ߹ ϑϥογϡɾγϟολʔԻ͕ग़ͳ͍Α͏ʹྀ͍ͩ͘͝͞ Attention
#jawsug #jawsoka #soracomug
ࣗݾհ ٢ాوจ ![FQIJSBOTBT wΫϥεϝιουגࣜձࣾ w$9ࣄۀຊ෦αʔόαΠυΤϯδχΞ wԬࢁ+BWBϢʔβձදΦʔϓϯη ϛφʔԬࢁ࣮ߦҕһ
w͖ͳ"84ͷαʔϏε w&$4 %ZOBNP%#
ΞδΣϯμ wΞʔΩςΫνϟ֓ཁ w4XJUDI3PMFʹ͍ͭͯ w424Ͱͬͨ͜ͱ w&$4Ͱͬͨ͜ͱ wͬͯΈͨ
ΞʔΩςΫνϟ֓ཁ
Γ͍ͨ͜ͱ wσʔλͷҰׅߋ৽ wݩσʔλ$47 wσʔλྔेສ݅ఔ w*%ͱɺߋ৽༰͕ೖ͍ͬͯΔ wߋ৽ʹ֎෦ͷ"1*Λୟ͘
Switch RoleͰ ͬͨ͜ͱ
w424ͷσʔλૹ৴ॲཧͰ4XJUDI3PMF͍ͨ͠ w4XJUDI3PMF͢Δʹ.'"ඞਢ wBXTDMJͰ͋Ε్தͰτʔΫϯΛೖྗͰ͖Δ w4%,ͩͱࣗલͰΫϨσϯγϟϧΛऔಘͯ͠ Δඞཁ͕͋Δ
BXTDPOpH [default] region = ap-northeast-1 output = json
[profile hoge] region = ap-northeast-1 source_profile = default role_arn = arn:aws:iam::ACCOUNT_ID:role/john-doe mfa_serial = arn:aws:iam::ACCOUNT_ID:mfa/john-doe
BXTDMJͰ4XJUDI3PMF͢Δ߹ $ AWS_PROFILE=hoge aws s3 ls Enter MFA
code for arn:aws:iam::ACCOUNT_ID:mfa/john-doe [MFAτʔΫϯΛೖྗ͢Δ]
"3/ɺ.'"τʔΫϯɺTUTΫϥΠΞϯτ sts_client = Aws::STS::Client.new(region: 'ap-northeast-1') role_arn = `aws
configure get role_arn --profile hoge`.chomp serial_number = `aws configure get mfa_serial --profile hoge`.chomp puts "Input MFA token code..." token_code = gets.chomp
ΫϨσϯγϟϧੜ͠424ΫϥΠΞϯτΛ࡞ role_credentials = Aws::AssumeRoleCredentials.new( client: sts_client, role_arn: role_arn,
role_session_name: "hoge_session", serial_number: serial_number, token_code: token_code) Aws::SQS::Client.new(credentials: role_credentials)
wڥม"84@130'*-&ར༻͠ͳ͍ wBXTDPOpHVSFHFUͰඞཁͳ"3/Λऔಘ͢Δ w.'"τʔΫϯผ్ɺೖྗͤ͞Δ wTUTΫϥΠΞϯτΛ࡞͠ɺ "TTVNF3PMF$SFEFOUJBMTͰɺΫϨσϯγϟϧ Λऔಘ͢Δ
SQSͰͬͨ͜ͱ
wෳͷλεΫ͔ΒΞΫηε͞ΕΔͷͰɺ͜ΕΛ ͍͍ײ͡ʹॲཧͰ͖Δ wॲཧͰ͖ͳ͔ͬͨσʔλΛɺผΩϡʔʹҠͯ͠ ϦτϥΠ͘͢͢͠Δ w424ͷ%FBE-FUUFS2VFVFͷΈΛ͏
#PEZ 3FDFJWF$PVOU 7JTJCMF 536&
#PEZ 3FDFJWF$PVOU 7JTJCMF '"-4&
#PEZ 3FDFJWF$PVOU 7JTJCMF 536& VisibilityTimeoutΛա͗ͯDelete͞Εͳ͔ͬͨ߹
#PEZ 3FDFJWF$PVOU 7JTJCMF Receive Count͕࠷େReceive CountΛ͑ͨ߹ #PEZ 3FDFJWF$PVOU
7JTJCMF 536& DLQҠಈ
ECSͰͬͨ͜ͱ
w'BSHBUFͰϦιʔεཧͷखؒΛݮΒ͍ͨ͠ wฒྻͰ࣮ߦͰ͖ΔΑ͏ʹ͍ͨ͠ wঢ়گʹԠͯ͡ɺλεΫͷΛௐ͍ͨ͠ w$MJFOU4FDSFUͳͲΛ҆શʹѻ͍͍ͨ
ύϥϝʔλετΞʹઃఆΛ֨ೲ aws ssm put-parameter \ --name /ClientId \
--value CLIENT_ID_XXXX \ --type String
λεΫఆ͔ٛΒࢀর ContainerDefinitions: - Name: app ... Secrets: -
Name: CLIENT_ID ValueFrom: !Sub "arn:aws:ssm:ap-northeast-1:${AWS::AccountId}:parameter/ClientId" - Name: CLIENT_SECRET ValueFrom: !Sub "arn:aws:ssm:ap-northeast-1:${AWS::AccountId}:parameter/ClientSecret" λεΫͷڥมͰΛऔಘͰ͖Δ
ͬͯΈͨ
wରσʔλສ݅ w424ͷσʔλૹ৴ʹ࣌ؒ wʢͳΜ͔վળ͍ͨ͠ؾ͕͢Δ w&$4ͷόονॲཧ͕࣌ؒະຬͰऴྃ
w4%,Ͱ4XJUDI3PMF͢Δʹͻͱखؒඞཁ w424ΈΛཧղ͔ͯͭ͑͠ɺ͘͢͝ศ ར w&$4ͷฒྻλεΫΛͬͯɺεέʔϥϒϧʹ͠ Α͏
None