gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core
gcore.getFaasFunction
Explore with Pulumi AI
Represent FaaS function
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
const pr = gcore.getProject({
name: "test",
});
const rg = gcore.getRegion({
name: "ED-10 Preprod",
});
const hello_world = Promise.all([rg, pr]).then(([rg, pr]) => gcore.getFaasFunction({
name: "hello-world",
namespace: "world-ns",
regionId: rg.id,
projectId: pr.id,
}));
export const view = hello_world;
import pulumi
import pulumi_gcore as gcore
pr = gcore.get_project(name="test")
rg = gcore.get_region(name="ED-10 Preprod")
hello_world = gcore.get_faas_function(name="hello-world",
namespace="world-ns",
region_id=rg.id,
project_id=pr.id)
pulumi.export("view", hello_world)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
pr, err := gcore.GetProject(ctx, &gcore.GetProjectArgs{
Name: "test",
}, nil)
if err != nil {
return err
}
rg, err := gcore.GetRegion(ctx, &gcore.GetRegionArgs{
Name: "ED-10 Preprod",
}, nil)
if err != nil {
return err
}
hello_world, err := gcore.LookupFaasFunction(ctx, &gcore.LookupFaasFunctionArgs{
Name: "hello-world",
Namespace: "world-ns",
RegionId: pulumi.Float64Ref(rg.Id),
ProjectId: pulumi.Float64Ref(pr.Id),
}, nil)
if err != nil {
return err
}
ctx.Export("view", hello_world)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;
return await Deployment.RunAsync(() =>
{
var pr = Gcore.GetProject.Invoke(new()
{
Name = "test",
});
var rg = Gcore.GetRegion.Invoke(new()
{
Name = "ED-10 Preprod",
});
var hello_world = Gcore.GetFaasFunction.Invoke(new()
{
Name = "hello-world",
Namespace = "world-ns",
RegionId = rg.Apply(getRegionResult => getRegionResult.Id),
ProjectId = pr.Apply(getProjectResult => getProjectResult.Id),
});
return new Dictionary<string, object?>
{
["view"] = hello_world,
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.GcoreFunctions;
import com.pulumi.gcore.inputs.GetProjectArgs;
import com.pulumi.gcore.inputs.GetRegionArgs;
import com.pulumi.gcore.inputs.GetFaasFunctionArgs;
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 pr = GcoreFunctions.getProject(GetProjectArgs.builder()
.name("test")
.build());
final var rg = GcoreFunctions.getRegion(GetRegionArgs.builder()
.name("ED-10 Preprod")
.build());
final var hello-world = GcoreFunctions.getFaasFunction(GetFaasFunctionArgs.builder()
.name("hello-world")
.namespace("world-ns")
.regionId(rg.applyValue(getRegionResult -> getRegionResult.id()))
.projectId(pr.applyValue(getProjectResult -> getProjectResult.id()))
.build());
ctx.export("view", hello_world);
}
}
variables:
pr:
fn::invoke:
function: gcore:getProject
arguments:
name: test
rg:
fn::invoke:
function: gcore:getRegion
arguments:
name: ED-10 Preprod
hello-world:
fn::invoke:
function: gcore:getFaasFunction
arguments:
name: hello-world
namespace: world-ns
regionId: ${rg.id}
projectId: ${pr.id}
outputs:
view: ${["hello-world"]}
Using getFaasFunction
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 getFaasFunction(args: GetFaasFunctionArgs, opts?: InvokeOptions): Promise<GetFaasFunctionResult>
function getFaasFunctionOutput(args: GetFaasFunctionOutputArgs, opts?: InvokeOptions): Output<GetFaasFunctionResult>
def get_faas_function(id: Optional[str] = None,
name: Optional[str] = None,
namespace: Optional[str] = None,
project_id: Optional[float] = None,
project_name: Optional[str] = None,
region_id: Optional[float] = None,
region_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetFaasFunctionResult
def get_faas_function_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
namespace: Optional[pulumi.Input[str]] = None,
project_id: Optional[pulumi.Input[float]] = None,
project_name: Optional[pulumi.Input[str]] = None,
region_id: Optional[pulumi.Input[float]] = None,
region_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetFaasFunctionResult]
func LookupFaasFunction(ctx *Context, args *LookupFaasFunctionArgs, opts ...InvokeOption) (*LookupFaasFunctionResult, error)
func LookupFaasFunctionOutput(ctx *Context, args *LookupFaasFunctionOutputArgs, opts ...InvokeOption) LookupFaasFunctionResultOutput
> Note: This function is named LookupFaasFunction
in the Go SDK.
public static class GetFaasFunction
{
public static Task<GetFaasFunctionResult> InvokeAsync(GetFaasFunctionArgs args, InvokeOptions? opts = null)
public static Output<GetFaasFunctionResult> Invoke(GetFaasFunctionInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetFaasFunctionResult> getFaasFunction(GetFaasFunctionArgs args, InvokeOptions options)
public static Output<GetFaasFunctionResult> getFaasFunction(GetFaasFunctionArgs args, InvokeOptions options)
fn::invoke:
function: gcore:index/getFaasFunction:getFaasFunction
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- Namespace string
- Namespace of the function
- Id string
- The ID of this resource.
- Project
Id double - Project
Name string - Region
Id double - Region
Name string
- Name string
- Namespace string
- Namespace of the function
- Id string
- The ID of this resource.
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string
- name String
- namespace String
- Namespace of the function
- id String
- The ID of this resource.
- project
Id Double - project
Name String - region
Id Double - region
Name String
- name string
- namespace string
- Namespace of the function
- id string
- The ID of this resource.
- project
Id number - project
Name string - region
Id number - region
Name string
- name str
- namespace str
- Namespace of the function
- id str
- The ID of this resource.
- project_
id float - project_
name str - region_
id float - region_
name str
- name String
- namespace String
- Namespace of the function
- id String
- The ID of this resource.
- project
Id Number - project
Name String - region
Id Number - region
Name String
getFaasFunction Result
The following output properties are available:
- Build
Message string - Build
Status string - Code
Text string - Created
At string - Dependencies string
- Function dependencies to install
- Deploy
Status Dictionary<string, double> - Description string
- Disabled bool
- Set to true if function is disabled
- Enable
Api boolKey - Enable/Disable api key authorization
- Endpoint string
- Envs Dictionary<string, string>
- Flavor string
- Id string
- The ID of this resource.
- Keys List<string>
- List of used api keys
- Main
Method string - Main startup method name
- Max
Instances double - Autoscaling max number of instances
- Min
Instances double - Autoscaling min number of instances
- Name string
- Namespace string
- Namespace of the function
- Runtime string
- Status string
- Timeout double
- Project
Id double - Project
Name string - Region
Id double - Region
Name string
- Build
Message string - Build
Status string - Code
Text string - Created
At string - Dependencies string
- Function dependencies to install
- Deploy
Status map[string]float64 - Description string
- Disabled bool
- Set to true if function is disabled
- Enable
Api boolKey - Enable/Disable api key authorization
- Endpoint string
- Envs map[string]string
- Flavor string
- Id string
- The ID of this resource.
- Keys []string
- List of used api keys
- Main
Method string - Main startup method name
- Max
Instances float64 - Autoscaling max number of instances
- Min
Instances float64 - Autoscaling min number of instances
- Name string
- Namespace string
- Namespace of the function
- Runtime string
- Status string
- Timeout float64
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string
- build
Message String - build
Status String - code
Text String - created
At String - dependencies String
- Function dependencies to install
- deploy
Status Map<String,Double> - description String
- disabled Boolean
- Set to true if function is disabled
- enable
Api BooleanKey - Enable/Disable api key authorization
- endpoint String
- envs Map<String,String>
- flavor String
- id String
- The ID of this resource.
- keys List<String>
- List of used api keys
- main
Method String - Main startup method name
- max
Instances Double - Autoscaling max number of instances
- min
Instances Double - Autoscaling min number of instances
- name String
- namespace String
- Namespace of the function
- runtime String
- status String
- timeout Double
- project
Id Double - project
Name String - region
Id Double - region
Name String
- build
Message string - build
Status string - code
Text string - created
At string - dependencies string
- Function dependencies to install
- deploy
Status {[key: string]: number} - description string
- disabled boolean
- Set to true if function is disabled
- enable
Api booleanKey - Enable/Disable api key authorization
- endpoint string
- envs {[key: string]: string}
- flavor string
- id string
- The ID of this resource.
- keys string[]
- List of used api keys
- main
Method string - Main startup method name
- max
Instances number - Autoscaling max number of instances
- min
Instances number - Autoscaling min number of instances
- name string
- namespace string
- Namespace of the function
- runtime string
- status string
- timeout number
- project
Id number - project
Name string - region
Id number - region
Name string
- build_
message str - build_
status str - code_
text str - created_
at str - dependencies str
- Function dependencies to install
- deploy_
status Mapping[str, float] - description str
- disabled bool
- Set to true if function is disabled
- enable_
api_ boolkey - Enable/Disable api key authorization
- endpoint str
- envs Mapping[str, str]
- flavor str
- id str
- The ID of this resource.
- keys Sequence[str]
- List of used api keys
- main_
method str - Main startup method name
- max_
instances float - Autoscaling max number of instances
- min_
instances float - Autoscaling min number of instances
- name str
- namespace str
- Namespace of the function
- runtime str
- status str
- timeout float
- project_
id float - project_
name str - region_
id float - region_
name str
- build
Message String - build
Status String - code
Text String - created
At String - dependencies String
- Function dependencies to install
- deploy
Status Map<Number> - description String
- disabled Boolean
- Set to true if function is disabled
- enable
Api BooleanKey - Enable/Disable api key authorization
- endpoint String
- envs Map<String>
- flavor String
- id String
- The ID of this resource.
- keys List<String>
- List of used api keys
- main
Method String - Main startup method name
- max
Instances Number - Autoscaling max number of instances
- min
Instances Number - Autoscaling min number of instances
- name String
- namespace String
- Namespace of the function
- runtime String
- status String
- timeout Number
- project
Id Number - project
Name String - region
Id Number - region
Name String
Package Details
- Repository
- gcore g-core/terraform-provider-gcore
- License
- Notes
- This Pulumi package is based on the
gcore
Terraform Provider.