Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getFunctions

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

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var functionsDs = Output.Create(AliCloud.FC.GetFunctions.InvokeAsync(new AliCloud.FC.GetFunctionsArgs
        {
            NameRegex = "sample_fc_function",
            ServiceName = "sample_service",
        }));
        this.FirstFcFunctionName = functionsDs.Apply(functionsDs => functionsDs.Functions?[0]?.Name);
    }

    [Output("firstFcFunctionName")]
    public Output<string> FirstFcFunctionName { get; set; }
}
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{
			NameRegex:   pulumi.StringRef("sample_fc_function"),
			ServiceName: "sample_service",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstFcFunctionName", functionsDs.Functions[0].Name)
		return nil
	})
}
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()
            .nameRegex("sample_fc_function")
            .serviceName("sample_service")
            .build());

        ctx.export("firstFcFunctionName", functionsDs.applyValue(getFunctionsResult -> getFunctionsResult.functions()[0].name()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

functions_ds = alicloud.fc.get_functions(name_regex="sample_fc_function",
    service_name="sample_service")
pulumi.export("firstFcFunctionName", functions_ds.functions[0].name)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const functionsDs = pulumi.output(alicloud.fc.getFunctions({
    nameRegex: "sample_fc_function",
    serviceName: "sample_service",
}));

export const firstFcFunctionName = functionsDs.functions[0].name;
variables:
  functionsDs:
    Fn::Invoke:
      Function: alicloud:fc:getFunctions
      Arguments:
        nameRegex: sample_fc_function
        serviceName: sample_service
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
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
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
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
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
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

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, object>

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]interface{}

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,Object>

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]: any}

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, Any]

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<Any>

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
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.