Alibaba Cloud

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

getStores

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

NOTE: Available in v1.126.0+.

Example Usage

Basic Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.Log.GetStores.InvokeAsync(new AliCloud.Log.GetStoresArgs
        {
            Project = "the_project_name",
            Ids = 
            {
                "the_store_name",
            },
        }));
        this.FirstLogStoreId = example.Apply(example => example.Stores?[0]?.Id);
    }

    [Output("firstLogStoreId")]
    public Output<string> FirstLogStoreId { get; set; }
}
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
	})
}
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()));
    }
}
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)
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);
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
Project string
Ids []string

A list of store IDs.

NameRegex string

A regex string to filter results by store name.

OutputFile string
project String
ids List<String>

A list of store IDs.

nameRegex String

A regex string to filter results by store name.

outputFile String
project string
ids string[]

A list of store IDs.

nameRegex string

A regex string to filter results by store name.

outputFile string
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
project String
ids List<String>

A list of store IDs.

nameRegex String

A regex string to filter results by store name.

outputFile String

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

This Pulumi package is based on the alicloud Terraform Provider.