GetAccount

Use this data source to access information about an existing CosmosDB (formally DocumentDB) Account.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Azure.CosmosDB.GetAccount.InvokeAsync(new Azure.CosmosDB.GetAccountArgs
        {
            Name = "tfex-cosmosdb-account",
            ResourceGroupName = "tfex-cosmosdb-account-rg",
        }));
        this.CosmosdbAccountEndpoint = data.Azurerm_cosmosdb_account.Jobs.Endpoint;
    }

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

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/cosmosdb"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{
            Name:              "tfex-cosmosdb-account",
            ResourceGroupName: "tfex-cosmosdb-account-rg",
        }, nil)
        if err != nil {
            return err
        }
        ctx.Export("cosmosdbAccountEndpoint", data.Azurerm_cosmosdb_account.Jobs.Endpoint)
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example = azure.cosmosdb.get_account(name="tfex-cosmosdb-account",
    resource_group_name="tfex-cosmosdb-account-rg")
pulumi.export("cosmosdbAccountEndpoint", data["azurerm_cosmosdb_account"]["jobs"]["endpoint"])
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.cosmosdb.getAccount({
    name: "tfex-cosmosdb-account",
    resourceGroupName: "tfex-cosmosdb-account-rg",
});
export const cosmosdbAccountEndpoint = data.azurerm_cosmosdb_account.jobs.endpoint;

Using GetAccount

function getAccount(args: GetAccountArgs, opts?: InvokeOptions): Promise<GetAccountResult>
function  get_account(name=None, resource_group_name=None, opts=None)
func LookupAccount(ctx *Context, args *LookupAccountArgs, opts ...InvokeOption) (*LookupAccountResult, error)

Note: This function is named LookupAccount in the Go SDK.

