Class Database
Allows you to manage an Azure SQL Database
Inherited Members
Namespace: Pulumi.Azure.Sql
Assembly: Pulumi.Azure.dll
Syntax
public class Database : CustomResource
Constructors
View SourceDatabase(String, DatabaseArgs, CustomResourceOptions)
Create a Database resource with the given unique name, arguments, and options.
Declaration
public Database(string name, DatabaseArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| DatabaseArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCollation
The name of the collation. Applies only if create_mode is Default. Azure default is SQL_LATIN1_GENERAL_CP1_CI_AS. Changing this forces a new resource to be created.
Declaration
public Output<string> Collation { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CreateMode
Specifies how to create the database. Valid values are: Default, Copy, OnlineSecondary, NonReadableSecondary, PointInTimeRestore, Recovery, Restore or RestoreLongTermRetentionBackup. Must be Default to create a new database. Defaults to Default. Please see Azure SQL Database REST API
Declaration
public Output<string> CreateMode { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CreationDate
The creation date of the SQL Database.
Declaration
public Output<string> CreationDate { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DefaultSecondaryLocation
The default secondary location of the SQL Database.
Declaration
public Output<string> DefaultSecondaryLocation { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Edition
The edition of the database to be created. Applies only if create_mode is Default. Valid values are: Basic, Standard, Premium, DataWarehouse, Business, BusinessCritical, Free, GeneralPurpose, Hyperscale, Premium, PremiumRS, Standard, Stretch, System, System2, or Web. Please see Azure SQL Database Service Tiers.
Declaration
public Output<string> Edition { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ElasticPoolName
The name of the elastic database pool.
Declaration
public Output<string> ElasticPoolName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Encryption
Declaration
public Output<string> Encryption { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ExtendedAuditingPolicy
A extended_auditing_policy block as defined below.
Declaration
public Output<DatabaseExtendedAuditingPolicy> ExtendedAuditingPolicy { get; }
Property Value
| Type | Description |
|---|---|
| Output<DatabaseExtendedAuditingPolicy> |
Import
A Database Import block as documented below. create_mode must be set to Default.
Declaration
public Output<DatabaseImport> Import { get; }
Property Value
| Type | Description |
|---|---|
| Output<DatabaseImport> |
Location
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Declaration
public Output<string> Location { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
MaxSizeBytes
The maximum size that the database can grow to. Applies only if create_mode is Default. Please see Azure SQL Database Service Tiers.
Declaration
public Output<string> MaxSizeBytes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
MaxSizeGb
Declaration
public Output<string> MaxSizeGb { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
The name of the database.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ReadScale
Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.
Declaration
public Output<bool?> ReadScale { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
RequestedServiceObjectiveId
A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level. .
Declaration
public Output<string> RequestedServiceObjectiveId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RequestedServiceObjectiveName
The service objective name for the database. Valid values depend on edition and location and may include S0, S1, S2, S3, P1, P2, P4, P6, P11 and ElasticPool. You can list the available names with the cli: shell az sql db list-editions -l westus --edition Standard -o table. For further information please see Azure CLI - az sql db.
Declaration
public Output<string> RequestedServiceObjectiveName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ResourceGroupName
The name of the resource group in which to create the database. This must be the same as Database Server resource group currently.
Declaration
public Output<string> ResourceGroupName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RestorePointInTime
The point in time for the restore. Only applies if create_mode is PointInTimeRestore e.g. 2013-11-08T22:00:40Z
Declaration
public Output<string> RestorePointInTime { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ServerName
The name of the SQL Server on which to create the database.
Declaration
public Output<string> ServerName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SourceDatabaseDeletionDate
The deletion date time of the source database. Only applies to deleted databases where create_mode is PointInTimeRestore.
Declaration
public Output<string> SourceDatabaseDeletionDate { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SourceDatabaseId
The URI of the source database if create_mode value is not Default.
Declaration
public Output<string> SourceDatabaseId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tags
A mapping of tags to assign to the resource.
Declaration
public Output<ImmutableDictionary<string, string>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
ThreatDetectionPolicy
Threat detection policy configuration. The threat_detection_policy block supports fields documented below.
Declaration
public Output<DatabaseThreatDetectionPolicy> ThreatDetectionPolicy { get; }
Property Value
| Type | Description |
|---|---|
| Output<DatabaseThreatDetectionPolicy> |
ZoneRedundant
Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
Declaration
public Output<bool?> ZoneRedundant { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Methods
View SourceGet(String, Input<String>, DatabaseState, CustomResourceOptions)
Get an existing Database resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Database Get(string name, Input<string> id, DatabaseState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| DatabaseState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Database |