We recommend using Azure Native.
Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi
azure.cosmosdb.getSqlDatabase
Explore with Pulumi AI
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:
- Account
Name 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.
- Resource
Group stringName - The name of the resource group in which the Cosmos DB SQL Database is created.
- Account
Name 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.
- Resource
Group stringName - The name of the resource group in which the Cosmos DB SQL Database is created.
- account
Name 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.
- resource
Group StringName - The name of the resource group in which the Cosmos DB SQL Database is created.
- account
Name 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.
- resource
Group stringName - 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_ strname - The name of the resource group in which the Cosmos DB SQL Database is created.
- account
Name 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.
- resource
Group StringName - The name of the resource group in which the Cosmos DB SQL Database is created.
getSqlDatabase Result
The following output properties are available:
- Account
Name string - Autoscale
Settings List<GetSql Database Autoscale Setting> - An
autoscale_settings
block as defined below. - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource
Group stringName - Throughput int
- The throughput of SQL database (RU/s).
- Account
Name string - Autoscale
Settings []GetSql Database Autoscale Setting - An
autoscale_settings
block as defined below. - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource
Group stringName - Throughput int
- The throughput of SQL database (RU/s).
- account
Name String - autoscale
Settings List<GetSql Database Autoscale Setting> - An
autoscale_settings
block as defined below. - id String
- The provider-assigned unique ID for this managed resource.
- name String
- resource
Group StringName - throughput Integer
- The throughput of SQL database (RU/s).
- account
Name string - autoscale
Settings GetSql Database Autoscale Setting[] - An
autoscale_settings
block as defined below. - id string
- The provider-assigned unique ID for this managed resource.
- name string
- resource
Group stringName - throughput number
- The throughput of SQL database (RU/s).
- account_
name str - autoscale_
settings Sequence[GetSql Database Autoscale Setting] - An
autoscale_settings
block as defined below. - id str
- The provider-assigned unique ID for this managed resource.
- name str
- resource_
group_ strname - throughput int
- The throughput of SQL database (RU/s).
- account
Name String - autoscale
Settings List<Property Map> - An
autoscale_settings
block as defined below. - id String
- The provider-assigned unique ID for this managed resource.
- name String
- resource
Group StringName - throughput Number
- The throughput of SQL database (RU/s).
Supporting Types
GetSqlDatabaseAutoscaleSetting
- Max
Throughput int - The maximum throughput of the SQL database (RU/s).
- Max
Throughput int - The maximum throughput of the SQL database (RU/s).
- max
Throughput Integer - The maximum throughput of the SQL database (RU/s).
- max
Throughput number - The maximum throughput of the SQL database (RU/s).
- max_
throughput int - The maximum throughput of the SQL database (RU/s).
- max
Throughput 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.