cloudfunctions

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-gcp repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-google repo.

class pulumi_gcp.cloudfunctions.AwaitableGetFunctionResult(available_memory_mb=None, description=None, entry_point=None, environment_variables=None, event_triggers=None, https_trigger_url=None, labels=None, max_instances=None, name=None, project=None, region=None, runtime=None, service_account_email=None, source_archive_bucket=None, source_archive_object=None, source_repositories=None, timeout=None, trigger_bucket=None, trigger_http=None, trigger_topic=None, vpc_connector=None, id=None)
class pulumi_gcp.cloudfunctions.Function(resource_name, opts=None, available_memory_mb=None, description=None, entry_point=None, environment_variables=None, event_trigger=None, https_trigger_url=None, labels=None, max_instances=None, name=None, project=None, region=None, runtime=None, service_account_email=None, source_archive_bucket=None, source_archive_object=None, source_repository=None, timeout=None, trigger_http=None, vpc_connector=None, __props__=None, __name__=None, __opts__=None)

Creates a new Cloud Function. For more information see the official documentation and API.

Warning: As of November 1, 2019, newly created Functions are private-by-default and will require appropriate IAM permissions to be invoked. See below examples for how to set up the appropriate permissions, or view the Cloud Functions IAM resources for Cloud Functions.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • available_memory_mb (pulumi.Input[float]) – Memory (in MB), available to the function. Default value is 256MB. Allowed values are: 128MB, 256MB, 512MB, 1024MB, and 2048MB.

  • description (pulumi.Input[str]) – Description of the function.

  • entry_point (pulumi.Input[str]) – Name of the function that will be executed when the Google Cloud Function is triggered.

  • environment_variables (pulumi.Input[dict]) – A set of key/value environment variable pairs to assign to the function.

  • event_trigger (pulumi.Input[dict]) – A source that fires events in response to a condition in another service. Structure is documented below. Cannot be used with trigger_http.

  • https_trigger_url (pulumi.Input[str]) – URL which triggers function execution. Returned only if trigger_http is used.

  • labels (pulumi.Input[dict]) – A set of key/value label pairs to assign to the function.

  • max_instances (pulumi.Input[float]) – The limit on the maximum number of function instances that may coexist at a given time.

  • name (pulumi.Input[str]) – A user-defined name of the function. Function names must be unique globally.

  • project (pulumi.Input[str]) – Project of the function. If it is not provided, the provider project is used.

  • region (pulumi.Input[str]) – Region of function. Currently can be only “us-central1”. If it is not provided, the provider region is used.

  • runtime (pulumi.Input[str]) – The runtime in which the function is going to run. One of "nodejs6", "nodejs8", "nodejs10", "python37", "go111". If empty, defaults to "nodejs6". It’s recommended that you override the default, as "nodejs6" is deprecated.

  • service_account_email (pulumi.Input[str]) – If provided, the self-provided service account to run the function with.

  • source_archive_bucket (pulumi.Input[str]) – The GCS bucket containing the zip archive which contains the function.

  • source_archive_object (pulumi.Input[str]) – The source archive object (file) in archive bucket.

  • source_repository (pulumi.Input[dict]) – Represents parameters related to source repository where a function is hosted. Cannot be set alongside source_archive_bucket or source_archive_object. Structure is documented below.

  • timeout (pulumi.Input[float]) – Timeout (in seconds) for the function. Default value is 60 seconds. Cannot be more than 540 seconds.

  • trigger_http (pulumi.Input[bool]) – Boolean variable. Any HTTP request (of a supported type) to the endpoint will trigger function execution. Supported HTTP request types are: POST, PUT, GET, DELETE, and OPTIONS. Endpoint is returned as https_trigger_url. Cannot be used with trigger_bucket and trigger_topic.

  • vpc_connector (pulumi.Input[str]) – The VPC Network Connector that this cloud function can connect to. It can be either the fully-qualified URI, or the short name of the network connector resource. The format of this field is projects/*/locations/*/connectors/*.

The event_trigger object supports the following:

  • eventType (pulumi.Input[str])

  • failurePolicy (pulumi.Input[dict])

    • retry (pulumi.Input[bool])

  • resource (pulumi.Input[str])

The source_repository object supports the following:

  • deployedUrl (pulumi.Input[str])

  • url (pulumi.Input[str])

available_memory_mb = None

Memory (in MB), available to the function. Default value is 256MB. Allowed values are: 128MB, 256MB, 512MB, 1024MB, and 2048MB.

description = None

Description of the function.

entry_point = None

Name of the function that will be executed when the Google Cloud Function is triggered.

environment_variables = None

A set of key/value environment variable pairs to assign to the function.

event_trigger = None

A source that fires events in response to a condition in another service. Structure is documented below. Cannot be used with trigger_http.

  • eventType (str)

  • failurePolicy (dict)

    • retry (bool)

  • resource (str)

https_trigger_url = None

URL which triggers function execution. Returned only if trigger_http is used.

labels = None

A set of key/value label pairs to assign to the function.

max_instances = None

The limit on the maximum number of function instances that may coexist at a given time.

name = None

A user-defined name of the function. Function names must be unique globally.

project = None

Project of the function. If it is not provided, the provider project is used.

region = None

Region of function. Currently can be only “us-central1”. If it is not provided, the provider region is used.

runtime = None

The runtime in which the function is going to run. One of "nodejs6", "nodejs8", "nodejs10", "python37", "go111". If empty, defaults to "nodejs6". It’s recommended that you override the default, as "nodejs6" is deprecated.

service_account_email = None

If provided, the self-provided service account to run the function with.

source_archive_bucket = None

The GCS bucket containing the zip archive which contains the function.

source_archive_object = None

The source archive object (file) in archive bucket.

source_repository = None

Represents parameters related to source repository where a function is hosted. Cannot be set alongside source_archive_bucket or source_archive_object. Structure is documented below.

  • deployedUrl (str)

  • url (str)

timeout = None

Timeout (in seconds) for the function. Default value is 60 seconds. Cannot be more than 540 seconds.

trigger_http = None

Boolean variable. Any HTTP request (of a supported type) to the endpoint will trigger function execution. Supported HTTP request types are: POST, PUT, GET, DELETE, and OPTIONS. Endpoint is returned as https_trigger_url. Cannot be used with trigger_bucket and trigger_topic.

vpc_connector = None

The VPC Network Connector that this cloud function can connect to. It can be either the fully-qualified URI, or the short name of the network connector resource. The format of this field is projects/*/locations/*/connectors/*.

static get(resource_name, id, opts=None, available_memory_mb=None, description=None, entry_point=None, environment_variables=None, event_trigger=None, https_trigger_url=None, labels=None, max_instances=None, name=None, project=None, region=None, runtime=None, service_account_email=None, source_archive_bucket=None, source_archive_object=None, source_repository=None, timeout=None, trigger_http=None, vpc_connector=None)

Get an existing Function resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • available_memory_mb (pulumi.Input[float]) – Memory (in MB), available to the function. Default value is 256MB. Allowed values are: 128MB, 256MB, 512MB, 1024MB, and 2048MB.

  • description (pulumi.Input[str]) – Description of the function.

  • entry_point (pulumi.Input[str]) – Name of the function that will be executed when the Google Cloud Function is triggered.

  • environment_variables (pulumi.Input[dict]) – A set of key/value environment variable pairs to assign to the function.

  • event_trigger (pulumi.Input[dict]) – A source that fires events in response to a condition in another service. Structure is documented below. Cannot be used with trigger_http.

  • https_trigger_url (pulumi.Input[str]) – URL which triggers function execution. Returned only if trigger_http is used.

  • labels (pulumi.Input[dict]) – A set of key/value label pairs to assign to the function.

  • max_instances (pulumi.Input[float]) – The limit on the maximum number of function instances that may coexist at a given time.

  • name (pulumi.Input[str]) – A user-defined name of the function. Function names must be unique globally.

  • project (pulumi.Input[str]) – Project of the function. If it is not provided, the provider project is used.

  • region (pulumi.Input[str]) – Region of function. Currently can be only “us-central1”. If it is not provided, the provider region is used.

  • runtime (pulumi.Input[str]) – The runtime in which the function is going to run. One of "nodejs6", "nodejs8", "nodejs10", "python37", "go111". If empty, defaults to "nodejs6". It’s recommended that you override the default, as "nodejs6" is deprecated.

  • service_account_email (pulumi.Input[str]) – If provided, the self-provided service account to run the function with.

  • source_archive_bucket (pulumi.Input[str]) – The GCS bucket containing the zip archive which contains the function.

  • source_archive_object (pulumi.Input[str]) – The source archive object (file) in archive bucket.

  • source_repository (pulumi.Input[dict]) – Represents parameters related to source repository where a function is hosted. Cannot be set alongside source_archive_bucket or source_archive_object. Structure is documented below.

  • timeout (pulumi.Input[float]) – Timeout (in seconds) for the function. Default value is 60 seconds. Cannot be more than 540 seconds.

  • trigger_http (pulumi.Input[bool]) – Boolean variable. Any HTTP request (of a supported type) to the endpoint will trigger function execution. Supported HTTP request types are: POST, PUT, GET, DELETE, and OPTIONS. Endpoint is returned as https_trigger_url. Cannot be used with trigger_bucket and trigger_topic.

  • vpc_connector (pulumi.Input[str]) – The VPC Network Connector that this cloud function can connect to. It can be either the fully-qualified URI, or the short name of the network connector resource. The format of this field is projects/*/locations/*/connectors/*.

The event_trigger object supports the following:

  • eventType (pulumi.Input[str])

  • failurePolicy (pulumi.Input[dict])

    • retry (pulumi.Input[bool])

  • resource (pulumi.Input[str])

The source_repository object supports the following:

  • deployedUrl (pulumi.Input[str])

  • url (pulumi.Input[str])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.cloudfunctions.FunctionIamBinding(resource_name, opts=None, cloud_function=None, condition=None, members=None, project=None, region=None, role=None, __props__=None, __name__=None, __opts__=None)

Create a FunctionIamBinding resource with the given unique name, props, and options.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • cloud_function (pulumi.Input[str]) – Used to find the parent resource to bind the IAM policy to

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.

  • region (pulumi.Input[str]) – The location of this cloud function. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no region is provided in the parent identifier and no region is specified, it is taken from the provider configuration.

  • role (pulumi.Input[str]) – The role that should be applied. Only one cloudfunctions.FunctionIamBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

The condition object supports the following:

  • description (pulumi.Input[str])

  • expression (pulumi.Input[str])

  • title (pulumi.Input[str])

cloud_function = None

Used to find the parent resource to bind the IAM policy to

etag = None

(Computed) The etag of the IAM policy.

project = None

The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.

region = None

The location of this cloud function. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no region is provided in the parent identifier and no region is specified, it is taken from the provider configuration.

role = None

The role that should be applied. Only one cloudfunctions.FunctionIamBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

static get(resource_name, id, opts=None, cloud_function=None, condition=None, etag=None, members=None, project=None, region=None, role=None)

Get an existing FunctionIamBinding resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • cloud_function (pulumi.Input[str]) – Used to find the parent resource to bind the IAM policy to

  • etag (pulumi.Input[str]) – (Computed) The etag of the IAM policy.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.

  • region (pulumi.Input[str]) – The location of this cloud function. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no region is provided in the parent identifier and no region is specified, it is taken from the provider configuration.

  • role (pulumi.Input[str]) – The role that should be applied. Only one cloudfunctions.FunctionIamBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

The condition object supports the following:

  • description (pulumi.Input[str])

  • expression (pulumi.Input[str])

  • title (pulumi.Input[str])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.cloudfunctions.FunctionIamMember(resource_name, opts=None, cloud_function=None, condition=None, member=None, project=None, region=None, role=None, __props__=None, __name__=None, __opts__=None)

Create a FunctionIamMember resource with the given unique name, props, and options.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • cloud_function (pulumi.Input[str]) – Used to find the parent resource to bind the IAM policy to

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.

  • region (pulumi.Input[str]) – The location of this cloud function. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no region is provided in the parent identifier and no region is specified, it is taken from the provider configuration.

  • role (pulumi.Input[str]) – The role that should be applied. Only one cloudfunctions.FunctionIamBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

The condition object supports the following:

  • description (pulumi.Input[str])

  • expression (pulumi.Input[str])

  • title (pulumi.Input[str])

cloud_function = None

Used to find the parent resource to bind the IAM policy to

etag = None

(Computed) The etag of the IAM policy.

project = None

The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.

region = None

The location of this cloud function. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no region is provided in the parent identifier and no region is specified, it is taken from the provider configuration.

role = None

The role that should be applied. Only one cloudfunctions.FunctionIamBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

static get(resource_name, id, opts=None, cloud_function=None, condition=None, etag=None, member=None, project=None, region=None, role=None)

Get an existing FunctionIamMember resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • cloud_function (pulumi.Input[str]) – Used to find the parent resource to bind the IAM policy to

  • etag (pulumi.Input[str]) – (Computed) The etag of the IAM policy.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.

  • region (pulumi.Input[str]) – The location of this cloud function. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no region is provided in the parent identifier and no region is specified, it is taken from the provider configuration.

  • role (pulumi.Input[str]) – The role that should be applied. Only one cloudfunctions.FunctionIamBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

The condition object supports the following:

  • description (pulumi.Input[str])

  • expression (pulumi.Input[str])

  • title (pulumi.Input[str])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.cloudfunctions.FunctionIamPolicy(resource_name, opts=None, cloud_function=None, policy_data=None, project=None, region=None, __props__=None, __name__=None, __opts__=None)

Create a FunctionIamPolicy resource with the given unique name, props, and options.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • cloud_function (pulumi.Input[str]) – Used to find the parent resource to bind the IAM policy to

  • policy_data (pulumi.Input[str]) – The policy data generated by a organizations.getIAMPolicy data source.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.

  • region (pulumi.Input[str]) – The location of this cloud function. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no region is provided in the parent identifier and no region is specified, it is taken from the provider configuration.

cloud_function = None

Used to find the parent resource to bind the IAM policy to

etag = None

(Computed) The etag of the IAM policy.

policy_data = None

The policy data generated by a organizations.getIAMPolicy data source.

project = None

The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.

region = None

The location of this cloud function. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no region is provided in the parent identifier and no region is specified, it is taken from the provider configuration.

static get(resource_name, id, opts=None, cloud_function=None, etag=None, policy_data=None, project=None, region=None)

Get an existing FunctionIamPolicy resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • cloud_function (pulumi.Input[str]) – Used to find the parent resource to bind the IAM policy to

  • etag (pulumi.Input[str]) – (Computed) The etag of the IAM policy.

  • policy_data (pulumi.Input[str]) – The policy data generated by a organizations.getIAMPolicy data source.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.

  • region (pulumi.Input[str]) – The location of this cloud function. Used to find the parent resource to bind the IAM policy to. If not specified, the value will be parsed from the identifier of the parent resource. If no region is provided in the parent identifier and no region is specified, it is taken from the provider configuration.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.cloudfunctions.GetFunctionResult(available_memory_mb=None, description=None, entry_point=None, environment_variables=None, event_triggers=None, https_trigger_url=None, labels=None, max_instances=None, name=None, project=None, region=None, runtime=None, service_account_email=None, source_archive_bucket=None, source_archive_object=None, source_repositories=None, timeout=None, trigger_bucket=None, trigger_http=None, trigger_topic=None, vpc_connector=None, id=None)

A collection of values returned by getFunction.

available_memory_mb = None

Available memory (in MB) to the function.

description = None

Description of the function.

entry_point = None

Name of a JavaScript function that will be executed when the Google Cloud Function is triggered.

event_triggers = None

A source that fires events in response to a condition in another service. Structure is documented below.

https_trigger_url = None

If function is triggered by HTTP, trigger URL is set here.

labels = None

A map of labels applied to this function.

name = None

The name of the Cloud Function.

runtime = None

The runtime in which the function is running.

service_account_email = None

The service account email to be assumed by the cloud function.

source_archive_bucket = None

The GCS bucket containing the zip archive which contains the function.

source_archive_object = None

The source archive object (file) in archive bucket.

timeout = None

Function execution timeout (in seconds).

trigger_http = None

If function is triggered by HTTP, this boolean is set.

id = None

id is the provider-assigned unique ID for this managed resource.

pulumi_gcp.cloudfunctions.get_function(name=None, project=None, region=None, opts=None)

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

Parameters
  • name (str) – The name of a Cloud Function.

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

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