Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cloud MonitoringとTerraformの付き合い方

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Cloud MonitoringとTerraformの付き合い方

Avatar for Taisei Ito

Taisei Ito

July 02, 2020

More Decks by Taisei Ito

Other Decks in Technology

Transcript

  1. 自己紹介 • 伊藤 太斉(Taisei Ito) ◦ @kaedemalu(Twitter, Github) ◦ フューチャー株式会社

    TIG/DX所属 ◦ コンサルタント&インフラエンジニア ◦ #GCP #Terraform • Community ◦ GCPUG Shonan Staff ◦ CloudNative Days Tokyo Committee
  2. Cloud Monitoringについて • GCPの監視ツールの1つ ◦ 他にはLogging, Debugger, Error Reporting etc...

    • 元々Stackdriverとして2012年に開発された • 2014年にGoogleに買収され、2020に名前の変更
  3. 最初からコード化は難しい resource "google_monitoring_alert_policy" "someone_alert_policy"{ .... conditions { condition_threshold { aggregations

    { .... filter = "metric.type=\"agent.googleapis.com/disk/percent_used\" resource.type=\"gce_instance\" metric.label.\"state\"=\"used\" metric.label.\"device\"=\"rootfs\" metadata.user_labels.\"name\"=\"sample-instance-1\"" ....
  4. メンテナンスが大変 resource "google_monitoring_alert_policy" "tfer--projects--project-name--alertPolicies--17320504" { .... conditions { condition_threshold {

    aggregations { .... filter = "metric.type=\"agent.googleapis.com/disk/percent_used\" resource.type=\"gce_instance\" metric.label.\"state\"=\"used\" metric.label.\"device\"=\"rootfs\" metadata.user_labels.\"name\"=\"sample-instance-1\"" ....
  5. コード化をあえてしない resource "google_monitoring_alert_policy" "someone_alert_policy"{ .... display_name = "use-80-percent-resource-disk" enabled =

    "true" notification_channels = [ google_monitoring_notification_channel.slack_channel_1.id, "projects/project-name/notificationChannels/0123456789", ] project = "project-name" } コード化しない部分
  6. まとめ • ツールを使ったコード化も必要 ◦ 時間の節約 ◦ 使うときは最小単位で • より安全にコード化するために ◦

    クラウド側で担保する ◦ コードが流出した時のリスク ▪ ツール導入を進めながら
  7. We are hiring! • IT Consultant & Engineer ◦ Infrastructure

    ◦ Application ◦ IoT ◦ AI etc... Tech Blog