CloudFunctionDeployFunctionOperator

Google

Creates a function in Google Cloud Functions. If a function with this name already exists, it will be updated.

View on GitHub

Last Updated: Feb. 25, 2023

Access Instructions

Install the Google provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

locationRequiredGoogle Cloud region where the function should be created.
bodyRequiredBody of the Cloud Functions definition. The body must be a Cloud Functions dictionary as described in: https://cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions . Different API versions require different variants of the Cloud Functions dictionary.
project_id(Optional) Google Cloud project ID where the function should be created.
gcp_conn_id(Optional) The connection ID used to connect to Google Cloud. Default ‘google_cloud_default’.
api_version(Optional) API version used (for example v1 - default - or v1beta1).
zip_pathPath to zip file containing source code of the function. If the path is set, the sourceUploadUrl should not be specified in the body or it should be empty. Then the zip file will be uploaded using the upload URL generated via generateUploadUrl from the Cloud Functions API.
validate_bodyIf set to False, body validation is not performed.
impersonation_chainOptional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

Documentation

Creates a function in Google Cloud Functions. If a function with this name already exists, it will be updated.

See also

For more information on how to use this operator, take a look at the guide: CloudFunctionDeployFunctionOperator

Was this page helpful?