Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
20240414_cloudgirl_ec2_costdown
Search
snowwhite
April 14, 2024
1
160
20240414_cloudgirl_ec2_costdown
2024年4月14日に行われたJAWS-UGクラウド女子会で登壇した資料です。
snowwhite
April 14, 2024
Tweet
Share
More Decks by snowwhite
See All by snowwhite
20251108_SecJAWS_IAMSp
yuri_snowwhite
0
26
20250730_AWS_AmazonQ
yuri_snowwhite
1
88
20250601_storage_and_bigdate_JAWS
yuri_snowwhite
1
70
250226_SecurityJAWS
yuri_snowwhite
2
1.1k
20250521 yumemi_grow _ finatext
yuri_snowwhite
2
330
JAWS-UG IoT_Switchbot Notify To Discord
yuri_snowwhite
1
760
Security.Any #2
yuri_snowwhite
1
150
20241024_an_real_horror_story_for_for_engineer
yuri_snowwhite
0
81
20240712_JAWSUG-FUKUOKA_Cloudgirl
yuri_snowwhite
0
77
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
2
190
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
200
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
30 Presentation Tips
portentint
PRO
1
170
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
69
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
120
Joys of Absence: A Defence of Solitary Play
codingconduct
1
260
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Context Engineering - Making Every Token Count
addyosmani
9
550
SEO for Brand Visibility & Recognition
aleyda
0
4.1k
Transcript
EC2のコストを考える 2024/04/14 株式会社ゆめみ 白"雪姫"
自己紹介 Name: 白”雪姫”(Shirayuki) Profile: 2023年8月、ゆめみ入社 ネットワークをメインにH/Wサーバの保守などを経験、その後、セキュリティの世界で物理や 専用クラウドを中心にインフラを経験、最近は AWSを多少触り始める。 苗字を呼ばれるのが嫌いなので、名前 orX名で読んでいただくことが多い
Liked Service: AWS Inspecter X(旧Twitter): @yuri_snowwhite
開発用のEC2って意外に高いと 感じませんか?
1ヶ月(30日仮定) で起動してみる サンプルにしたスペック 東京リージョン t3.micro gp2の30GiB EBS EIP無し AmazonLinux オンデマンド稼働
稼働料金 0.0136 $/hr x 24 h x 30 days EBS料金 0.12 x 30GiB 合計 13.392$(約2008.8円)
使っていない時間は 止めたら良いのでは?
平日夜間帯や土日を停止した場合の料 金を算出
1ヶ月(30日仮定) で起動してみる サンプルにしたスペック 東京リージョン t3.micro gp2の30GiB EBS EIP無し AmazonLinux オンデマンド稼働
起動時間はAM5:00〜PM22:00の 17時間・土日は停止(8日換算) 24hの時は稼働料金は 13.392$(約2008.8円) 稼働料金 0.0136 $/hr x 17 h x 22days EBS料金 0.12 x 30GiB 合計 8.6864$(1580.4円) 差額 4.7056$(705.84円)/月
金額の増加率 グラフも比例的に差分 幅が広がっていく
どうやって時間停止する?
利用したサービス ・稼働しているEC2 ・Amazon EventBridge ・EventBridgeで起動するスクリプト(マネージメントコンソールで選択できる) 起動・停止を実行 時間記載はcron方式
実践-1 Amazon EventBridgeのスケジュールから新規作成。 cron方式を選択して、月曜〜金曜の設定。 この際、Start用とStop用で2スケジュール必要なので注意。 また、時間設定は以下を参考に設定 https://docs.aws.amazon.com/ja_jp/eventbridge/latest/userguide/e b-cron-expressions.html
実践-2 ターゲットAPIのところで「すべての API」でEC2を選択、起動時は「Start」 (停止の時は「Stop」)で検索をすると 該当のスクリプトが出てきます。
実践-3 実践2のスライドで選択すると自動的 にスライドしていき、下記の画面に移 動します。 この"MyData”をインスタンスIDへ書き 換えて完了です。 複数台ある場合は、「,」区切りにて指 定も可能です。 残りはウィザードに従います。
メリットとデメリット メリット ・手軽にコストの削減が出来る ・手動で実行する手間は省ける ・複数台居ても設定をしっかりしていれ ば、停止, 起動漏れはおきない ・起動または停止を変更したいときは AWS EventBridgeで無効化すれば実行
されない様に出来る デメリット ・開発過渡期などの長時間起動が必要 な時には使えない ・パブリックIPを紐付ける設定の場合は 毎回IPが変わってしまう
実際やってみて 4.7056$/month x 12 mon = 56.4672 $ 約8470円 を削減しました。
ご静聴ありがとうございました Fin.