|
| 1 | +# Event Folder Log Entry |
| 2 | + |
| 3 | +This submodule configures a folder-level Stackdriver Logging export to |
| 4 | +act as an event which will trigger a Cloud Functions function configured |
| 5 | +by the [root module][root-module] or the |
| 6 | +[repository-function submodule][repository-function]. |
| 7 | + |
| 8 | +The export uses a provided filter to identify events of interest and |
| 9 | +publishes them to a dedicated Pub/Sub topic. The target function |
| 10 | +must be configured to subscribe to the topic in order to process each |
| 11 | +export event. |
| 12 | + |
| 13 | +## Usage |
| 14 | + |
| 15 | +The |
| 16 | +[automatic-labelling-from-localhost example][a7c-l7g-from-l7t-example] |
| 17 | +is a tested reference of how to use this submodule with the |
| 18 | +[root module]. |
| 19 | + |
| 20 | +<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
| 21 | +## Inputs |
| 22 | + |
| 23 | +| Name | Description | Type | Default | Required | |
| 24 | +|------|-------------|:----:|:-----:|:-----:| |
| 25 | +| filter | The filter to apply when exporting logs. | string | n/a | yes | |
| 26 | +| folder\_id | The ID of the folder to look for changes. | string | n/a | yes | |
| 27 | +| labels | A set of key/value label pairs to assign to any labelable resources. | map(string) | `<map>` | no | |
| 28 | +| name | The name to apply to any nameable resources. | string | n/a | yes | |
| 29 | +| project\_id | The ID of the project to which resources will be applied. | string | n/a | yes | |
| 30 | + |
| 31 | +## Outputs |
| 32 | + |
| 33 | +| Name | Description | |
| 34 | +|------|-------------| |
| 35 | +| function\_event\_trigger | The information used to trigger the function when a log entry is exported to the topic. | |
| 36 | + |
| 37 | +<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
| 38 | + |
| 39 | +## Requirements |
| 40 | + |
| 41 | +The following sections describe the requirements which must be met in |
| 42 | +order to invoke this module. |
| 43 | + |
| 44 | +### Software Dependencies |
| 45 | + |
| 46 | +The following software dependencies must be installed on the system |
| 47 | +from which this module will be invoked: |
| 48 | + |
| 49 | +- [Terraform][terraform-site] v0.11.Z |
| 50 | +- [Terraform Provider for Google Cloud Platform][t7m-provider-gcp-site] |
| 51 | + v2.1.Z |
| 52 | + |
| 53 | +### IAM Roles |
| 54 | + |
| 55 | +The Service Account which will be used to invoke this module must have |
| 56 | +the following IAM roles: |
| 57 | + |
| 58 | +- Logs Configuration Writer: `roles/logging.configWriter` |
| 59 | +- Pub/Sub Admin: `roles/pubsub.admin` |
| 60 | +- Service Account User: `roles/iam.serviceAccountUser` |
| 61 | + |
| 62 | +### APIs |
| 63 | + |
| 64 | +The project against which this module will be invoked must have the |
| 65 | +following APIs enabled: |
| 66 | + |
| 67 | +- Cloud Pub/Sub API: `pubsub.googleapis.com` |
| 68 | +- Stackdriver Logging API: `logging.googleapis.com` |
| 69 | + |
| 70 | +[automatic-labelling-example]: ../../examples/automatic_labelling |
| 71 | +[repository-function]: ../repository-function |
| 72 | +[root-module]: ../.. |
| 73 | +[terraform-site]: https://www.terraform.io/ |
0 commit comments