1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. fc
  5. getTriggers
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.fc.getTriggers

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const fcTriggersDs = alicloud.fc.getTriggers({
        serviceName: "sample_service",
        functionName: "sample_function",
        nameRegex: "sample_fc_trigger",
    });
    export const firstFcTriggerName = fcTriggersDs.then(fcTriggersDs => fcTriggersDs.triggers?.[0]?.name);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    fc_triggers_ds = alicloud.fc.get_triggers(service_name="sample_service",
        function_name="sample_function",
        name_regex="sample_fc_trigger")
    pulumi.export("firstFcTriggerName", fc_triggers_ds.triggers[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 {
    		fcTriggersDs, err := fc.GetTriggers(ctx, &fc.GetTriggersArgs{
    			ServiceName:  "sample_service",
    			FunctionName: "sample_function",
    			NameRegex:    pulumi.StringRef("sample_fc_trigger"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstFcTriggerName", fcTriggersDs.Triggers[0].Name)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var fcTriggersDs = AliCloud.FC.GetTriggers.Invoke(new()
        {
            ServiceName = "sample_service",
            FunctionName = "sample_function",
            NameRegex = "sample_fc_trigger",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstFcTriggerName"] = fcTriggersDs.Apply(getTriggersResult => getTriggersResult.Triggers[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.GetTriggersArgs;
    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 fcTriggersDs = FcFunctions.getTriggers(GetTriggersArgs.builder()
                .serviceName("sample_service")
                .functionName("sample_function")
                .nameRegex("sample_fc_trigger")
                .build());
    
            ctx.export("firstFcTriggerName", fcTriggersDs.applyValue(getTriggersResult -> getTriggersResult.triggers()[0].name()));
        }
    }
    
    variables:
      fcTriggersDs:
        fn::invoke:
          Function: alicloud:fc:getTriggers
          Arguments:
            serviceName: sample_service
            functionName: sample_function
            nameRegex: sample_fc_trigger
    outputs:
      firstFcTriggerName: ${fcTriggersDs.triggers[0].name}
    

    Using getTriggers

    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 getTriggers(args: GetTriggersArgs, opts?: InvokeOptions): Promise<GetTriggersResult>
    function getTriggersOutput(args: GetTriggersOutputArgs, opts?: InvokeOptions): Output<GetTriggersResult>
    def get_triggers(function_name: Optional[str] = None,
                     ids: Optional[Sequence[str]] = None,
                     name_regex: Optional[str] = None,
                     output_file: Optional[str] = None,
                     service_name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetTriggersResult
    def get_triggers_output(function_name: Optional[pulumi.Input[str]] = None,
                     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[GetTriggersResult]
    func GetTriggers(ctx *Context, args *GetTriggersArgs, opts ...InvokeOption) (*GetTriggersResult, error)
    func GetTriggersOutput(ctx *Context, args *GetTriggersOutputArgs, opts ...InvokeOption) GetTriggersResultOutput

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

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

    The following arguments are supported:

    FunctionName string
    FC function name.
    ServiceName string
    FC service name.
    Ids List<string>
    A list of FC triggers ids.
    NameRegex string
    A regex string to filter results by FC trigger name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    FunctionName string
    FC function name.
    ServiceName string
    FC service name.
    Ids []string
    A list of FC triggers ids.
    NameRegex string
    A regex string to filter results by FC trigger name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    functionName String
    FC function name.
    serviceName String
    FC service name.
    ids List<String>
    A list of FC triggers ids.
    nameRegex String
    A regex string to filter results by FC trigger name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    functionName string
    FC function name.
    serviceName string
    FC service name.
    ids string[]
    A list of FC triggers ids.
    nameRegex string
    A regex string to filter results by FC trigger name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    function_name str
    FC function name.
    service_name str
    FC service name.
    ids Sequence[str]
    A list of FC triggers ids.
    name_regex str
    A regex string to filter results by FC trigger name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    functionName String
    FC function name.
    serviceName String
    FC service name.
    ids List<String>
    A list of FC triggers ids.
    nameRegex String
    A regex string to filter results by FC trigger name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getTriggers Result

    The following output properties are available:

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

    Supporting Types

    GetTriggersTrigger

    Config string
    JSON-encoded trigger configuration. See Configure triggers and events for more details.
    CreationTime string
    FC trigger creation time.
    Id string
    FC trigger ID.
    InvocationRole string
    RAM role arn attached to the Function Compute trigger. Role used by the event source to call the function. The value format is "acs:ram::$account-id:role/$role-name". See Create a trigger for more details.
    LastModificationTime string
    FC trigger last modification time.
    Name string
    FC trigger name.
    SourceArn string
    Event source resource address. See Create a trigger for more details.
    Type string
    Type of the trigger. Valid values: oss, log, timer, http, mns_topic, cdn_events and eventbridge.
    Config string
    JSON-encoded trigger configuration. See Configure triggers and events for more details.
    CreationTime string
    FC trigger creation time.
    Id string
    FC trigger ID.
    InvocationRole string
    RAM role arn attached to the Function Compute trigger. Role used by the event source to call the function. The value format is "acs:ram::$account-id:role/$role-name". See Create a trigger for more details.
    LastModificationTime string
    FC trigger last modification time.
    Name string
    FC trigger name.
    SourceArn string
    Event source resource address. See Create a trigger for more details.
    Type string
    Type of the trigger. Valid values: oss, log, timer, http, mns_topic, cdn_events and eventbridge.
    config String
    JSON-encoded trigger configuration. See Configure triggers and events for more details.
    creationTime String
    FC trigger creation time.
    id String
    FC trigger ID.
    invocationRole String
    RAM role arn attached to the Function Compute trigger. Role used by the event source to call the function. The value format is "acs:ram::$account-id:role/$role-name". See Create a trigger for more details.
    lastModificationTime String
    FC trigger last modification time.
    name String
    FC trigger name.
    sourceArn String
    Event source resource address. See Create a trigger for more details.
    type String
    Type of the trigger. Valid values: oss, log, timer, http, mns_topic, cdn_events and eventbridge.
    config string
    JSON-encoded trigger configuration. See Configure triggers and events for more details.
    creationTime string
    FC trigger creation time.
    id string
    FC trigger ID.
    invocationRole string
    RAM role arn attached to the Function Compute trigger. Role used by the event source to call the function. The value format is "acs:ram::$account-id:role/$role-name". See Create a trigger for more details.
    lastModificationTime string
    FC trigger last modification time.
    name string
    FC trigger name.
    sourceArn string
    Event source resource address. See Create a trigger for more details.
    type string
    Type of the trigger. Valid values: oss, log, timer, http, mns_topic, cdn_events and eventbridge.
    config str
    JSON-encoded trigger configuration. See Configure triggers and events for more details.
    creation_time str
    FC trigger creation time.
    id str
    FC trigger ID.
    invocation_role str
    RAM role arn attached to the Function Compute trigger. Role used by the event source to call the function. The value format is "acs:ram::$account-id:role/$role-name". See Create a trigger for more details.
    last_modification_time str
    FC trigger last modification time.
    name str
    FC trigger name.
    source_arn str
    Event source resource address. See Create a trigger for more details.
    type str
    Type of the trigger. Valid values: oss, log, timer, http, mns_topic, cdn_events and eventbridge.
    config String
    JSON-encoded trigger configuration. See Configure triggers and events for more details.
    creationTime String
    FC trigger creation time.
    id String
    FC trigger ID.
    invocationRole String
    RAM role arn attached to the Function Compute trigger. Role used by the event source to call the function. The value format is "acs:ram::$account-id:role/$role-name". See Create a trigger for more details.
    lastModificationTime String
    FC trigger last modification time.
    name String
    FC trigger name.
    sourceArn String
    Event source resource address. See Create a trigger for more details.
    type String
    Type of the trigger. Valid values: oss, log, timer, http, mns_topic, cdn_events and eventbridge.

    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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi