1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. kvstore
  5. getAccounts
Alibaba Cloud v3.57.0 published on Saturday, Jun 15, 2024 by Pulumi

alicloud.kvstore.getAccounts

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.0 published on Saturday, Jun 15, 2024 by Pulumi

    This data source provides the KVStore Accounts of the current Alibaba Cloud user.

    NOTE: Available in v1.102.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.kvstore.getAccounts({
        instanceId: "example_value",
    });
    export const firstKvstoreAccountId = example.then(example => example.accounts?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.kvstore.get_accounts(instance_id="example_value")
    pulumi.export("firstKvstoreAccountId", example.accounts[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/kvstore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := kvstore.GetAccounts(ctx, &kvstore.GetAccountsArgs{
    			InstanceId: "example_value",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstKvstoreAccountId", example.Accounts[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AliCloud.KVStore.GetAccounts.Invoke(new()
        {
            InstanceId = "example_value",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstKvstoreAccountId"] = example.Apply(getAccountsResult => getAccountsResult.Accounts[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.kvstore.KvstoreFunctions;
    import com.pulumi.alicloud.kvstore.inputs.GetAccountsArgs;
    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 = KvstoreFunctions.getAccounts(GetAccountsArgs.builder()
                .instanceId("example_value")
                .build());
    
            ctx.export("firstKvstoreAccountId", example.applyValue(getAccountsResult -> getAccountsResult.accounts()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:kvstore:getAccounts
          Arguments:
            instanceId: example_value
    outputs:
      firstKvstoreAccountId: ${example.accounts[0].id}
    

    Using getAccounts

    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 getAccounts(args: GetAccountsArgs, opts?: InvokeOptions): Promise<GetAccountsResult>
    function getAccountsOutput(args: GetAccountsOutputArgs, opts?: InvokeOptions): Output<GetAccountsResult>
    def get_accounts(account_name: Optional[str] = None,
                     instance_id: Optional[str] = None,
                     name_regex: Optional[str] = None,
                     output_file: Optional[str] = None,
                     status: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetAccountsResult
    def get_accounts_output(account_name: Optional[pulumi.Input[str]] = None,
                     instance_id: Optional[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[GetAccountsResult]
    func GetAccounts(ctx *Context, args *GetAccountsArgs, opts ...InvokeOption) (*GetAccountsResult, error)
    func GetAccountsOutput(ctx *Context, args *GetAccountsOutputArgs, opts ...InvokeOption) GetAccountsResultOutput

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

    public static class GetAccounts 
    {
        public static Task<GetAccountsResult> InvokeAsync(GetAccountsArgs args, InvokeOptions? opts = null)
        public static Output<GetAccountsResult> Invoke(GetAccountsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccountsResult> getAccounts(GetAccountsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:kvstore/getAccounts:getAccounts
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    The Id of instance in which account belongs.
    AccountName string
    The name of the account.
    NameRegex string
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of KVStore Account. Valid Values: "Available Unavailable
    InstanceId string
    The Id of instance in which account belongs.
    AccountName string
    The name of the account.
    NameRegex string
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of KVStore Account. Valid Values: "Available Unavailable
    instanceId String
    The Id of instance in which account belongs.
    accountName String
    The name of the account.
    nameRegex String
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of KVStore Account. Valid Values: "Available Unavailable
    instanceId string
    The Id of instance in which account belongs.
    accountName string
    The name of the account.
    nameRegex string
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status string
    The status of KVStore Account. Valid Values: "Available Unavailable
    instance_id str
    The Id of instance in which account belongs.
    account_name str
    The name of the account.
    name_regex str
    output_file str
    File name where to save data source results (after running pulumi preview).
    status str
    The status of KVStore Account. Valid Values: "Available Unavailable
    instanceId String
    The Id of instance in which account belongs.
    accountName String
    The name of the account.
    nameRegex String
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of KVStore Account. Valid Values: "Available Unavailable

    getAccounts Result

    The following output properties are available:

    Accounts List<Pulumi.AliCloud.KVStore.Outputs.GetAccountsAccount>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    InstanceId string
    Names List<string>
    AccountName string
    NameRegex string
    OutputFile string
    Status string
    Accounts []GetAccountsAccount
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    InstanceId string
    Names []string
    AccountName string
    NameRegex string
    OutputFile string
    Status string
    accounts List<GetAccountsAccount>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    names List<String>
    accountName String
    nameRegex String
    outputFile String
    status String
    accounts GetAccountsAccount[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    instanceId string
    names string[]
    accountName string
    nameRegex string
    outputFile string
    status string
    accounts Sequence[GetAccountsAccount]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    instance_id str
    names Sequence[str]
    account_name str
    name_regex str
    output_file str
    status str
    accounts List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    names List<String>
    accountName String
    nameRegex String
    outputFile String
    status String

    Supporting Types

    GetAccountsAccount

    AccountName string
    The name of the account.
    AccountPrivilege string
    The privilege of account access database.
    AccountType string
    Privilege type of account.
    Description string
    The description of account.
    Id string
    The ID of the Account.
    InstanceId string
    The Id of instance in which account belongs.
    Status string
    The status of account.
    AccountName string
    The name of the account.
    AccountPrivilege string
    The privilege of account access database.
    AccountType string
    Privilege type of account.
    Description string
    The description of account.
    Id string
    The ID of the Account.
    InstanceId string
    The Id of instance in which account belongs.
    Status string
    The status of account.
    accountName String
    The name of the account.
    accountPrivilege String
    The privilege of account access database.
    accountType String
    Privilege type of account.
    description String
    The description of account.
    id String
    The ID of the Account.
    instanceId String
    The Id of instance in which account belongs.
    status String
    The status of account.
    accountName string
    The name of the account.
    accountPrivilege string
    The privilege of account access database.
    accountType string
    Privilege type of account.
    description string
    The description of account.
    id string
    The ID of the Account.
    instanceId string
    The Id of instance in which account belongs.
    status string
    The status of account.
    account_name str
    The name of the account.
    account_privilege str
    The privilege of account access database.
    account_type str
    Privilege type of account.
    description str
    The description of account.
    id str
    The ID of the Account.
    instance_id str
    The Id of instance in which account belongs.
    status str
    The status of account.
    accountName String
    The name of the account.
    accountPrivilege String
    The privilege of account access database.
    accountType String
    Privilege type of account.
    description String
    The description of account.
    id String
    The ID of the Account.
    instanceId String
    The Id of instance in which account belongs.
    status String
    The status of account.

    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.57.0 published on Saturday, Jun 15, 2024 by Pulumi