Skip to content

Instantly share code, notes, and snippets.

@sue445
Created February 17, 2020 03:23
Show Gist options
  • Save sue445/a655d09c695646b4d7c22a8353d66ce2 to your computer and use it in GitHub Desktop.
Save sue445/a655d09c695646b4d7c22a8353d66ce2 to your computer and use it in GitHub Desktop.
Service account for datadog
# Service account for datadog
# c.f. https://docs.datadoghq.com/ja/integrations/google_cloud_platform/?tab=datadogussite#setup
resource "google_service_account" "datadog" {
account_id = "datadog"
display_name = "datadog"
}
# Compute Viewer
resource "google_project_iam_binding" "datadog_compute_viewer" {
role = "roles/compute.viewer"
members = [
"serviceAccount:${google_service_account.datadog.email}",
]
}
# Monitoring Viewer
resource "google_project_iam_binding" "datadog_monitoring_viewer" {
role = "roles/monitoring.viewer"
members = [
"serviceAccount:${google_service_account.datadog.email}",
]
}
# Cloud Asset Viewer
resource "google_project_iam_binding" "datadog_cloudasset_viewer" {
role = "roles/cloudasset.viewer"
members = [
"serviceAccount:${google_service_account.datadog.email}",
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment