Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.19.0 published on Friday, Mar 18, 2022 by Pulumi

getAccounts

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

NOTE: Available in v1.148.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

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

    [Output("mongodbAccountId1")]
    public Output<string> MongodbAccountId1 { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mongodb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := mongodb.GetAccounts(ctx, &mongodb.GetAccountsArgs{
			InstanceId:  "example_value",
			AccountName: pulumi.StringRef("root"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("mongodbAccountId1", example.Accounts[0].Id)
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

example = alicloud.mongodb.get_accounts(instance_id="example_value",
    account_name="root")
pulumi.export("mongodbAccountId1", example.accounts[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = alicloud.mongodb.getAccounts({
    instanceId: "example_value",
    accountName: "root",
});
export const mongodbAccountId1 = example.then(example => example.accounts?[0]?.id);

Coming soon!

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,
                 output_file: 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,
                 output_file: 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:mongodb/getAccounts:getAccounts
  Arguments:
    # Arguments dictionary

The following arguments are supported:

InstanceId string

The id of the instance to which the account belongs.

AccountName string

The name of the account.

OutputFile string
InstanceId string

The id of the instance to which the account belongs.

AccountName string

The name of the account.

OutputFile string
instanceId String

The id of the instance to which the account belongs.

accountName String

The name of the account.

outputFile String
instanceId string

The id of the instance to which the account belongs.

accountName string

The name of the account.

outputFile string
instance_id str

The id of the instance to which the account belongs.

account_name str

The name of the account.

output_file str
instanceId String

The id of the instance to which the account belongs.

accountName String

The name of the account.

outputFile String

getAccounts Result

The following output properties are available:

Accounts List<Pulumi.AliCloud.MongoDB.Outputs.GetAccountsAccount>
Id string

The provider-assigned unique ID for this managed resource.

InstanceId string
AccountName string
OutputFile string
Accounts []GetAccountsAccount
Id string

The provider-assigned unique ID for this managed resource.

InstanceId string
AccountName string
OutputFile string
accounts ListAccountsAccount>
id String

The provider-assigned unique ID for this managed resource.

instanceId String
accountName String
outputFile String
accounts GetAccountsAccount[]
id string

The provider-assigned unique ID for this managed resource.

instanceId string
accountName string
outputFile string
accounts Sequence[GetAccountsAccount]
id str

The provider-assigned unique ID for this managed resource.

instance_id str
account_name str
output_file str
accounts List
id String

The provider-assigned unique ID for this managed resource.

instanceId String
accountName String
outputFile String

Supporting Types

GetAccountsAccount

AccountDescription string

The description of the account.

AccountName string

The name of the account.

CharacterType string

The role of the account. Valid values: db, cs, mongos, logic, normal.

Id string

The ID of the Account. The value formats as <instance_id>:<account_name>.

InstanceId string

The id of the instance to which the account belongs.

Status string

The status of the account. Valid values: Unavailable, Available.

AccountDescription string

The description of the account.

AccountName string

The name of the account.

CharacterType string

The role of the account. Valid values: db, cs, mongos, logic, normal.

Id string

The ID of the Account. The value formats as <instance_id>:<account_name>.

InstanceId string

The id of the instance to which the account belongs.

Status string

The status of the account. Valid values: Unavailable, Available.

accountDescription String

The description of the account.

accountName String

The name of the account.

characterType String

The role of the account. Valid values: db, cs, mongos, logic, normal.

id String

The ID of the Account. The value formats as <instance_id>:<account_name>.

instanceId String

The id of the instance to which the account belongs.

status String

The status of the account. Valid values: Unavailable, Available.

accountDescription string

The description of the account.

accountName string

The name of the account.

characterType string

The role of the account. Valid values: db, cs, mongos, logic, normal.

id string

The ID of the Account. The value formats as <instance_id>:<account_name>.

instanceId string

The id of the instance to which the account belongs.

status string

The status of the account. Valid values: Unavailable, Available.

account_description str

The description of the account.

account_name str

The name of the account.

character_type str

The role of the account. Valid values: db, cs, mongos, logic, normal.

id str

The ID of the Account. The value formats as <instance_id>:<account_name>.

instance_id str

The id of the instance to which the account belongs.

status str

The status of the account. Valid values: Unavailable, Available.

accountDescription String

The description of the account.

accountName String

The name of the account.

characterType String

The role of the account. Valid values: db, cs, mongos, logic, normal.

id String

The ID of the Account. The value formats as <instance_id>:<account_name>.

instanceId String

The id of the instance to which the account belongs.

status String

The status of the account. Valid values: Unavailable, Available.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.