cloud-foundation-fabric/modules/__experimental/cloud-function-scheduled
Ludovico Magnocavallo 711f113cf0 add support for environment vars in experimental cf module 2020-05-04 07:48:37 +02:00
..
README.md Merge development branch (#44) 2020-04-03 14:06:48 +02:00
main.tf add support for environment vars in experimental cf module 2020-05-04 07:48:37 +02:00
outputs.tf Merge development branch (#44) 2020-04-03 14:06:48 +02:00
variables.tf add support for environment vars in experimental cf module 2020-05-04 07:48:37 +02:00
versions.tf Merge development branch (#44) 2020-04-03 14:06:48 +02:00

README.md

Scheduled Google Cloud Function Module

This module manages a background Cloud Function scheduled via a recurring Cloud Scheduler job. It also manages the required dependencies: a service account for the cloud function with optional IAM bindings, the PubSub topic used for the function trigger, and optionally the GCS bucket used for the code bundle.

Example

module "function" {
  source     = "./modules/cloud-function-scheduled"
  project_id = "myproject"
  name       = "myfunction"
  bundle_config = {
    source_dir  = "../cf"
    output_path = "../bundle.zip"
  }
}

Variables

name description type required default
bundle_config Cloud function code bundle configuration, output path is a zip file. object({...})
name Name used for resources (schedule, topic, etc.). string
project_id Project id used for all resources. string
bucket_name Name of the bucket that will be used for the function code, leave null to create one. string null
function_config Cloud function configuration. object({...}) ...
prefixes Optional prefixes for resource ids, null prefixes will be ignored. object({...}) null
region Region used for all resources. string us-central1
schedule_config Cloud function scheduler job configuration, leave data null to pass the name variable, set schedule to null to disable schedule. object({...}) ...
service_account_iam_roles IAM roles assigned to the service account at the project level. list(string) []

Outputs

name description sensitive
bucket_name Bucket name.
function_name Cloud function name.
service_account_email Service account email.
topic_id PubSub topic id.