Fork me on GitHub

Module cloudfunctions

@pulumi/gcp > cloudfunctions

Index

cloudfunctions/function.ts cloudfunctions/getFunction.ts

class Function

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

constructor

new Function(name: string, args: FunctionArgs, opts?: pulumi.CustomResourceOptions)

Create a Function resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: FunctionState): Function

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property availableMemoryMb

public availableMemoryMb: pulumi.Output<number | undefined>;

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

property description

public description: pulumi.Output<string | undefined>;

Description of the function.

property entryPoint

public entryPoint: pulumi.Output<string | undefined>;

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

property environmentVariables

public environmentVariables: pulumi.Output<{ ... } | undefined>;

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

property httpsTriggerUrl

public httpsTriggerUrl: pulumi.Output<string>;

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

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property labels

public labels: pulumi.Output<{ ... } | undefined>;

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

property name

public name: pulumi.Output<string>;

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

property project

public project: pulumi.Output<string>;

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

property region

public region: pulumi.Output<string>;

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

property retryOnFailure

public retryOnFailure: pulumi.Output<boolean | undefined>;

Whether the function should be retried on failure. This only applies to bucket and topic triggers, not HTTPS triggers.

property sourceArchiveBucket

public sourceArchiveBucket: pulumi.Output<string>;

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

property sourceArchiveObject

public sourceArchiveObject: pulumi.Output<string>;

The source archive object (file) in archive bucket.

property timeout

public timeout: pulumi.Output<number | undefined>;

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

property triggerBucket

public triggerBucket: pulumi.Output<string | undefined>;

Google Cloud Storage bucket name. Every change in files in this bucket will trigger function execution. Cannot be used with trigger_http and trigger_topic.

property triggerHttp

public triggerHttp: pulumi.Output<boolean | undefined>;

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.

property triggerTopic

public triggerTopic: pulumi.Output<string | undefined>;

Name of Pub/Sub topic. Every message published in this topic will trigger function execution with message contents passed as input data. Cannot be used with trigger_http and trigger_bucket.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

function getFunction

getFunction(args: GetFunctionArgs, opts?: pulumi.InvokeOptions): Promise<GetFunctionResult>

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

interface FunctionArgs

The set of arguments for constructing a Function resource.

property availableMemoryMb

availableMemoryMb?: pulumi.Input<number>;

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

property description

description?: pulumi.Input<string>;

Description of the function.

property entryPoint

entryPoint?: pulumi.Input<string>;

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

property environmentVariables

environmentVariables?: pulumi.Input<{ ... }>;

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

property httpsTriggerUrl

httpsTriggerUrl?: pulumi.Input<string>;

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

property labels

labels?: pulumi.Input<{ ... }>;

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

property name

name?: pulumi.Input<string>;

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

property project

project?: pulumi.Input<string>;

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

property region

region?: pulumi.Input<string>;

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

property retryOnFailure

retryOnFailure?: pulumi.Input<boolean>;

Whether the function should be retried on failure. This only applies to bucket and topic triggers, not HTTPS triggers.

property sourceArchiveBucket

sourceArchiveBucket: pulumi.Input<string>;

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

property sourceArchiveObject

sourceArchiveObject: pulumi.Input<string>;

The source archive object (file) in archive bucket.

property timeout

timeout?: pulumi.Input<number>;

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

property triggerBucket

triggerBucket?: pulumi.Input<string>;

Google Cloud Storage bucket name. Every change in files in this bucket will trigger function execution. Cannot be used with trigger_http and trigger_topic.

property triggerHttp

triggerHttp?: pulumi.Input<boolean>;

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.

property triggerTopic

triggerTopic?: pulumi.Input<string>;

Name of Pub/Sub topic. Every message published in this topic will trigger function execution with message contents passed as input data. Cannot be used with trigger_http and trigger_bucket.

interface FunctionState

Input properties used for looking up and filtering Function resources.

property availableMemoryMb

availableMemoryMb?: pulumi.Input<number>;

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

property description

description?: pulumi.Input<string>;

Description of the function.

property entryPoint

entryPoint?: pulumi.Input<string>;

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

property environmentVariables

environmentVariables?: pulumi.Input<{ ... }>;

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

property httpsTriggerUrl

httpsTriggerUrl?: pulumi.Input<string>;

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

property labels

labels?: pulumi.Input<{ ... }>;

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

property name

name?: pulumi.Input<string>;

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

property project

project?: pulumi.Input<string>;

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

property region

region?: pulumi.Input<string>;

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

property retryOnFailure

retryOnFailure?: pulumi.Input<boolean>;

Whether the function should be retried on failure. This only applies to bucket and topic triggers, not HTTPS triggers.

property sourceArchiveBucket

sourceArchiveBucket?: pulumi.Input<string>;

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

property sourceArchiveObject

sourceArchiveObject?: pulumi.Input<string>;

The source archive object (file) in archive bucket.

property timeout

timeout?: pulumi.Input<number>;

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

property triggerBucket

triggerBucket?: pulumi.Input<string>;

Google Cloud Storage bucket name. Every change in files in this bucket will trigger function execution. Cannot be used with trigger_http and trigger_topic.

property triggerHttp

triggerHttp?: pulumi.Input<boolean>;

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.

property triggerTopic

triggerTopic?: pulumi.Input<string>;

Name of Pub/Sub topic. Every message published in this topic will trigger function execution with message contents passed as input data. Cannot be used with trigger_http and trigger_bucket.

interface GetFunctionArgs

A collection of arguments for invoking getFunction.

property name

name: string;

The name of a Cloud Function.

property project

project?: string;

The project in which the resource belongs. If it is not provided, the provider project is used.

property region

region?: string;

The region in which the resource belongs. If it is not provided, the provider region is used.

interface GetFunctionResult

A collection of values returned by getFunction.

property availableMemoryMb

availableMemoryMb: number;

Available memory (in MB) to the function.

property description

description: string;

Description of the function.

property entryPoint

entryPoint: string;

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

property environmentVariables

environmentVariables: { ... };

property httpsTriggerUrl

httpsTriggerUrl: string;

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

property id

id: string;

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

property labels

labels: { ... };

A map of labels applied to this function.

property retryOnFailure

retryOnFailure: boolean;

property sourceArchiveBucket

sourceArchiveBucket: string;

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

property sourceArchiveObject

sourceArchiveObject: string;

The source archive object (file) in archive bucket.

property timeout

timeout: number;

Function execution timeout (in seconds).

property triggerBucket

triggerBucket: string;

If function is triggered by bucket, bucket name is set here.

property triggerHttp

triggerHttp: boolean;

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

property triggerTopic

triggerTopic: string;

If function is triggered by Pub/Sub topic, name of topic is set here.