1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. imp
  5. getAppTemplates
Alibaba Cloud v3.69.0 published on Monday, Dec 9, 2024 by Pulumi

alicloud.imp.getAppTemplates

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.69.0 published on Monday, Dec 9, 2024 by Pulumi

    This data source provides the Imp App Templates of the current Alibaba Cloud user.

    NOTE: Available in v1.137.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.imp.getAppTemplates({});
    export const impAppTemplateId1 = ids.then(ids => ids.templates?.[0]?.id);
    const nameRegex = alicloud.imp.getAppTemplates({
        nameRegex: "^my_AppTemplate",
    });
    export const impAppTemplateId2 = nameRegex.then(nameRegex => nameRegex.templates?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.imp.get_app_templates()
    pulumi.export("impAppTemplateId1", ids.templates[0].id)
    name_regex = alicloud.imp.get_app_templates(name_regex="^my_AppTemplate")
    pulumi.export("impAppTemplateId2", name_regex.templates[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/imp"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := imp.GetAppTemplates(ctx, &imp.GetAppTemplatesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("impAppTemplateId1", ids.Templates[0].Id)
    		nameRegex, err := imp.GetAppTemplates(ctx, &imp.GetAppTemplatesArgs{
    			NameRegex: pulumi.StringRef("^my_AppTemplate"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("impAppTemplateId2", nameRegex.Templates[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Imp.GetAppTemplates.Invoke();
    
        var nameRegex = AliCloud.Imp.GetAppTemplates.Invoke(new()
        {
            NameRegex = "^my_AppTemplate",
        });
    
        return new Dictionary<string, object?>
        {
            ["impAppTemplateId1"] = ids.Apply(getAppTemplatesResult => getAppTemplatesResult.Templates[0]?.Id),
            ["impAppTemplateId2"] = nameRegex.Apply(getAppTemplatesResult => getAppTemplatesResult.Templates[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.imp.ImpFunctions;
    import com.pulumi.alicloud.imp.inputs.GetAppTemplatesArgs;
    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 ids = ImpFunctions.getAppTemplates();
    
            ctx.export("impAppTemplateId1", ids.applyValue(getAppTemplatesResult -> getAppTemplatesResult.templates()[0].id()));
            final var nameRegex = ImpFunctions.getAppTemplates(GetAppTemplatesArgs.builder()
                .nameRegex("^my_AppTemplate")
                .build());
    
            ctx.export("impAppTemplateId2", nameRegex.applyValue(getAppTemplatesResult -> getAppTemplatesResult.templates()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:imp:getAppTemplates
          Arguments: {}
      nameRegex:
        fn::invoke:
          Function: alicloud:imp:getAppTemplates
          Arguments:
            nameRegex: ^my_AppTemplate
    outputs:
      impAppTemplateId1: ${ids.templates[0].id}
      impAppTemplateId2: ${nameRegex.templates[0].id}
    

    Using getAppTemplates

    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 getAppTemplates(args: GetAppTemplatesArgs, opts?: InvokeOptions): Promise<GetAppTemplatesResult>
    function getAppTemplatesOutput(args: GetAppTemplatesOutputArgs, opts?: InvokeOptions): Output<GetAppTemplatesResult>
    def get_app_templates(ids: Optional[Sequence[str]] = None,
                          name_regex: Optional[str] = None,
                          output_file: Optional[str] = None,
                          status: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetAppTemplatesResult
    def get_app_templates_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          name_regex: Optional[pulumi.Input[str]] = None,
                          output_file: Optional[pulumi.Input[str]] = None,
                          status: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetAppTemplatesResult]
    func GetAppTemplates(ctx *Context, args *GetAppTemplatesArgs, opts ...InvokeOption) (*GetAppTemplatesResult, error)
    func GetAppTemplatesOutput(ctx *Context, args *GetAppTemplatesOutputArgs, opts ...InvokeOption) GetAppTemplatesResultOutput

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

    public static class GetAppTemplates 
    {
        public static Task<GetAppTemplatesResult> InvokeAsync(GetAppTemplatesArgs args, InvokeOptions? opts = null)
        public static Output<GetAppTemplatesResult> Invoke(GetAppTemplatesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAppTemplatesResult> getAppTemplates(GetAppTemplatesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:imp/getAppTemplates:getAppTemplates
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of App Template IDs.
    NameRegex string
    A regex string to filter results by App Template name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    Application template usage status. Valid values: ["attached", "unattached"].
    Ids []string
    A list of App Template IDs.
    NameRegex string
    A regex string to filter results by App Template name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    Application template usage status. Valid values: ["attached", "unattached"].
    ids List<String>
    A list of App Template IDs.
    nameRegex String
    A regex string to filter results by App Template name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    Application template usage status. Valid values: ["attached", "unattached"].
    ids string[]
    A list of App Template IDs.
    nameRegex string
    A regex string to filter results by App Template name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status string
    Application template usage status. Valid values: ["attached", "unattached"].
    ids Sequence[str]
    A list of App Template IDs.
    name_regex str
    A regex string to filter results by App Template name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    status str
    Application template usage status. Valid values: ["attached", "unattached"].
    ids List<String>
    A list of App Template IDs.
    nameRegex String
    A regex string to filter results by App Template name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    Application template usage status. Valid values: ["attached", "unattached"].

    getAppTemplates Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    Templates List<Pulumi.AliCloud.Imp.Outputs.GetAppTemplatesTemplate>
    NameRegex string
    OutputFile string
    Status string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Templates []GetAppTemplatesTemplate
    NameRegex string
    OutputFile string
    Status string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    templates List<GetAppTemplatesTemplate>
    nameRegex String
    outputFile String
    status String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    templates GetAppTemplatesTemplate[]
    nameRegex string
    outputFile string
    status string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    templates Sequence[GetAppTemplatesTemplate]
    name_regex str
    output_file str
    status str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    templates List<Property Map>
    nameRegex String
    outputFile String
    status String

    Supporting Types

    GetAppTemplatesTemplate

    AppTemplateCreator string
    Apply template creator.
    AppTemplateId string
    The first ID of the resource.
    AppTemplateName string
    The name of the resource.
    ComponentLists List<string>
    List of components.
    ConfigLists List<Pulumi.AliCloud.Imp.Inputs.GetAppTemplatesTemplateConfigList>
    List of config.
    CreateTime string
    Creation time.
    Id string
    The ID of the App Template.
    IntegrationMode string
    Integration mode (Integrated SDK:paasSDK, Model Room: standardRoom).
    Scene string
    Application Template scenario, e-commerce business, classroom classroom.
    SdkInfo string
    SDK information.
    StandardRoomInfo string
    Model room information.
    Status string
    Application template usage status.
    AppTemplateCreator string
    Apply template creator.
    AppTemplateId string
    The first ID of the resource.
    AppTemplateName string
    The name of the resource.
    ComponentLists []string
    List of components.
    ConfigLists []GetAppTemplatesTemplateConfigList
    List of config.
    CreateTime string
    Creation time.
    Id string
    The ID of the App Template.
    IntegrationMode string
    Integration mode (Integrated SDK:paasSDK, Model Room: standardRoom).
    Scene string
    Application Template scenario, e-commerce business, classroom classroom.
    SdkInfo string
    SDK information.
    StandardRoomInfo string
    Model room information.
    Status string
    Application template usage status.
    appTemplateCreator String
    Apply template creator.
    appTemplateId String
    The first ID of the resource.
    appTemplateName String
    The name of the resource.
    componentLists List<String>
    List of components.
    configLists List<GetAppTemplatesTemplateConfigList>
    List of config.
    createTime String
    Creation time.
    id String
    The ID of the App Template.
    integrationMode String
    Integration mode (Integrated SDK:paasSDK, Model Room: standardRoom).
    scene String
    Application Template scenario, e-commerce business, classroom classroom.
    sdkInfo String
    SDK information.
    standardRoomInfo String
    Model room information.
    status String
    Application template usage status.
    appTemplateCreator string
    Apply template creator.
    appTemplateId string
    The first ID of the resource.
    appTemplateName string
    The name of the resource.
    componentLists string[]
    List of components.
    configLists GetAppTemplatesTemplateConfigList[]
    List of config.
    createTime string
    Creation time.
    id string
    The ID of the App Template.
    integrationMode string
    Integration mode (Integrated SDK:paasSDK, Model Room: standardRoom).
    scene string
    Application Template scenario, e-commerce business, classroom classroom.
    sdkInfo string
    SDK information.
    standardRoomInfo string
    Model room information.
    status string
    Application template usage status.
    app_template_creator str
    Apply template creator.
    app_template_id str
    The first ID of the resource.
    app_template_name str
    The name of the resource.
    component_lists Sequence[str]
    List of components.
    config_lists Sequence[GetAppTemplatesTemplateConfigList]
    List of config.
    create_time str
    Creation time.
    id str
    The ID of the App Template.
    integration_mode str
    Integration mode (Integrated SDK:paasSDK, Model Room: standardRoom).
    scene str
    Application Template scenario, e-commerce business, classroom classroom.
    sdk_info str
    SDK information.
    standard_room_info str
    Model room information.
    status str
    Application template usage status.
    appTemplateCreator String
    Apply template creator.
    appTemplateId String
    The first ID of the resource.
    appTemplateName String
    The name of the resource.
    componentLists List<String>
    List of components.
    configLists List<Property Map>
    List of config.
    createTime String
    Creation time.
    id String
    The ID of the App Template.
    integrationMode String
    Integration mode (Integrated SDK:paasSDK, Model Room: standardRoom).
    scene String
    Application Template scenario, e-commerce business, classroom classroom.
    sdkInfo String
    SDK information.
    standardRoomInfo String
    Model room information.
    status String
    Application template usage status.

    GetAppTemplatesTemplateConfigList

    Key string
    Config key.
    Value string
    Config Value.
    Key string
    Config key.
    Value string
    Config Value.
    key String
    Config key.
    value String
    Config Value.
    key string
    Config key.
    value string
    Config Value.
    key str
    Config key.
    value str
    Config Value.
    key String
    Config key.
    value String
    Config Value.

    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.69.0 published on Monday, Dec 9, 2024 by Pulumi