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
210
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
190
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
480
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
3
2.3k
Amazon VPC Lattice 最新アップデート紹介 - PrivateLink も似たようなアップデートあったけど違いとは
bigmuramura
0
190
DUSt3R, MASt3R, MASt3R-SfM にみる3D基盤モデル
spatial_ai_network
2
120
Postman と API セキュリティ / Postman and API Security
yokawasa
0
200
生成AIのガバナンスの全体像と現実解
fnifni
1
190
開発生産性向上! 育成を「改善」と捉えるエンジニア育成戦略
shoota
2
350
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
560
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
130
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
260
Featured
See All Featured
Writing Fast Ruby
sferik
628
61k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Producing Creativity
orderedlist
PRO
341
39k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Code Reviewing Like a Champion
maltzj
520
39k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
The Pragmatic Product Professional
lauravandoore
32
6.3k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
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