1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. log
  5. getStores
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

alicloud.log.getStores

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

    This data source provides the Log Stores of the current Alibaba Cloud user.

    NOTE: Available in v1.126.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.log.getStores({
        project: "the_project_name",
        ids: ["the_store_name"],
    });
    export const firstLogStoreId = example.then(example => example.stores?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.log.get_stores(project="the_project_name",
        ids=["the_store_name"])
    pulumi.export("firstLogStoreId", example.stores[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := log.GetStores(ctx, &log.GetStoresArgs{
    			Project: "the_project_name",
    			Ids: []string{
    				"the_store_name",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstLogStoreId", example.Stores[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AliCloud.Log.GetStores.Invoke(new()
        {
            Project = "the_project_name",
            Ids = new[]
            {
                "the_store_name",
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["firstLogStoreId"] = example.Apply(getStoresResult => getStoresResult.Stores[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.log.LogFunctions;
    import com.pulumi.alicloud.log.inputs.GetStoresArgs;
    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 example = LogFunctions.getStores(GetStoresArgs.builder()
                .project("the_project_name")
                .ids("the_store_name")
                .build());
    
            ctx.export("firstLogStoreId", example.applyValue(getStoresResult -> getStoresResult.stores()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:log:getStores
          Arguments:
            project: the_project_name
            ids:
              - the_store_name
    outputs:
      firstLogStoreId: ${example.stores[0].id}
    

    Using getStores

    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 getStores(args: GetStoresArgs, opts?: InvokeOptions): Promise<GetStoresResult>
    function getStoresOutput(args: GetStoresOutputArgs, opts?: InvokeOptions): Output<GetStoresResult>
    def get_stores(ids: Optional[Sequence[str]] = None,
                   name_regex: Optional[str] = None,
                   output_file: Optional[str] = None,
                   project: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetStoresResult
    def get_stores_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                   name_regex: Optional[pulumi.Input[str]] = None,
                   output_file: Optional[pulumi.Input[str]] = None,
                   project: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetStoresResult]
    func GetStores(ctx *Context, args *GetStoresArgs, opts ...InvokeOption) (*GetStoresResult, error)
    func GetStoresOutput(ctx *Context, args *GetStoresOutputArgs, opts ...InvokeOption) GetStoresResultOutput

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

    public static class GetStores 
    {
        public static Task<GetStoresResult> InvokeAsync(GetStoresArgs args, InvokeOptions? opts = null)
        public static Output<GetStoresResult> Invoke(GetStoresInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetStoresResult> getStores(GetStoresArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:log/getStores:getStores
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Project string
    Ids List<string>
    A list of store IDs.
    NameRegex string
    A regex string to filter results by store name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Project string
    Ids []string
    A list of store IDs.
    NameRegex string
    A regex string to filter results by store name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    project String
    ids List<String>
    A list of store IDs.
    nameRegex String
    A regex string to filter results by store name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    project string
    ids string[]
    A list of store IDs.
    nameRegex string
    A regex string to filter results by store name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    project str
    ids Sequence[str]
    A list of store IDs.
    name_regex str
    A regex string to filter results by store name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    project String
    ids List<String>
    A list of store IDs.
    nameRegex String
    A regex string to filter results by store name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getStores Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    Project string
    Stores List<Pulumi.AliCloud.Log.Outputs.GetStoresStore>
    NameRegex string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Project string
    Stores []GetStoresStore
    NameRegex string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    project String
    stores List<GetStoresStore>
    nameRegex String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    project string
    stores GetStoresStore[]
    nameRegex string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    project str
    stores Sequence[GetStoresStore]
    name_regex str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    project String
    stores List<Property Map>
    nameRegex String
    outputFile String

    Supporting Types

    GetStoresStore

    Id string
    The ID of the store.
    StoreName string
    The name of the store.
    Id string
    The ID of the store.
    StoreName string
    The name of the store.
    id String
    The ID of the store.
    storeName String
    The name of the store.
    id string
    The ID of the store.
    storeName string
    The name of the store.
    id str
    The ID of the store.
    store_name str
    The name of the store.
    id String
    The ID of the store.
    storeName String
    The name of the store.

    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.54.0 published on Wednesday, Apr 24, 2024 by Pulumi