cloud_functions library

Cloud Functions Gen 2 — serverless function execution with build + deploy from source.

Classes

AutomaticUpdatePolicy
automatic_update_policy sub-block. Cloud Functions pulls the latest patch-level runtime release on every deploy. No tunable fields.
BuildConfig
build_config block (single, max_items=1). Carries the runtime declaration and source-archive reference for the Cloud Build step that produces the function's container image.
DirectVpcNetworkInterface
One entry in service_config.direct_vpc_network_interface. Attaches the function instance to a VPC network without going through a Serverless VPC Access connector.
EventFilter
One entry in event_trigger.event_filters. Matches a CloudEvents attribute against a literal value (or, when operator is 'match-path-pattern', a path pattern).
EventTrigger
event_trigger block (single, max_items=1). Binds the function to an Eventarc trigger. Use pubsubTopic for Pub/Sub events, or eventFilters to subscribe to GCS / Firestore / Eventarc system events.
GoogleCloudfunctions2Function
Factory wrapper for google_cloudfunctions2_function (provider hashicorp/google ~> 7.0).
GoogleCloudfunctions2FunctionIamMember
Factory wrapper for google_cloudfunctions2_function_iam_member.
OnDeployUpdatePolicy
on_deploy_update_policy sub-block. Pin the runtime version observed at deploy time -- patch-level updates are NOT pulled in on subsequent reconciles. No tunable fields on input; the server populates runtime_version on read.
RepoSource
Cloud Source Repositories-backed source (build_config.source.repo_source). Specify one of branchName, tagName, or commitSha (the schema does not enforce this but the API requires exactly one).
SecretEnvironmentVariable
One entry in service_config.secret_environment_variables. Each reference materializes as an env var whose value is the secret payload at runtime.
SecretVolume
One entry in service_config.secret_volumes. Mounts one or more secret versions as files under mountPath.
SecretVolumeVersion
One entry in secret_volumes.versions. Maps a specific secret version to a relative path under the volume mount.
ServiceConfig
service_config block (single, max_items=1). Configures the underlying Cloud Run service: memory, CPU, scaling, environment, VPC egress, secret refs.
SourceConfig
Sealed dispatch for BuildConfig.source. Models the storage_source / repo_source exactly_one_of constraint at the type level: each SourceConfig subclass encodes its own Terraform key.
StorageSource
GCS-backed source archive (build_config.source.storage_source). The archive must be a single zip/tar.gz at gs://{bucket}/{object}.
UpdatePolicy
Sealed dispatch for BuildConfig.updatePolicy. The schema exposes two mutually exclusive sub-blocks (automatic_update_policy -- pull patch-level updates on every deploy, vs. on_deploy_update_policy -- pin runtime version at deploy time).

Enums

DirectVpcEgress
service_config.direct_vpc_egress -- egress policy for direct VPC network interfaces. Server default is vpcEgressPrivateRangesOnly.
EventTriggerRetryPolicy
event_trigger.retry_policy -- behaviour when the user code raises. retry re-delivers per the system retry budget; doNotRetry drops on first failure; unspecified defers to the server default (currently doNotRetry).
IngressSettings
service_config.ingress_settings -- which traffic sources can invoke the underlying Cloud Run service. Defaults server-side to allowAll.
VpcConnectorEgressSettings
service_config.vpc_connector_egress_settings -- egress policy when the function attaches via a Serverless VPC Access connector (ServiceConfig.vpcConnector). Mutually exclusive in spirit with DirectVpcEgress (which applies when using direct VPC egress).