1. Packages
  2. Azure Classic
  3. API Docs
  4. cosmosdb
  5. getSqlDatabase

We recommend using Azure Native.

Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi

azure.cosmosdb.getSqlDatabase

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi

    Use this data source to access information about an existing CosmosDB SQL Database.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.cosmosdb.getSqlDatabase({
        name: "tfex-cosmosdb-sql-database",
        resourceGroupName: "tfex-cosmosdb-sql-database-rg",
        accountName: "tfex-cosmosdb-sql-database-account-name",
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.cosmosdb.get_sql_database(name="tfex-cosmosdb-sql-database",
        resource_group_name="tfex-cosmosdb-sql-database-rg",
        account_name="tfex-cosmosdb-sql-database-account-name")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cosmosdb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cosmosdb.LookupSqlDatabase(ctx, &cosmosdb.LookupSqlDatabaseArgs{
    			Name:              "tfex-cosmosdb-sql-database",
    			ResourceGroupName: "tfex-cosmosdb-sql-database-rg",
    			AccountName:       "tfex-cosmosdb-sql-database-account-name",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.CosmosDB.GetSqlDatabase.Invoke(new()
        {
            Name = "tfex-cosmosdb-sql-database",
            ResourceGroupName = "tfex-cosmosdb-sql-database-rg",
            AccountName = "tfex-cosmosdb-sql-database-account-name",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.cosmosdb.CosmosdbFunctions;
    import com.pulumi.azure.cosmosdb.inputs.GetSqlDatabaseArgs;
    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 = CosmosdbFunctions.getSqlDatabase(GetSqlDatabaseArgs.builder()
                .name("tfex-cosmosdb-sql-database")
                .resourceGroupName("tfex-cosmosdb-sql-database-rg")
                .accountName("tfex-cosmosdb-sql-database-account-name")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:cosmosdb:getSqlDatabase
          Arguments:
            name: tfex-cosmosdb-sql-database
            resourceGroupName: tfex-cosmosdb-sql-database-rg
            accountName: tfex-cosmosdb-sql-database-account-name
    

    Using getSqlDatabase

    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 getSqlDatabase(args: GetSqlDatabaseArgs, opts?: InvokeOptions): Promise<GetSqlDatabaseResult>
    function getSqlDatabaseOutput(args: GetSqlDatabaseOutputArgs, opts?: InvokeOptions): Output<GetSqlDatabaseResult>
    def get_sql_database(account_name: Optional[str] = None,
                         name: Optional[str] = None,
                         resource_group_name: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetSqlDatabaseResult
    def get_sql_database_output(account_name: Optional[pulumi.Input[str]] = None,
                         name: Optional[pulumi.Input[str]] = None,
                         resource_group_name: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetSqlDatabaseResult]
    func LookupSqlDatabase(ctx *Context, args *LookupSqlDatabaseArgs, opts ...InvokeOption) (*LookupSqlDatabaseResult, error)
    func LookupSqlDatabaseOutput(ctx *Context, args *LookupSqlDatabaseOutputArgs, opts ...InvokeOption) LookupSqlDatabaseResultOutput

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

    public static class GetSqlDatabase 
    {
        public static Task<GetSqlDatabaseResult> InvokeAsync(GetSqlDatabaseArgs args, InvokeOptions? opts = null)
        public static Output<GetSqlDatabaseResult> Invoke(GetSqlDatabaseInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSqlDatabaseResult> getSqlDatabase(GetSqlDatabaseArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:cosmosdb/getSqlDatabase:getSqlDatabase
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountName string
    The name of the Cosmos DB SQL Database to create the table within.
    Name string
    Specifies the name of the Cosmos DB SQL Database.
    ResourceGroupName string
    The name of the resource group in which the Cosmos DB SQL Database is created.
    AccountName string
    The name of the Cosmos DB SQL Database to create the table within.
    Name string
    Specifies the name of the Cosmos DB SQL Database.
    ResourceGroupName string
    The name of the resource group in which the Cosmos DB SQL Database is created.
    accountName String
    The name of the Cosmos DB SQL Database to create the table within.
    name String
    Specifies the name of the Cosmos DB SQL Database.
    resourceGroupName String
    The name of the resource group in which the Cosmos DB SQL Database is created.
    accountName string
    The name of the Cosmos DB SQL Database to create the table within.
    name string
    Specifies the name of the Cosmos DB SQL Database.
    resourceGroupName string
    The name of the resource group in which the Cosmos DB SQL Database is created.
    account_name str
    The name of the Cosmos DB SQL Database to create the table within.
    name str
    Specifies the name of the Cosmos DB SQL Database.
    resource_group_name str
    The name of the resource group in which the Cosmos DB SQL Database is created.
    accountName String
    The name of the Cosmos DB SQL Database to create the table within.
    name String
    Specifies the name of the Cosmos DB SQL Database.
    resourceGroupName String
    The name of the resource group in which the Cosmos DB SQL Database is created.

    getSqlDatabase Result

    The following output properties are available:

    AccountName string
    AutoscaleSettings List<GetSqlDatabaseAutoscaleSetting>
    An autoscale_settings block as defined below.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    ResourceGroupName string
    Throughput int
    The throughput of SQL database (RU/s).
    AccountName string
    AutoscaleSettings []GetSqlDatabaseAutoscaleSetting
    An autoscale_settings block as defined below.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    ResourceGroupName string
    Throughput int
    The throughput of SQL database (RU/s).
    accountName String
    autoscaleSettings List<GetSqlDatabaseAutoscaleSetting>
    An autoscale_settings block as defined below.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    resourceGroupName String
    throughput Integer
    The throughput of SQL database (RU/s).
    accountName string
    autoscaleSettings GetSqlDatabaseAutoscaleSetting[]
    An autoscale_settings block as defined below.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    resourceGroupName string
    throughput number
    The throughput of SQL database (RU/s).
    account_name str
    autoscale_settings Sequence[GetSqlDatabaseAutoscaleSetting]
    An autoscale_settings block as defined below.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    resource_group_name str
    throughput int
    The throughput of SQL database (RU/s).
    accountName String
    autoscaleSettings List<Property Map>
    An autoscale_settings block as defined below.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    resourceGroupName String
    throughput Number
    The throughput of SQL database (RU/s).

    Supporting Types

    GetSqlDatabaseAutoscaleSetting

    MaxThroughput int
    The maximum throughput of the SQL database (RU/s).
    MaxThroughput int
    The maximum throughput of the SQL database (RU/s).
    maxThroughput Integer
    The maximum throughput of the SQL database (RU/s).
    maxThroughput number
    The maximum throughput of the SQL database (RU/s).
    max_throughput int
    The maximum throughput of the SQL database (RU/s).
    maxThroughput Number
    The maximum throughput of the SQL database (RU/s).

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi