google_cloud_asset_project_feed

Describes a Cloud Asset Inventory feed used to to listen to asset updates.

To get more information about ProjectFeed, see:

Example Usage - Cloud Asset Project Feed

# Create a feed that sends notifications about network resource updates.
resource "google_cloud_asset_project_feed" "project_feed" {
  project          = "my-project-name"
  feed_id          = "network-updates"
  content_type     = "RESOURCE"

  asset_types = [
    "compute.googleapis.com/Subnetwork",
    "compute.googleapis.com/Network",
  ]

  feed_output_config {
    pubsub_destination {
      topic = google_pubsub_topic.feed_output.id
    }
  }

  condition {
    expression = <<-EOT
    !temporal_asset.deleted &&
    temporal_asset.prior_asset_state == google.cloud.asset.v1.TemporalAsset.PriorAssetState.DOES_NOT_EXIST
    EOT
    title = "created"
    description = "Send notifications on creation events"
  }
}

# The topic where the resource change notifications will be sent.
resource "google_pubsub_topic" "feed_output" {
  project  = "my-project-name"
  name     = "network-updates"
}

# Find the project number of the project whose identity will be used for sending
# the asset change notifications.
data "google_project" "project" {
  project_id = "my-project-name"
}

Argument Reference

The following arguments are supported:

The feed_output_config block supports:

The pubsub_destination block supports:


The condition block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

ProjectFeed can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import ProjectFeed using one of the formats above. For example:

import {
  id = "projects/{{project}}/feeds/{{name}}"
  to = google_cloud_asset_project_feed.default
}

When using the terraform import command, ProjectFeed can be imported using one of the formats above. For example:

$ terraform import google_cloud_asset_project_feed.default projects/{{project}}/feeds/{{name}}
$ terraform import google_cloud_asset_project_feed.default {{project}}/{{name}}
$ terraform import google_cloud_asset_project_feed.default {{name}}

User Project Overrides

This resource supports User Project Overrides.