1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. log
  5. getStores
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.log.getStores

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 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);
Copy
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)
Copy
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
	})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: alicloud:log:getStores
      arguments:
        project: the_project_name
        ids:
          - the_store_name
outputs:
  firstLogStoreId: ${example.stores[0].id}
Copy

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>
Copy
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]
Copy
func GetStores(ctx *Context, args *GetStoresArgs, opts ...InvokeOption) (*GetStoresResult, error)
func GetStoresOutput(ctx *Context, args *GetStoresOutputArgs, opts ...InvokeOption) GetStoresResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetStoresResult> getStores(GetStoresArgs args, InvokeOptions options)
public static Output<GetStoresResult> getStores(GetStoresArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:log/getStores:getStores
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Project
This property is required.
Changes to this property will trigger replacement.
string
Ids Changes to this property will trigger replacement. List<string>
A list of store IDs.
NameRegex Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
string
Ids Changes to this property will trigger replacement. []string
A list of store IDs.
NameRegex Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
String
ids Changes to this property will trigger replacement. List<String>
A list of store IDs.
nameRegex Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
string
ids Changes to this property will trigger replacement. string[]
A list of store IDs.
nameRegex Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
str
ids Changes to this property will trigger replacement. Sequence[str]
A list of store IDs.
name_regex Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
String
ids Changes to this property will trigger replacement. List<String>
A list of store IDs.
nameRegex Changes to this property will trigger replacement. 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 This property is required. string
The ID of the store.
StoreName This property is required. string
The name of the store.
Id This property is required. string
The ID of the store.
StoreName This property is required. string
The name of the store.
id This property is required. String
The ID of the store.
storeName This property is required. String
The name of the store.
id This property is required. string
The ID of the store.
storeName This property is required. string
The name of the store.
id This property is required. str
The ID of the store.
store_name This property is required. str
The name of the store.
id This property is required. String
The ID of the store.
storeName This property is required. 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.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi