Alibaba Cloud

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

getAccounts

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

NOTE: Available in v1.102.0+.

Example Usage

Basic Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.KVStore.GetAccounts.InvokeAsync(new AliCloud.KVStore.GetAccountsArgs
        {
            InstanceId = "example_value",
        }));
        this.FirstKvstoreAccountId = example.Apply(example => example.Accounts?[0]?.Id);
    }

    [Output("firstKvstoreAccountId")]
    public Output<string> FirstKvstoreAccountId { get; set; }
}
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
	})
}
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.clickhouse.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()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.kvstore.get_accounts(instance_id="example_value")
pulumi.export("firstKvstoreAccountId", example.accounts[0].id)
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);
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
Status string

The status of account.

InstanceId string

The Id of instance in which account belongs.

AccountName string

The name of the account.

NameRegex string
OutputFile string
Status string

The status of account.

instanceId String

The Id of instance in which account belongs.

accountName String

The name of the account.

nameRegex String
outputFile String
status String

The status of account.

instanceId string

The Id of instance in which account belongs.

accountName string

The name of the account.

nameRegex string
outputFile string
status string

The status of account.

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
status str

The status of account.

instanceId String

The Id of instance in which account belongs.

accountName String

The name of the account.

nameRegex String
outputFile String
status String

The status of account.

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

This Pulumi package is based on the alicloud Terraform Provider.