Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
App Runner 実践
Search
a2-ito
October 19, 2023
570
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
App Runner 実践
a2-ito
October 19, 2023
More Decks by a2-ito
See All by a2-ito
Devin の Org-level Skills
a2ito
0
740
AIエンジニア Devin と歩む、自律型運用プロセスの構築
a2ito
0
1.3k
ECSにおけるBGデプロイの実現
a2ito
0
120
Organizations と Identity Center を Terraform で管理しよう
a2ito
0
140
Bigtable
a2ito
0
99
Chord
a2ito
0
91
Chubby
a2ito
0
110
Dynamo
a2ito
0
120
Megastore
a2ito
0
95
Featured
See All Featured
We Are The Robots
honzajavorek
0
400
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Navigating Weather and Climate Data
rabernat
0
560
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
220
Visualization
eitanlees
153
17k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
450
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
310
Scaling GitHub
holman
464
140k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
67k
Amusing Abliteration
ianozsvald
1
350
Transcript
App Runner 実践 JAWS-UG SRE支部 #7 @a2-ito
Profile • Akihiko Ito • Cloud Architect/SRE • dotD •
Twitter: @piyohiko110 • Github: @a2-ito
App Runner • コンテナorコードをデプロイする • チューニング要素 ◦ CPU ◦ RAM
◦ 同時接続数 ◦ 最大・最小サイズ • エンドポイント ◦ パブリックエンドポイント ◦ プライベートエンドポイント • VPCコネクタによるVPC内リソースへのアクセス
App Runner実践 1. IaC との組み合わせ 2. CloudFront との組み合わせ 3. コンテナ起動時のトラブル
1. IaC との組み合わせ • App Runner のデプロイをどこまで IaC コード化するか? ◦
アプリとインフラのライフサイクルをきれいにしたい
1. IaC との組み合わせ • App Runner のデプロイをどこまで IaC コード化するか? ◦
アプリとインフラのライフサイクルをきれいにしたい ①AWSリソースをデ プロイ ②ECRにpush
1. IaC との組み合わせ • 依存関係があるため、2ステップでは構築完了できない ◦ ECR がないとコンテナイメージが push できない
◦ ECR にコンテナイメージがないと App Runner をデプロイできない ◦ App Runner リソースがないと Route53 の エイリアス が作れない 依存 依存 依存
1. IaC との組み合わせ • App Runner の作成をアプリのライフサイクルに寄せるのは茨の道 ◦ ECR と
Aurora まで Terraform で作成 ◦ 残りをアプリ側で、、、 Github Actions で全部設 定するのつらい これはインフラやろ
2. CloudFront との組み合わせ • フロントエンドと一緒に CloudFront にぶら下げたい
2. CloudFront との組み合わせ • App Runner のデフォルトドメイン問題 ◦ パブリックエンドポイントモードの場合、外部からアクセスできるドメインが作成される ◦
この経路はアクセスさせたくない
2. CloudFront との組み合わせ • App Runner のデフォルトドメイン問題 a. CloudFront でカスタムヘッダを持たせて、そのリクエストだけを許可する
b. WAFのIP制限でも実装は可能(アプリをどうしてもいじりたくない場合)
2. CloudFront との組み合わせ • CloudFront のリクエストサイズ問題 ◦ 大きいサイズのリクエストは CloudFront の上限に引っかかる可能性がある
◦ App Runner のデフォルトドメインを使うか、 Lambda などにオフロードする
3. コンテナ起動時のトラブル • 現状(2023.10時点)の App Runner の仕様 ◦ 起動に失敗すると自動でロールバックされる ◦
ロールバックしても起動できない場合、停止状態になる ◦ 停止中は設定変更ができない ▪ イメージソースも修正できない
3. コンテナ起動時のトラブル • 構築直後初回起動でNW接続ができないケースがあった ◦ 起動時にDBコネクションを貼りに行くもの、起動が早いものは特に要注意 ◦ 永遠に起動できないことも DB接続がこける アプリ起動がこける
停止状態になると設定変 更できない
3. コンテナ起動時のトラブル • ワークアラウンド ◦ Exponential Backoff ◦ 外部接続なしモード