cloud_functions library
Cloud Functions Gen 2 — serverless function execution with build + deploy from source.
Classes
- AutomaticUpdatePolicy
-
automatic_update_policysub-block. Cloud Functions pulls the latest patch-level runtime release on every deploy. No tunable fields. - BuildConfig
-
build_configblock (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_triggerblock (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(providerhashicorp/google ~> 7.0). - GoogleCloudfunctions2FunctionIamMember
-
Factory wrapper for
google_cloudfunctions2_function_iam_member. - OnDeployUpdatePolicy
-
on_deploy_update_policysub-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 populatesruntime_versionon 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_configblock (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_sourceexactly_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 atgs://{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 isvpcEgressPrivateRangesOnly. - EventTriggerRetryPolicy
-
event_trigger.retry_policy-- behaviour when the user code raises.retryre-delivers per the system retry budget;doNotRetrydrops on first failure;unspecifieddefers to the server default (currentlydoNotRetry). - IngressSettings
-
service_config.ingress_settings-- which traffic sources can invoke the underlying Cloud Run service. Defaults server-side toallowAll. - 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).