Skip to content

Latest commit

 

History

History

event-project-log-entry

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Event Project Log Entry

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.

Usage

The automatic-labelling-from-localhost example is a tested reference of how to use this submodule with the root module.

Inputs

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(string) {} no
name The name to apply to any nameable resources. string n/a yes
parent_resource_type The GCP resource in which you create the log sink. The value must not be computed, and must be one of the following: 'project', 'folder', 'billing_account', or 'organization'. string "project" no
project_id The ID of the project to which resources will be applied. string n/a yes

Outputs

Name Description
function_event_trigger The information used to trigger the function when a log entry is exported to the topic.

Requirements

The following sections describe the requirements which must be met in order to invoke this module.

Software Dependencies

The following software dependencies must be installed on the system from which this module will be invoked:

IAM Roles

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

APIs

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