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
710
CloudGarageでGitBucketサーバをたててみた
zephiransas
0
490
プログラマが知っておくといいかもしれないCSSのハナシ
zephiransas
1
970
ラクして学ぶ英語(LT版)
zephiransas
0
190
あなたとCrystal、いますぐダウンロード
zephiransas
1
1.7k
使ってみようLombok
zephiransas
0
240
Modern Web Development with ninjaframework
zephiransas
0
3k
Other Decks in Technology
See All in Technology
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
6
660
アジャイルチームがらしさを発揮するための目標づくり / Making the goal and enabling the team
kakehashi
3
130
Can We Measure Developer Productivity?
ewolff
1
150
Security-JAWS【第35回】勉強会クラウドにおけるマルウェアやコンテンツ改ざんへの対策
4su_para
0
180
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
13k
AI前提のサービス運用ってなんだろう?
ryuichi1208
8
1.4k
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
アジャイルでの品質の進化 Agile in Motion vol.1/20241118 Hiroyuki Sato
shift_evolve
0
170
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
9
1.1k
The Role of Developer Relations in AI Product Success.
giftojabu1
0
130
Zennのパフォーマンスモニタリングでやっていること
ryosukeigarashi
0
140
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
1
230
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Why Our Code Smells
bkeepers
PRO
334
57k
Site-Speed That Sticks
csswizardry
0
27
Into the Great Unknown - MozCon
thekraken
32
1.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Documentation Writing (for coders)
carmenintech
65
4.4k
Agile that works and the tools we love
rasmusluckow
327
21k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Practical Orchestrator
shlominoach
186
10k
Automating Front-end Workflow
addyosmani
1366
200k
Optimizing for Happiness
mojombo
376
70k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
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