This submodule configures a folder-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 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 |
folder_id | The ID of the folder to look for changes. | string |
n/a | yes |
include_children | Determines whether or not to include folder's children in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included. | bool |
false |
no |
labels | A set of key/value label pairs to assign to any labelable resources. | map(string) |
{} |
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:
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