1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. fc
  5. getFunctions
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.fc.getFunctions

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the Function Compute functions of the current Alibaba Cloud user.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const functionsDs = alicloud.fc.getFunctions({
        serviceName: "sample_service",
        nameRegex: "sample_fc_function",
    });
    export const firstFcFunctionName = functionsDs.then(functionsDs => functionsDs.functions?.[0]?.name);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    functions_ds = alicloud.fc.get_functions(service_name="sample_service",
        name_regex="sample_fc_function")
    pulumi.export("firstFcFunctionName", functions_ds.functions[0].name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/fc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		functionsDs, err := fc.GetFunctions(ctx, &fc.GetFunctionsArgs{
    			ServiceName: "sample_service",
    			NameRegex:   pulumi.StringRef("sample_fc_function"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstFcFunctionName", functionsDs.Functions[0].Name)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var functionsDs = AliCloud.FC.GetFunctions.Invoke(new()
        {
            ServiceName = "sample_service",
            NameRegex = "sample_fc_function",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstFcFunctionName"] = functionsDs.Apply(getFunctionsResult => getFunctionsResult.Functions[0]?.Name),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.fc.FcFunctions;
    import com.pulumi.alicloud.fc.inputs.GetFunctionsArgs;
    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 functionsDs = FcFunctions.getFunctions(GetFunctionsArgs.builder()
                .serviceName("sample_service")
                .nameRegex("sample_fc_function")
                .build());
    
            ctx.export("firstFcFunctionName", functionsDs.applyValue(getFunctionsResult -> getFunctionsResult.functions()[0].name()));
        }
    }
    
    variables:
      functionsDs:
        fn::invoke:
          Function: alicloud:fc:getFunctions
          Arguments:
            serviceName: sample_service
            nameRegex: sample_fc_function
    outputs:
      firstFcFunctionName: ${functionsDs.functions[0].name}
    

    Using getFunctions

    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 getFunctions(args: GetFunctionsArgs, opts?: InvokeOptions): Promise<GetFunctionsResult>
    function getFunctionsOutput(args: GetFunctionsOutputArgs, opts?: InvokeOptions): Output<GetFunctionsResult>
    def get_functions(ids: Optional[Sequence[str]] = None,
                      name_regex: Optional[str] = None,
                      output_file: Optional[str] = None,
                      service_name: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetFunctionsResult
    def get_functions_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      name_regex: Optional[pulumi.Input[str]] = None,
                      output_file: Optional[pulumi.Input[str]] = None,
                      service_name: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetFunctionsResult]
    func GetFunctions(ctx *Context, args *GetFunctionsArgs, opts ...InvokeOption) (*GetFunctionsResult, error)
    func GetFunctionsOutput(ctx *Context, args *GetFunctionsOutputArgs, opts ...InvokeOption) GetFunctionsResultOutput

    > Note: This function is named GetFunctions in the Go SDK.

    public static class GetFunctions 
    {
        public static Task<GetFunctionsResult> InvokeAsync(GetFunctionsArgs args, InvokeOptions? opts = null)
        public static Output<GetFunctionsResult> Invoke(GetFunctionsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetFunctionsResult> getFunctions(GetFunctionsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:fc/getFunctions:getFunctions
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ServiceName string
    Name of the service that contains the functions to find.
    Ids List<string>
    A list of functions ids.
    NameRegex string
    A regex string to filter results by function name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ServiceName string
    Name of the service that contains the functions to find.
    Ids []string
    A list of functions ids.
    NameRegex string
    A regex string to filter results by function name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    serviceName String
    Name of the service that contains the functions to find.
    ids List<String>
    A list of functions ids.
    nameRegex String
    A regex string to filter results by function name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    serviceName string
    Name of the service that contains the functions to find.
    ids string[]
    A list of functions ids.
    nameRegex string
    A regex string to filter results by function name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    service_name str
    Name of the service that contains the functions to find.
    ids Sequence[str]
    A list of functions ids.
    name_regex str
    A regex string to filter results by function name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    serviceName String
    Name of the service that contains the functions to find.
    ids List<String>
    A list of functions ids.
    nameRegex String
    A regex string to filter results by function name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getFunctions Result

    The following output properties are available:

    Functions List<Pulumi.AliCloud.FC.Outputs.GetFunctionsFunction>
    A list of functions. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of functions ids.
    Names List<string>
    A list of functions names.
    ServiceName string
    NameRegex string
    OutputFile string
    Functions []GetFunctionsFunction
    A list of functions. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of functions ids.
    Names []string
    A list of functions names.
    ServiceName string
    NameRegex string
    OutputFile string
    functions List<GetFunctionsFunction>
    A list of functions. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of functions ids.
    names List<String>
    A list of functions names.
    serviceName String
    nameRegex String
    outputFile String
    functions GetFunctionsFunction[]
    A list of functions. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of functions ids.
    names string[]
    A list of functions names.
    serviceName string
    nameRegex string
    outputFile string
    functions Sequence[GetFunctionsFunction]
    A list of functions. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of functions ids.
    names Sequence[str]
    A list of functions names.
    service_name str
    name_regex str
    output_file str
    functions List<Property Map>
    A list of functions. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of functions ids.
    names List<String>
    A list of functions names.
    serviceName String
    nameRegex String
    outputFile String

    Supporting Types

    GetFunctionsFunction

    CaPort int
    The port that the function listen to, only valid for custom runtime and custom container runtime.
    CodeChecksum string
    Checksum (crc64) of the function code.
    CodeSize int
    Function code size in bytes.
    CreationTime string
    Function creation time.
    Description string
    Function description.
    EnvironmentVariables Dictionary<string, string>
    A map that defines environment variables for the function.
    Handler string
    Function entry point in the code.
    Id string
    Function ID.
    InitializationTimeout int
    The maximum length of time, in seconds, that the function's initialization should be run for.
    Initializer string
    The entry point of the function's initialization.
    InstanceConcurrency int
    The maximum number of requests can be executed concurrently within the single function instance.
    InstanceType string
    The instance type of the function.
    LastModificationTime string
    Function last modification time.
    MemorySize int
    Amount of memory in MB the function can use at runtime.
    Name string
    Function name.
    Runtime string
    Function runtime. The list of possible values is available here.
    Timeout int
    Maximum amount of time the function can run in seconds.
    CustomContainerConfig Pulumi.AliCloud.FC.Inputs.GetFunctionsFunctionCustomContainerConfig
    The configuration for custom container runtime. It contains following attributes:
    CaPort int
    The port that the function listen to, only valid for custom runtime and custom container runtime.
    CodeChecksum string
    Checksum (crc64) of the function code.
    CodeSize int
    Function code size in bytes.
    CreationTime string
    Function creation time.
    Description string
    Function description.
    EnvironmentVariables map[string]string
    A map that defines environment variables for the function.
    Handler string
    Function entry point in the code.
    Id string
    Function ID.
    InitializationTimeout int
    The maximum length of time, in seconds, that the function's initialization should be run for.
    Initializer string
    The entry point of the function's initialization.
    InstanceConcurrency int
    The maximum number of requests can be executed concurrently within the single function instance.
    InstanceType string
    The instance type of the function.
    LastModificationTime string
    Function last modification time.
    MemorySize int
    Amount of memory in MB the function can use at runtime.
    Name string
    Function name.
    Runtime string
    Function runtime. The list of possible values is available here.
    Timeout int
    Maximum amount of time the function can run in seconds.
    CustomContainerConfig GetFunctionsFunctionCustomContainerConfig
    The configuration for custom container runtime. It contains following attributes:
    caPort Integer
    The port that the function listen to, only valid for custom runtime and custom container runtime.
    codeChecksum String
    Checksum (crc64) of the function code.
    codeSize Integer
    Function code size in bytes.
    creationTime String
    Function creation time.
    description String
    Function description.
    environmentVariables Map<String,String>
    A map that defines environment variables for the function.
    handler String
    Function entry point in the code.
    id String
    Function ID.
    initializationTimeout Integer
    The maximum length of time, in seconds, that the function's initialization should be run for.
    initializer String
    The entry point of the function's initialization.
    instanceConcurrency Integer
    The maximum number of requests can be executed concurrently within the single function instance.
    instanceType String
    The instance type of the function.
    lastModificationTime String
    Function last modification time.
    memorySize Integer
    Amount of memory in MB the function can use at runtime.
    name String
    Function name.
    runtime String
    Function runtime. The list of possible values is available here.
    timeout Integer
    Maximum amount of time the function can run in seconds.
    customContainerConfig GetFunctionsFunctionCustomContainerConfig
    The configuration for custom container runtime. It contains following attributes:
    caPort number
    The port that the function listen to, only valid for custom runtime and custom container runtime.
    codeChecksum string
    Checksum (crc64) of the function code.
    codeSize number
    Function code size in bytes.
    creationTime string
    Function creation time.
    description string
    Function description.
    environmentVariables {[key: string]: string}
    A map that defines environment variables for the function.
    handler string
    Function entry point in the code.
    id string
    Function ID.
    initializationTimeout number
    The maximum length of time, in seconds, that the function's initialization should be run for.
    initializer string
    The entry point of the function's initialization.
    instanceConcurrency number
    The maximum number of requests can be executed concurrently within the single function instance.
    instanceType string
    The instance type of the function.
    lastModificationTime string
    Function last modification time.
    memorySize number
    Amount of memory in MB the function can use at runtime.
    name string
    Function name.
    runtime string
    Function runtime. The list of possible values is available here.
    timeout number
    Maximum amount of time the function can run in seconds.
    customContainerConfig GetFunctionsFunctionCustomContainerConfig
    The configuration for custom container runtime. It contains following attributes:
    ca_port int
    The port that the function listen to, only valid for custom runtime and custom container runtime.
    code_checksum str
    Checksum (crc64) of the function code.
    code_size int
    Function code size in bytes.
    creation_time str
    Function creation time.
    description str
    Function description.
    environment_variables Mapping[str, str]
    A map that defines environment variables for the function.
    handler str
    Function entry point in the code.
    id str
    Function ID.
    initialization_timeout int
    The maximum length of time, in seconds, that the function's initialization should be run for.
    initializer str
    The entry point of the function's initialization.
    instance_concurrency int
    The maximum number of requests can be executed concurrently within the single function instance.
    instance_type str
    The instance type of the function.
    last_modification_time str
    Function last modification time.
    memory_size int
    Amount of memory in MB the function can use at runtime.
    name str
    Function name.
    runtime str
    Function runtime. The list of possible values is available here.
    timeout int
    Maximum amount of time the function can run in seconds.
    custom_container_config GetFunctionsFunctionCustomContainerConfig
    The configuration for custom container runtime. It contains following attributes:
    caPort Number
    The port that the function listen to, only valid for custom runtime and custom container runtime.
    codeChecksum String
    Checksum (crc64) of the function code.
    codeSize Number
    Function code size in bytes.
    creationTime String
    Function creation time.
    description String
    Function description.
    environmentVariables Map<String>
    A map that defines environment variables for the function.
    handler String
    Function entry point in the code.
    id String
    Function ID.
    initializationTimeout Number
    The maximum length of time, in seconds, that the function's initialization should be run for.
    initializer String
    The entry point of the function's initialization.
    instanceConcurrency Number
    The maximum number of requests can be executed concurrently within the single function instance.
    instanceType String
    The instance type of the function.
    lastModificationTime String
    Function last modification time.
    memorySize Number
    Amount of memory in MB the function can use at runtime.
    name String
    Function name.
    runtime String
    Function runtime. The list of possible values is available here.
    timeout Number
    Maximum amount of time the function can run in seconds.
    customContainerConfig Property Map
    The configuration for custom container runtime. It contains following attributes:

    GetFunctionsFunctionCustomContainerConfig

    Args string
    The args field specifies the arguments passed to the command.
    Command string
    The entry point of the container, which specifies the actual command run by the container.
    Image string
    The container image address.
    Args string
    The args field specifies the arguments passed to the command.
    Command string
    The entry point of the container, which specifies the actual command run by the container.
    Image string
    The container image address.
    args String
    The args field specifies the arguments passed to the command.
    command String
    The entry point of the container, which specifies the actual command run by the container.
    image String
    The container image address.
    args string
    The args field specifies the arguments passed to the command.
    command string
    The entry point of the container, which specifies the actual command run by the container.
    image string
    The container image address.
    args str
    The args field specifies the arguments passed to the command.
    command str
    The entry point of the container, which specifies the actual command run by the container.
    image str
    The container image address.
    args String
    The args field specifies the arguments passed to the command.
    command String
    The entry point of the container, which specifies the actual command run by the container.
    image String
    The container image address.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi