Slide 13
Slide 13 text
すでにあるやつ取り込んでみよう
サンプルをコピペした設定ファイルを準備(fooのところは書き換えたほうが良い)
terraform import でmonitor idを指定し取り込む
❯ terraform import datadog_monitor.foo 7508938
datadog_monitor.foo: Importing from ID "7508938"...
datadog_monitor.foo: Import complete!
Imported datadog_monitor (ID: 7508938)
datadog_monitor.foo: Refreshing state... (ID: 7508938)
Import successful!
The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.
❯ head -n 5 datadog_monitor.tf
resource "datadog_monitor" "foo" {
name = "Name for monitor foo"
type = "metric alert"
message = "Monitor triggered. Notify: @hipchat-channel"
escalation_message = "Escalation message @pagerduty"