gcp.cloudfunctions.getFunction
Get information about a Google Cloud Function. For more information see the official documentation and API.
Example Usage
using System.Collections.Generic;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var my_function = Gcp.CloudFunctions.GetFunction.Invoke(new()
{
Name = "function",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/cloudfunctions"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudfunctions.LookupFunction(ctx, &cloudfunctions.LookupFunctionArgs{
Name: "function",
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.cloudfunctions.CloudfunctionsFunctions;
import com.pulumi.gcp.cloudfunctions.inputs.GetFunctionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var my-function = CloudfunctionsFunctions.getFunction(GetFunctionArgs.builder()
.name("function")
.build());
}
}
import pulumi
import pulumi_gcp as gcp
my_function = gcp.cloudfunctions.get_function(name="function")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const my-function = gcp.cloudfunctions.getFunction({
name: "function",
});
variables:
my-function:
fn::invoke:
Function: gcp:cloudfunctions:getFunction
Arguments:
name: function
Using getFunction
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getFunction(args: GetFunctionArgs, opts?: InvokeOptions): Promise<GetFunctionResult>
function getFunctionOutput(args: GetFunctionOutputArgs, opts?: InvokeOptions): Output<GetFunctionResult>
def get_function(name: Optional[str] = None,
project: Optional[str] = None,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetFunctionResult
def get_function_output(name: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetFunctionResult]
func LookupFunction(ctx *Context, args *LookupFunctionArgs, opts ...InvokeOption) (*LookupFunctionResult, error)
func LookupFunctionOutput(ctx *Context, args *LookupFunctionOutputArgs, opts ...InvokeOption) LookupFunctionResultOutput
> Note: This function is named LookupFunction
in the Go SDK.
public static class GetFunction
{
public static Task<GetFunctionResult> InvokeAsync(GetFunctionArgs args, InvokeOptions? opts = null)
public static Output<GetFunctionResult> Invoke(GetFunctionInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetFunctionResult> getFunction(GetFunctionArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:cloudfunctions/getFunction:getFunction
arguments:
# arguments dictionary
The following arguments are supported:
getFunction Result
The following output properties are available:
- Available
Memory intMb Available memory (in MB) to the function.
- Build
Environment Dictionary<string, object>Variables - Build
Worker stringPool - Description string
Description of the function.
- Docker
Registry string - Docker
Repository string - Entry
Point string Name of a JavaScript function that will be executed when the Google Cloud Function is triggered.
- Environment
Variables Dictionary<string, object> - Event
Triggers List<GetFunction Event Trigger> A source that fires events in response to a condition in another service. Structure is documented below.
- Https
Trigger stringSecurity Level - Https
Trigger stringUrl If function is triggered by HTTP, trigger URL is set here.
- Id string
The provider-assigned unique ID for this managed resource.
- Ingress
Settings string Controls what traffic can reach the function.
- Kms
Key stringName - Labels Dictionary<string, object>
A map of labels applied to this function.
- Max
Instances int The limit on the maximum number of function instances that may coexist at a given time.
- Min
Instances int - Name string
The name of the Cloud Function.
- Runtime string
The runtime in which the function is running.
- Secret
Environment List<GetVariables Function Secret Environment Variable> - Secret
Volumes List<GetFunction Secret Volume> - Service
Account stringEmail The service account email to be assumed by the cloud function.
- Source
Archive stringBucket The GCS bucket containing the zip archive which contains the function.
- Source
Archive stringObject The source archive object (file) in archive bucket.
- Source
Repositories List<GetFunction Source Repository> The URL of the Cloud Source Repository that the function is deployed from. Structure is documented below.
- Timeout int
Function execution timeout (in seconds).
- Trigger
Http bool If function is triggered by HTTP, this boolean is set.
- Vpc
Connector string The VPC Network Connector that this cloud function can connect to.
- Vpc
Connector stringEgress Settings The egress settings for the connector, controlling what traffic is diverted through it.
- Project string
- Region string
- Available
Memory intMb Available memory (in MB) to the function.
- Build
Environment map[string]interface{}Variables - Build
Worker stringPool - Description string
Description of the function.
- Docker
Registry string - Docker
Repository string - Entry
Point string Name of a JavaScript function that will be executed when the Google Cloud Function is triggered.
- Environment
Variables map[string]interface{} - Event
Triggers []GetFunction Event Trigger A source that fires events in response to a condition in another service. Structure is documented below.
- Https
Trigger stringSecurity Level - Https
Trigger stringUrl If function is triggered by HTTP, trigger URL is set here.
- Id string
The provider-assigned unique ID for this managed resource.
- Ingress
Settings string Controls what traffic can reach the function.
- Kms
Key stringName - Labels map[string]interface{}
A map of labels applied to this function.
- Max
Instances int The limit on the maximum number of function instances that may coexist at a given time.
- Min
Instances int - Name string
The name of the Cloud Function.
- Runtime string
The runtime in which the function is running.
- Secret
Environment []GetVariables Function Secret Environment Variable - Secret
Volumes []GetFunction Secret Volume - Service
Account stringEmail The service account email to be assumed by the cloud function.
- Source
Archive stringBucket The GCS bucket containing the zip archive which contains the function.
- Source
Archive stringObject The source archive object (file) in archive bucket.
- Source
Repositories []GetFunction Source Repository The URL of the Cloud Source Repository that the function is deployed from. Structure is documented below.
- Timeout int
Function execution timeout (in seconds).
- Trigger
Http bool If function is triggered by HTTP, this boolean is set.
- Vpc
Connector string The VPC Network Connector that this cloud function can connect to.
- Vpc
Connector stringEgress Settings The egress settings for the connector, controlling what traffic is diverted through it.
- Project string
- Region string
- available
Memory IntegerMb Available memory (in MB) to the function.
- build
Environment Map<String,Object>Variables - build
Worker StringPool - description String
Description of the function.
- docker
Registry String - docker
Repository String - entry
Point String Name of a JavaScript function that will be executed when the Google Cloud Function is triggered.
- environment
Variables Map<String,Object> - event
Triggers List<GetFunction Event Trigger> A source that fires events in response to a condition in another service. Structure is documented below.
- https
Trigger StringSecurity Level - https
Trigger StringUrl If function is triggered by HTTP, trigger URL is set here.
- id String
The provider-assigned unique ID for this managed resource.
- ingress
Settings String Controls what traffic can reach the function.
- kms
Key StringName - labels Map<String,Object>
A map of labels applied to this function.
- max
Instances Integer The limit on the maximum number of function instances that may coexist at a given time.
- min
Instances Integer - name String
The name of the Cloud Function.
- runtime String
The runtime in which the function is running.
- secret
Environment List<GetVariables Function Secret Environment Variable> - secret
Volumes List<GetFunction Secret Volume> - service
Account StringEmail The service account email to be assumed by the cloud function.
- source
Archive StringBucket The GCS bucket containing the zip archive which contains the function.
- source
Archive StringObject The source archive object (file) in archive bucket.
- source
Repositories List<GetFunction Source Repository> The URL of the Cloud Source Repository that the function is deployed from. Structure is documented below.
- timeout Integer
Function execution timeout (in seconds).
- trigger
Http Boolean If function is triggered by HTTP, this boolean is set.
- vpc
Connector String The VPC Network Connector that this cloud function can connect to.
- vpc
Connector StringEgress Settings The egress settings for the connector, controlling what traffic is diverted through it.
- project String
- region String
- available
Memory numberMb Available memory (in MB) to the function.
- build
Environment {[key: string]: any}Variables - build
Worker stringPool - description string
Description of the function.
- docker
Registry string - docker
Repository string - entry
Point string Name of a JavaScript function that will be executed when the Google Cloud Function is triggered.
- environment
Variables {[key: string]: any} - event
Triggers GetFunction Event Trigger[] A source that fires events in response to a condition in another service. Structure is documented below.
- https
Trigger stringSecurity Level - https
Trigger stringUrl If function is triggered by HTTP, trigger URL is set here.
- id string
The provider-assigned unique ID for this managed resource.
- ingress
Settings string Controls what traffic can reach the function.
- kms
Key stringName - labels {[key: string]: any}
A map of labels applied to this function.
- max
Instances number The limit on the maximum number of function instances that may coexist at a given time.
- min
Instances number - name string
The name of the Cloud Function.
- runtime string
The runtime in which the function is running.
- secret
Environment GetVariables Function Secret Environment Variable[] - secret
Volumes GetFunction Secret Volume[] - service
Account stringEmail The service account email to be assumed by the cloud function.
- source
Archive stringBucket The GCS bucket containing the zip archive which contains the function.
- source
Archive stringObject The source archive object (file) in archive bucket.
- source
Repositories GetFunction Source Repository[] The URL of the Cloud Source Repository that the function is deployed from. Structure is documented below.
- timeout number
Function execution timeout (in seconds).
- trigger
Http boolean If function is triggered by HTTP, this boolean is set.
- vpc
Connector string The VPC Network Connector that this cloud function can connect to.
- vpc
Connector stringEgress Settings The egress settings for the connector, controlling what traffic is diverted through it.
- project string
- region string
- available_
memory_ intmb Available memory (in MB) to the function.
- build_
environment_ Mapping[str, Any]variables - build_
worker_ strpool - description str
Description of the function.
- docker_
registry str - docker_
repository str - entry_
point str Name of a JavaScript function that will be executed when the Google Cloud Function is triggered.
- environment_
variables Mapping[str, Any] - event_
triggers Sequence[GetFunction Event Trigger] A source that fires events in response to a condition in another service. Structure is documented below.
- https_
trigger_ strsecurity_ level - https_
trigger_ strurl If function is triggered by HTTP, trigger URL is set here.
- id str
The provider-assigned unique ID for this managed resource.
- ingress_
settings str Controls what traffic can reach the function.
- kms_
key_ strname - labels Mapping[str, Any]
A map of labels applied to this function.
- max_
instances int The limit on the maximum number of function instances that may coexist at a given time.
- min_
instances int - name str
The name of the Cloud Function.
- runtime str
The runtime in which the function is running.
- secret_
environment_ Sequence[Getvariables Function Secret Environment Variable] - secret_
volumes Sequence[GetFunction Secret Volume] - service_
account_ stremail The service account email to be assumed by the cloud function.
- source_
archive_ strbucket The GCS bucket containing the zip archive which contains the function.
- source_
archive_ strobject The source archive object (file) in archive bucket.
- source_
repositories Sequence[GetFunction Source Repository] The URL of the Cloud Source Repository that the function is deployed from. Structure is documented below.
- timeout int
Function execution timeout (in seconds).
- trigger_
http bool If function is triggered by HTTP, this boolean is set.
- vpc_
connector str The VPC Network Connector that this cloud function can connect to.
- vpc_
connector_ stregress_ settings The egress settings for the connector, controlling what traffic is diverted through it.
- project str
- region str
- available
Memory NumberMb Available memory (in MB) to the function.
- build
Environment Map<Any>Variables - build
Worker StringPool - description String
Description of the function.
- docker
Registry String - docker
Repository String - entry
Point String Name of a JavaScript function that will be executed when the Google Cloud Function is triggered.
- environment
Variables Map<Any> - event
Triggers List<Property Map> A source that fires events in response to a condition in another service. Structure is documented below.
- https
Trigger StringSecurity Level - https
Trigger StringUrl If function is triggered by HTTP, trigger URL is set here.
- id String
The provider-assigned unique ID for this managed resource.
- ingress
Settings String Controls what traffic can reach the function.
- kms
Key StringName - labels Map<Any>
A map of labels applied to this function.
- max
Instances Number The limit on the maximum number of function instances that may coexist at a given time.
- min
Instances Number - name String
The name of the Cloud Function.
- runtime String
The runtime in which the function is running.
- secret
Environment List<Property Map>Variables - secret
Volumes List<Property Map> - service
Account StringEmail The service account email to be assumed by the cloud function.
- source
Archive StringBucket The GCS bucket containing the zip archive which contains the function.
- source
Archive StringObject The source archive object (file) in archive bucket.
- source
Repositories List<Property Map> The URL of the Cloud Source Repository that the function is deployed from. Structure is documented below.
- timeout Number
Function execution timeout (in seconds).
- trigger
Http Boolean If function is triggered by HTTP, this boolean is set.
- vpc
Connector String The VPC Network Connector that this cloud function can connect to.
- vpc
Connector StringEgress Settings The egress settings for the connector, controlling what traffic is diverted through it.
- project String
- region String
Supporting Types
GetFunctionEventTrigger
- Event
Type string The type of event to observe. For example:
"google.storage.object.finalize"
. See the documentation on calling Cloud Functions for a full reference of accepted triggers.- Failure
Policies List<GetFunction Event Trigger Failure Policy> Policy for failed executions. Structure is documented below.
- Resource string
The name of the resource whose events are being observed, for example,
"myBucket"
- Event
Type string The type of event to observe. For example:
"google.storage.object.finalize"
. See the documentation on calling Cloud Functions for a full reference of accepted triggers.- Failure
Policies []GetFunction Event Trigger Failure Policy Policy for failed executions. Structure is documented below.
- Resource string
The name of the resource whose events are being observed, for example,
"myBucket"
- event
Type String The type of event to observe. For example:
"google.storage.object.finalize"
. See the documentation on calling Cloud Functions for a full reference of accepted triggers.- failure
Policies List<GetFunction Event Trigger Failure Policy> Policy for failed executions. Structure is documented below.
- resource String
The name of the resource whose events are being observed, for example,
"myBucket"
- event
Type string The type of event to observe. For example:
"google.storage.object.finalize"
. See the documentation on calling Cloud Functions for a full reference of accepted triggers.- failure
Policies GetFunction Event Trigger Failure Policy[] Policy for failed executions. Structure is documented below.
- resource string
The name of the resource whose events are being observed, for example,
"myBucket"
- event_
type str The type of event to observe. For example:
"google.storage.object.finalize"
. See the documentation on calling Cloud Functions for a full reference of accepted triggers.- failure_
policies Sequence[GetFunction Event Trigger Failure Policy] Policy for failed executions. Structure is documented below.
- resource str
The name of the resource whose events are being observed, for example,
"myBucket"
- event
Type String The type of event to observe. For example:
"google.storage.object.finalize"
. See the documentation on calling Cloud Functions for a full reference of accepted triggers.- failure
Policies List<Property Map> Policy for failed executions. Structure is documented below.
- resource String
The name of the resource whose events are being observed, for example,
"myBucket"
GetFunctionEventTriggerFailurePolicy
- Retry bool
Whether the function should be retried on failure.
- Retry bool
Whether the function should be retried on failure.
- retry Boolean
Whether the function should be retried on failure.
- retry boolean
Whether the function should be retried on failure.
- retry bool
Whether the function should be retried on failure.
- retry Boolean
Whether the function should be retried on failure.
GetFunctionSecretEnvironmentVariable
- key str
- project_
id str - secret str
- version str
GetFunctionSecretVolume
- Mount
Path string - Project
Id string - Secret string
- Versions
List<Get
Function Secret Volume Version>
- Mount
Path string - Project
Id string - Secret string
- Versions
[]Get
Function Secret Volume Version
- mount
Path String - project
Id String - secret String
- versions
List<Get
Function Secret Volume Version>
- mount
Path string - project
Id string - secret string
- versions
Get
Function Secret Volume Version[]
- mount
Path String - project
Id String - secret String
- versions List<Property Map>
GetFunctionSecretVolumeVersion
GetFunctionSourceRepository
- Deployed
Url string - Url string
The URL pointing to the hosted repository where the function is defined.
- Deployed
Url string - Url string
The URL pointing to the hosted repository where the function is defined.
- deployed
Url String - url String
The URL pointing to the hosted repository where the function is defined.
- deployed
Url string - url string
The URL pointing to the hosted repository where the function is defined.
- deployed_
url str - url str
The URL pointing to the hosted repository where the function is defined.
- deployed
Url String - url String
The URL pointing to the hosted repository where the function is defined.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
google-beta
Terraform Provider.