This submodule configures a project-level Stackdriver Logging export to act as an event which will trigger a Cloud Functions function configured by the root module or the repository-function submodule.
The export uses a provided filter to identify events of interest and publishes them to a dedicated Pub/Sub topic. The target function must be configured to subscribe to the topic in order to process each export event.
The [automatic-labelling-from-localhost example][a7c-l7g-from-l7t-example] is a tested reference of how to use this submodule with the [root module].
Name | Description | Type | Default | Required |
---|---|---|---|---|
filter | The filter to apply when exporting logs. | string | n/a | yes |
labels | A set of key/value label pairs to assign to any labelable resources. | map | <map> |
no |
name | The name to apply to any nameable resources. | string | n/a | yes |
project_id | The ID of the project to which resources will be applied. | string | n/a | yes |
Name | Description |
---|---|
function_event_trigger | The information used to trigger the function when a log entry is exported to the topic. |
The following sections describe the requirements which must be met in order to invoke this module.
The following software dependencies must be installed on the system from which this module will be invoked:
- Terraform v0.11.Z
- [Terraform Provider for Google Cloud Platform][t7m-provider-gcp-site] v2.1.Z
The Service Account which will be used to invoke this module must have the following IAM roles:
- Logs Configuration Writer:
roles/logging.configWriter
- Pub/Sub Admin:
roles/pubsub.admin
- Service Account User:
roles/iam.serviceAccountUser
The project against which this module will be invoked must have the following APIs enabled:
- Cloud Pub/Sub API:
pubsub.googleapis.com
- Stackdriver Logging API:
logging.googleapis.com