get Stores
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);
Content copied to clipboard
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)
Content copied to clipboard
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),
};
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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()));
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
function: alicloud:log:getStores
arguments:
project: the_project_name
ids:
- the_store_name
outputs:
firstLogStoreId: ${example.stores[0].id}
Content copied to clipboard
Return
A collection of values returned by getStores.
Parameters
argument
A collection of arguments for invoking getStores.
suspend fun getStores(ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null, project: String): GetStoresResult
Return
A collection of values returned by getStores.
Parameters
ids
A list of store IDs.
name Regex
A regex string to filter results by store name.
output File
File name where to save data source results (after running pulumi preview
).
project
See also
Return
A collection of values returned by getStores.
Parameters
argument
Builder for com.pulumi.alicloud.log.kotlin.inputs.GetStoresPlainArgs.