A Cloud Security Command Center (Cloud SCC) notification configs. A notification config is a Cloud SCC resource that contains the configuration to send notifications for create/update events of findings, assets and etc.
To get more information about NotificationConfig, see:
resource "google_pubsub_topic" "scc_notification" {
name = "my-topic"
}
resource "google_scc_notification_config" "custom_notification_config" {
config_id = "my-config"
organization = "123456789"
description = "My custom Cloud Security Command Center Finding Notification Configuration"
pubsub_topic = google_pubsub_topic.scc_notification.id
streaming_config {
filter = "category = \"OPEN_FIREWALL\" AND state = \"ACTIVE\""
}
}
The following arguments are supported:
pubsub_topic
-
(Required)
The Pub/Sub topic to send notifications to. Its format is
"projects/[project_id]/topics/[topic]".
streaming_config
-
(Required)
The config for triggering streaming-based notifications.
Structure is documented below.
organization
-
(Required)
The organization whose Cloud Security Command Center the Notification
Config lives in.
config_id
-
(Required)
This must be unique within the organization.
The streaming_config
block supports:
filter
-
(Required)
Expression that defines the filter to apply across create/update
events of assets or findings as specified by the event type. The
expression is a list of zero or more restrictions combined via
logical operators AND and OR. Parentheses are supported, and OR
has higher precedence than AND.
Restrictions have the form description
-
(Optional)
The description of the notification config (max of 1024 characters).In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format {{name}}
name
-
The resource name of this notification config, in the format
organizations/{{organization}}/notificationConfigs/{{config_id}}
.
service_account
-
The service account that needs "pubsub.topics.publish" permission to
publish to the Pub/Sub topic.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.NotificationConfig can be imported using any of these accepted formats:
organizations/{{organization}}/notificationConfigs/{{name}}
{{organization}}/{{name}}
In Terraform v1.5.0 and later, use an import
block to import NotificationConfig using one of the formats above. For example:
import {
id = "organizations/{{organization}}/notificationConfigs/{{name}}"
to = google_scc_notification_config.default
}
When using the terraform import
command, NotificationConfig can be imported using one of the formats above. For example:
$ terraform import google_scc_notification_config.default organizations/{{organization}}/notificationConfigs/{{name}}
$ terraform import google_scc_notification_config.default {{organization}}/{{name}}