{"id":18706975,"url":"https://github.com/terraform-google-modules/terraform-google-event-function","last_synced_at":"2025-11-09T08:30:32.157Z","repository":{"id":40464426,"uuid":"168008017","full_name":"terraform-google-modules/terraform-google-event-function","owner":"terraform-google-modules","description":"Responds to logging events with a Cloud Function","archived":false,"fork":false,"pushed_at":"2025-01-03T23:10:27.000Z","size":688,"stargazers_count":53,"open_issues_count":6,"forks_count":63,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-01-03T23:28:42.592Z","etag":null,"topics":["cft-terraform","serverless-computing"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/terraform-google-modules/event-function/google","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terraform-google-modules.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-28T17:50:42.000Z","updated_at":"2025-01-03T23:10:30.000Z","dependencies_parsed_at":"2023-10-20T00:16:39.718Z","dependency_job_id":"5785098a-b631-4d13-885b-32539cdd37d4","html_url":"https://github.com/terraform-google-modules/terraform-google-event-function","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-google-modules%2Fterraform-google-event-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-google-modules%2Fterraform-google-event-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-google-modules%2Fterraform-google-event-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-google-modules%2Fterraform-google-event-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terraform-google-modules","download_url":"https://codeload.github.com/terraform-google-modules/terraform-google-event-function/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239571542,"owners_count":19661164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cft-terraform","serverless-computing"],"created_at":"2024-11-07T12:16:09.787Z","updated_at":"2025-11-09T08:30:32.119Z","avatar_url":"https://github.com/terraform-google-modules.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Event Function\n\nThis module configures a system which responds to events by invoking a\nCloud Functions function.\n\nThe root module configures a function sourced from a directory on\nlocalhost to respond to a given event trigger. The source directory is\ncompressed and uploaded as a Cloud Storage bucket object which will be\nleveraged by the function.\n\nAlternatively, the\n[repository-function submodule][repository-function-submodule]\nconfigures a function sourced from a Cloud Source Repositories\nrepository.\n\n## Compatibility\nThis module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+.\nIf you find incompatibilities using Terraform `\u003e=0.13`, please open an issue.\n\nIf you haven't [upgraded][terraform-0.13-upgrade] and need a Terraform\n0.12.x-compatible version of this module, the last released version\nintended for Terraform 0.12.x is [v1.6.0](https://registry.terraform.io/modules/terraform-google-modules/-event-function/google/v1.6.0).\n\n## Usage\n\nThe\n[automatic-labelling-from-localhost example][automatic-labelling-from-localhost-example]\nis a tested reference of how to use the root module with the\n[event-project-log-entry submodule][event-project-log-entry-submodule].\n\n## Terraform Created Source Files\n\nIf you have `local_file` Terraform resources that need to be included in the function's archive include them in the optional `source_dependent_files`.\n\nThis will tell the module to wait until those files exist before creating the archive.\n\nExample can also be seen in `examples/dynamic-files`\n\n```hcl\nresource \"local_file\" \"file\" {\n  content  = \"some content\"\n  filename = \"${path.module}/function_source/terraform_created_file.txt\"\n}\n\nmodule \"localhost_function\" {\n  ...\n\n  source_dependent_files = [local_file.file]\n}\n```\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| available\\_memory\\_mb | The amount of memory in megabytes allotted for the function to use. | `number` | `256` | no |\n| bucket\\_force\\_destroy | When deleting the GCS bucket containing the cloud function, delete all objects in the bucket first. | `bool` | `false` | no |\n| bucket\\_labels | A set of key/value label pairs to assign to the function source archive bucket. | `map(string)` | `{}` | no |\n| bucket\\_name | The name to apply to the bucket. Will default to a string of the function name. | `string` | `\"\"` | no |\n| build\\_environment\\_variables | A set of key/value environment variable pairs available during build time. | `map(string)` | `{}` | no |\n| create\\_bucket | Whether to create a new bucket or use an existing one. If false, `bucket_name` should reference the name of the alternate bucket to use. | `bool` | `true` | no |\n| description | The description of the function. | `string` | `\"Processes events.\"` | no |\n| docker\\_registry | Docker Registry to use for storing the function's Docker images. Allowed values are CONTAINER\\_REGISTRY (default) and ARTIFACT\\_REGISTRY. | `string` | `null` | no |\n| docker\\_repository | User managed repository created in Artifact Registry optionally with a customer managed encryption key. If specified, deployments will use Artifact Registry. | `string` | `null` | no |\n| entry\\_point | The name of a method in the function source which will be invoked when the function is executed. | `string` | n/a | yes |\n| environment\\_variables | A set of key/value environment variable pairs to assign to the function. | `map(string)` | `{}` | no |\n| event\\_trigger | A source that fires events in response to a condition in another service. | `map(string)` | `{}` | no |\n| event\\_trigger\\_failure\\_policy\\_retry | A toggle to determine if the function should be retried on failure. | `bool` | `false` | no |\n| files\\_to\\_exclude\\_in\\_source\\_dir | Specify files to ignore when reading the source\\_dir | `list(string)` | `[]` | no |\n| ingress\\_settings | The ingress settings for the function. Allowed values are ALLOW\\_ALL, ALLOW\\_INTERNAL\\_AND\\_GCLB and ALLOW\\_INTERNAL\\_ONLY. Changes to this field will recreate the cloud function. | `string` | `\"ALLOW_ALL\"` | no |\n| kms\\_key\\_name | Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. | `string` | `null` | no |\n| labels | A set of key/value label pairs to assign to the Cloud Function. | `map(string)` | `{}` | no |\n| log\\_bucket | Log bucket | `string` | `null` | no |\n| log\\_object\\_prefix | Log object prefix | `string` | `null` | no |\n| max\\_instances | The maximum number of parallel executions of the function. | `number` | `0` | no |\n| name | The name to apply to any nameable resources. | `string` | n/a | yes |\n| project\\_id | The ID of the project to which resources will be applied. | `string` | n/a | yes |\n| region | The region in which resources will be applied. | `string` | n/a | yes |\n| runtime | The runtime in which the function will be executed. | `string` | n/a | yes |\n| secret\\_environment\\_variables | A list of maps which contains key, project\\_id, secret\\_name (not the full secret id) and version to assign to the function as a set of secret environment variables. | `list(map(string))` | `[]` | no |\n| service\\_account\\_email | The service account to run the function as. | `string` | `\"\"` | no |\n| source\\_dependent\\_files | A list of any Terraform created `local_file`s that the module will wait for before creating the archive. | \u003cpre\u003elist(object({\u003cbr\u003e    filename = string\u003cbr\u003e    id       = string\u003cbr\u003e  }))\u003c/pre\u003e | `[]` | no |\n| source\\_directory | The pathname of the directory which contains the function source code. | `string` | n/a | yes |\n| timeout\\_s | The amount of time in seconds allotted for the execution of the function. | `number` | `60` | no |\n| trigger\\_http | Wheter to use HTTP trigger instead of the event trigger. | `bool` | `null` | no |\n| vpc\\_connector | The VPC Network Connector that this cloud function can connect to. It should be set up as fully-qualified URI. The format of this field is projects/*/locations/*/connectors/*. | `string` | `null` | no |\n| vpc\\_connector\\_egress\\_settings | The egress settings for the connector, controlling what traffic is diverted through it. Allowed values are ALL\\_TRAFFIC and PRIVATE\\_RANGES\\_ONLY. If unset, this field preserves the previously set value. | `string` | `null` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| https\\_trigger\\_url | URL which triggers function execution. |\n| name | The name of the function. |\n\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n\n## Requirements\n\nThe following sections describe the requirements which must be met in\norder to invoke this module.\n\n### Software Dependencies\n\nThe following software dependencies must be installed on the system\nfrom which this module will be invoked:\n\n- [Terraform](https://www.terraform.io/downloads.html) \u003e= 0.13.0\n- [Terraform Provider for Archive][terraform-provider-archive-site]\n- [Terraform Provider for Google Cloud Platform][terraform-provider-gcp-site]\n\n### IAM Roles\n\nThe Service Account which will be used to invoke this module must have\nthe following IAM roles:\n\n- Cloud Functions Developer: `roles/cloudfunctions.developer`\n- Storage Admin: `roles/storage.admin`\n- Secret Manager Accessor: `roles/secretmanager.secretAccessor`\n\n### APIs\n\nThe project against which this module will be invoked must have the\nfollowing APIs enabled:\n\n- Cloud Functions API: `cloudfunctions.googleapis.com`\n- Cloud Storage API: `storage-component.googleapis.com`\n- Secret Manager API: `secretmanager.googleapis.com`\n\nThe [Project Factory module][project-factory-module-site] can be used to\nprovision projects with specific APIs activated.\n\n## Contributing\n\nRefer to the [contribution guidelines](./CONTRIBUTING.md) for\ninformation on contributing to this module.\n\n[automatic-labelling-from-localhost-example]: examples/automatic-labelling-from-localhost\n[event-project-log-entry-submodule]: modules/event-project-log-entry\n[repository-function-submodule]: modules/repository-function\n[project-factory-module-site]: https://github.com/terraform-google-modules/terraform-google-project-factory/\n[terraform-provider-gcp-site]: https://github.com/terraform-providers/terraform-provider-google/\n[terraform-site]: https://www.terraform.io/\n[terraform-0.13-upgrade]: https://www.terraform.io/upgrade-guides/0-13.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-google-modules%2Fterraform-google-event-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterraform-google-modules%2Fterraform-google-event-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-google-modules%2Fterraform-google-event-function/lists"}