0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

AWSで業務時間外には使わないリソースを停止しておいてコスト削減するスタックをサーバレスで作った話

Last updated at Posted at 2019-12-08

以前エンジニア組織のコスト管理おじさん業をやっていて、
その中の一つにインフラコスト管理というテーマがありました。
その時に使ってみてその後色々なプロジェクトに展開して行った手法を紹介します。

概要

staging環境など、production環境以外のRDS, EC2を夜間は停止しておいて、
朝方メンバー出社する前に起動しておく事で節約します。

コード

説明

技術スタック

  • CloudFormation -> IaCというより不要になった場合に全て消せるように
  • CloudWatchEvent -> スケジューラー
  • CloudWatchLogs/CloudWatch -> イベントログ取得、監視
  • Lambda -> インスタンスの起動、停止処理

説明

インスタンスの起動、停止処理をPythonで実装したLambdaを
CloudWatchEventで起動する。
監視をCloudWatchLogs/CloudWatchで行う。
上記の構成をCloudFormationでサクッと構築する

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?