1. Packages
  2. Gcore Provider
  3. API Docs
  4. getFaasFunction
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

gcore.getFaasFunction

Explore with Pulumi AI

gcore logo
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

    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.
    ProjectId double
    ProjectName string
    RegionId double
    RegionName string
    Name string
    Namespace string
    Namespace of the function
    Id string
    The ID of this resource.
    ProjectId float64
    ProjectName string
    RegionId float64
    RegionName string
    name String
    namespace String
    Namespace of the function
    id String
    The ID of this resource.
    projectId Double
    projectName String
    regionId Double
    regionName String
    name string
    namespace string
    Namespace of the function
    id string
    The ID of this resource.
    projectId number
    projectName string
    regionId number
    regionName 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.
    projectId Number
    projectName String
    regionId Number
    regionName String

    getFaasFunction Result

    The following output properties are available:

    BuildMessage string
    BuildStatus string
    CodeText string
    CreatedAt string
    Dependencies string
    Function dependencies to install
    DeployStatus Dictionary<string, double>
    Description string
    Disabled bool
    Set to true if function is disabled
    EnableApiKey bool
    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
    MainMethod string
    Main startup method name
    MaxInstances double
    Autoscaling max number of instances
    MinInstances double
    Autoscaling min number of instances
    Name string
    Namespace string
    Namespace of the function
    Runtime string
    Status string
    Timeout double
    ProjectId double
    ProjectName string
    RegionId double
    RegionName string
    BuildMessage string
    BuildStatus string
    CodeText string
    CreatedAt string
    Dependencies string
    Function dependencies to install
    DeployStatus map[string]float64
    Description string
    Disabled bool
    Set to true if function is disabled
    EnableApiKey bool
    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
    MainMethod string
    Main startup method name
    MaxInstances float64
    Autoscaling max number of instances
    MinInstances float64
    Autoscaling min number of instances
    Name string
    Namespace string
    Namespace of the function
    Runtime string
    Status string
    Timeout float64
    ProjectId float64
    ProjectName string
    RegionId float64
    RegionName string
    buildMessage String
    buildStatus String
    codeText String
    createdAt String
    dependencies String
    Function dependencies to install
    deployStatus Map<String,Double>
    description String
    disabled Boolean
    Set to true if function is disabled
    enableApiKey Boolean
    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
    mainMethod String
    Main startup method name
    maxInstances Double
    Autoscaling max number of instances
    minInstances Double
    Autoscaling min number of instances
    name String
    namespace String
    Namespace of the function
    runtime String
    status String
    timeout Double
    projectId Double
    projectName String
    regionId Double
    regionName String
    buildMessage string
    buildStatus string
    codeText string
    createdAt string
    dependencies string
    Function dependencies to install
    deployStatus {[key: string]: number}
    description string
    disabled boolean
    Set to true if function is disabled
    enableApiKey boolean
    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
    mainMethod string
    Main startup method name
    maxInstances number
    Autoscaling max number of instances
    minInstances number
    Autoscaling min number of instances
    name string
    namespace string
    Namespace of the function
    runtime string
    status string
    timeout number
    projectId number
    projectName string
    regionId number
    regionName 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_key bool
    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
    buildMessage String
    buildStatus String
    codeText String
    createdAt String
    dependencies String
    Function dependencies to install
    deployStatus Map<Number>
    description String
    disabled Boolean
    Set to true if function is disabled
    enableApiKey Boolean
    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
    mainMethod String
    Main startup method name
    maxInstances Number
    Autoscaling max number of instances
    minInstances Number
    Autoscaling min number of instances
    name String
    namespace String
    Namespace of the function
    runtime String
    status String
    timeout Number
    projectId Number
    projectName String
    regionId Number
    regionName String

    Package Details

    Repository
    gcore g-core/terraform-provider-gcore
    License
    Notes
    This Pulumi package is based on the gcore Terraform Provider.
    gcore logo
    gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core