public static class GetAccount {
    public static Task<GetAccountResult> InvokeAsync(GetAccountArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string

Specifies the name of the CosmosDB Account.

ResourceGroupName string

Specifies the name of the resource group in which the CosmosDB Account resides.

Name string

Specifies the name of the CosmosDB Account.

ResourceGroupName string

Specifies the name of the resource group in which the CosmosDB Account resides.

name string

Specifies the name of the CosmosDB Account.

resourceGroupName string

Specifies the name of the resource group in which the CosmosDB Account resides.

name str

Specifies the name of the CosmosDB Account.

resource_group_name str

Specifies the name of the resource group in which the CosmosDB Account resides.

GetAccount Result

The following output properties are available:

Capabilities List<GetAccountCapability>

Capabilities enabled on this Cosmos DB account.

ConsistencyPolicies List<GetAccountConsistencyPolicy>
EnableAutomaticFailover bool

If automatic failover is enabled for this CosmosDB Account.

EnableMultipleWriteLocations bool

If multi-master is enabled for this Cosmos DB account.

Endpoint string

The endpoint used to connect to the CosmosDB account.

GeoLocations List<GetAccountGeoLocation>
Id string

The provider-assigned unique ID for this managed resource.

IpRangeFilter string

The current IP Filter for this CosmosDB account

IsVirtualNetworkFilterEnabled bool

If virtual network filtering is enabled for this Cosmos DB account.

Kind string

The Kind of the CosmosDB account.

Location string

The name of the Azure region hosting replicated data.

Name string
OfferType string

The Offer Type to used by this CosmosDB Account.

PrimaryMasterKey string

The Primary master key for the CosmosDB Account.

PrimaryReadonlyMasterKey string

The Primary read-only master Key for the CosmosDB Account.

ReadEndpoints List<string>

A list of read endpoints available for this CosmosDB account.

ResourceGroupName string
SecondaryMasterKey string

The Secondary master key for the CosmosDB Account.

SecondaryReadonlyMasterKey string

The Secondary read-only master key for the CosmosDB Account.

Tags Dictionary<string, string>

A mapping of tags assigned to the resource.

VirtualNetworkRules List<GetAccountVirtualNetworkRule>

Subnets that are allowed to access this CosmosDB account.

WriteEndpoints List<string>

A list of write endpoints available for this CosmosDB account.

Capabilities []GetAccountCapability

Capabilities enabled on this Cosmos DB account.

ConsistencyPolicies []GetAccountConsistencyPolicy
EnableAutomaticFailover bool

If automatic failover is enabled for this CosmosDB Account.

EnableMultipleWriteLocations bool

If multi-master is enabled for this Cosmos DB account.

Endpoint string

The endpoint used to connect to the CosmosDB account.

GeoLocations []GetAccountGeoLocation
Id string

The provider-assigned unique ID for this managed resource.

IpRangeFilter string

The current IP Filter for this CosmosDB account

IsVirtualNetworkFilterEnabled bool

If virtual network filtering is enabled for this Cosmos DB account.

Kind string

The Kind of the CosmosDB account.

Location string

The name of the Azure region hosting replicated data.

Name string
OfferType string

The Offer Type to used by this CosmosDB Account.

PrimaryMasterKey string

The Primary master key for the CosmosDB Account.

PrimaryReadonlyMasterKey string

The Primary read-only master Key for the CosmosDB Account.

ReadEndpoints []string

A list of read endpoints available for this CosmosDB account.

ResourceGroupName string
SecondaryMasterKey string

The Secondary master key for the CosmosDB Account.

SecondaryReadonlyMasterKey string

The Secondary read-only master key for the CosmosDB Account.

Tags map[string]string

A mapping of tags assigned to the resource.

VirtualNetworkRules []GetAccountVirtualNetworkRule

Subnets that are allowed to access this CosmosDB account.

WriteEndpoints []string

A list of write endpoints available for this CosmosDB account.

capabilities GetAccountCapability[]

Capabilities enabled on this Cosmos DB account.

consistencyPolicies GetAccountConsistencyPolicy[]
enableAutomaticFailover boolean

If automatic failover is enabled for this CosmosDB Account.

enableMultipleWriteLocations boolean

If multi-master is enabled for this Cosmos DB account.

endpoint string

The endpoint used to connect to the CosmosDB account.

geoLocations GetAccountGeoLocation[]
id string

The provider-assigned unique ID for this managed resource.

ipRangeFilter string

The current IP Filter for this CosmosDB account

isVirtualNetworkFilterEnabled boolean

If virtual network filtering is enabled for this Cosmos DB account.

kind string

The Kind of the CosmosDB account.

location string

The name of the Azure region hosting replicated data.

name string
offerType string

The Offer Type to used by this CosmosDB Account.

primaryMasterKey string

The Primary master key for the CosmosDB Account.

primaryReadonlyMasterKey string

The Primary read-only master Key for the CosmosDB Account.

readEndpoints string[]

A list of read endpoints available for this CosmosDB account.

resourceGroupName string
secondaryMasterKey string

The Secondary master key for the CosmosDB Account.

secondaryReadonlyMasterKey string

The Secondary read-only master key for the CosmosDB Account.

tags {[key: string]: string}

A mapping of tags assigned to the resource.

virtualNetworkRules GetAccountVirtualNetworkRule[]

Subnets that are allowed to access this CosmosDB account.

writeEndpoints string[]

A list of write endpoints available for this CosmosDB account.

capabilities List[GetAccountCapability]

Capabilities enabled on this Cosmos DB account.

consistency_policies List[GetAccountConsistencyPolicy]
enable_automatic_failover bool

If automatic failover is enabled for this CosmosDB Account.

enable_multiple_write_locations bool

If multi-master is enabled for this Cosmos DB account.

endpoint str

The endpoint used to connect to the CosmosDB account.

geo_locations List[GetAccountGeoLocation]
id str

The provider-assigned unique ID for this managed resource.

ip_range_filter str

The current IP Filter for this CosmosDB account

is_virtual_network_filter_enabled bool

If virtual network filtering is enabled for this Cosmos DB account.

kind str

The Kind of the CosmosDB account.

location str

The name of the Azure region hosting replicated data.

name str
offer_type str

The Offer Type to used by this CosmosDB Account.

primary_master_key str

The Primary master key for the CosmosDB Account.

primary_readonly_master_key str

The Primary read-only master Key for the CosmosDB Account.

read_endpoints List[str]

A list of read endpoints available for this CosmosDB account.

resource_group_name str
secondary_master_key str

The Secondary master key for the CosmosDB Account.

secondary_readonly_master_key str

The Secondary read-only master key for the CosmosDB Account.

tags Dict[str, str]

A mapping of tags assigned to the resource.

virtual_network_rules List[GetAccountVirtualNetworkRule]

Subnets that are allowed to access this CosmosDB account.

write_endpoints List[str]

A list of write endpoints available for this CosmosDB account.

Supporting Types

GetAccountCapability

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Name string

Specifies the name of the CosmosDB Account.

Name string

Specifies the name of the CosmosDB Account.

name string

Specifies the name of the CosmosDB Account.

name str

Specifies the name of the CosmosDB Account.

GetAccountConsistencyPolicy

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

ConsistencyLevel string

The Consistency Level used by this CosmosDB Account.

MaxIntervalInSeconds int

The amount of staleness (in seconds) tolerated when the consistency level is Bounded Staleness.

MaxStalenessPrefix int

The number of stale requests tolerated when the consistency level is Bounded Staleness.

ConsistencyLevel string

The Consistency Level used by this CosmosDB Account.

MaxIntervalInSeconds int

The amount of staleness (in seconds) tolerated when the consistency level is Bounded Staleness.

MaxStalenessPrefix int

The number of stale requests tolerated when the consistency level is Bounded Staleness.

consistencyLevel string

The Consistency Level used by this CosmosDB Account.

maxIntervalInSeconds number

The amount of staleness (in seconds) tolerated when the consistency level is Bounded Staleness.

maxStalenessPrefix number

The number of stale requests tolerated when the consistency level is Bounded Staleness.

consistencyLevel str

The Consistency Level used by this CosmosDB Account.

maxIntervalInSeconds float

The amount of staleness (in seconds) tolerated when the consistency level is Bounded Staleness.

maxStalenessPrefix float

The number of stale requests tolerated when the consistency level is Bounded Staleness.

GetAccountGeoLocation

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

FailoverPriority int
Id string

The ID of the virtual network subnet.

Location string

The name of the Azure region hosting replicated data.

FailoverPriority int
Id string

The ID of the virtual network subnet.

Location string

The name of the Azure region hosting replicated data.

failoverPriority number
id string

The ID of the virtual network subnet.

location string

The name of the Azure region hosting replicated data.

failoverPriority float
id str

The ID of the virtual network subnet.

location str

The name of the Azure region hosting replicated data.

GetAccountVirtualNetworkRule

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Id string

The ID of the virtual network subnet.

Id string

The ID of the virtual network subnet.

id string

The ID of the virtual network subnet.

id str

The ID of the virtual network subnet.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.