Skip to content

googleCloudfunctionsFunction

Get information about a Google Cloud Function. For more information see the official documentation and API.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.dataGoogleCloudfunctionsFunction.DataGoogleCloudfunctionsFunction(
  this,
  "my-function",
  {
    name: "function",
  }
);

Argument Reference

The following arguments are supported:

  • name - (Required) The name of a Cloud Function.

  • project - (Optional) The project in which the resource belongs. If it is not provided, the provider project is used.

  • region - (Optional) The region in which the resource belongs. If it is not provided, the provider region is used.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • name - The name of the Cloud Function.
  • sourceArchiveBucket - The GCS bucket containing the zip archive which contains the function.
  • sourceArchiveObject - The source archive object (file) in archive bucket.
  • description - Description of the function.
  • availableMemoryMb - Available memory (in MB) to the function.
  • timeout - Function execution timeout (in seconds).
  • runtime - The runtime in which the function is running.
  • entryPoint - Name of a JavaScript function that will be executed when the Google Cloud Function is triggered.
  • triggerHttp - If function is triggered by HTTP, this boolean is set.
  • eventTrigger - A source that fires events in response to a condition in another service. Structure is documented below.
  • httpsTriggerUrl - If function is triggered by HTTP, trigger URL is set here.
  • ingressSettings - Controls what traffic can reach the function.
  • labels - A map of labels applied to this function.
  • serviceAccountEmail - The service account email to be assumed by the cloud function.
  • vpcConnector - The VPC Network Connector that this cloud function can connect to.
  • vpcConnectorEgressSettings - The egress settings for the connector, controlling what traffic is diverted through it.
  • maxInstances - The limit on the maximum number of function instances that may coexist at a given time. If unset or set to 0, the API default will be used.
  • sourceRepository - The URL of the Cloud Source Repository that the function is deployed from. Structure is documented below.

The eventTrigger block contains:

  • eventType - The type of event to observe. For example: "googleStorageObjectFinalize". See the documentation on calling Cloud Functions for a full reference of accepted triggers.

  • resource - The name of the resource whose events are being observed, for example, "myBucket"

  • failurePolicy - Policy for failed executions. Structure is documented below.

The failurePolicy block contains:

  • retry - Whether the function should be retried on failure.

The sourceRepository block contains:

  • url - The URL pointing to the hosted repository where the function is defined.