We recommend using Azure Native.
azure.sql.Database
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleSqlServer = new azure.sql.SqlServer("example", {
name: "myexamplesqlserver",
resourceGroupName: example.name,
location: example.location,
version: "12.0",
administratorLogin: "4dm1n157r470r",
administratorLoginPassword: "4-v3ry-53cr37-p455w0rd",
tags: {
environment: "production",
},
});
const exampleAccount = new azure.storage.Account("example", {
name: "examplesa",
resourceGroupName: example.name,
location: example.location,
accountTier: "Standard",
accountReplicationType: "LRS",
});
const exampleDatabase = new azure.sql.Database("example", {
name: "myexamplesqldatabase",
resourceGroupName: example.name,
location: example.location,
serverName: exampleSqlServer.name,
tags: {
environment: "production",
},
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_sql_server = azure.sql.SqlServer("example",
name="myexamplesqlserver",
resource_group_name=example.name,
location=example.location,
version="12.0",
administrator_login="4dm1n157r470r",
administrator_login_password="4-v3ry-53cr37-p455w0rd",
tags={
"environment": "production",
})
example_account = azure.storage.Account("example",
name="examplesa",
resource_group_name=example.name,
location=example.location,
account_tier="Standard",
account_replication_type="LRS")
example_database = azure.sql.Database("example",
name="myexamplesqldatabase",
resource_group_name=example.name,
location=example.location,
server_name=example_sql_server.name,
tags={
"environment": "production",
})
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleSqlServer, err := sql.NewSqlServer(ctx, "example", &sql.SqlServerArgs{
Name: pulumi.String("myexamplesqlserver"),
ResourceGroupName: example.Name,
Location: example.Location,
Version: pulumi.String("12.0"),
AdministratorLogin: pulumi.String("4dm1n157r470r"),
AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"),
Tags: pulumi.StringMap{
"environment": pulumi.String("production"),
},
})
if err != nil {
return err
}
_, err = storage.NewAccount(ctx, "example", &storage.AccountArgs{
Name: pulumi.String("examplesa"),
ResourceGroupName: example.Name,
Location: example.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("LRS"),
})
if err != nil {
return err
}
_, err = sql.NewDatabase(ctx, "example", &sql.DatabaseArgs{
Name: pulumi.String("myexamplesqldatabase"),
ResourceGroupName: example.Name,
Location: example.Location,
ServerName: exampleSqlServer.Name,
Tags: pulumi.StringMap{
"environment": pulumi.String("production"),
},
})
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 = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleSqlServer = new Azure.Sql.SqlServer("example", new()
{
Name = "myexamplesqlserver",
ResourceGroupName = example.Name,
Location = example.Location,
Version = "12.0",
AdministratorLogin = "4dm1n157r470r",
AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd",
Tags =
{
{ "environment", "production" },
},
});
var exampleAccount = new Azure.Storage.Account("example", new()
{
Name = "examplesa",
ResourceGroupName = example.Name,
Location = example.Location,
AccountTier = "Standard",
AccountReplicationType = "LRS",
});
var exampleDatabase = new Azure.Sql.Database("example", new()
{
Name = "myexamplesqldatabase",
ResourceGroupName = example.Name,
Location = example.Location,
ServerName = exampleSqlServer.Name,
Tags =
{
{ "environment", "production" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.sql.SqlServer;
import com.pulumi.azure.sql.SqlServerArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.sql.Database;
import com.pulumi.azure.sql.DatabaseArgs;
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) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleSqlServer = new SqlServer("exampleSqlServer", SqlServerArgs.builder()
.name("myexamplesqlserver")
.resourceGroupName(example.name())
.location(example.location())
.version("12.0")
.administratorLogin("4dm1n157r470r")
.administratorLoginPassword("4-v3ry-53cr37-p455w0rd")
.tags(Map.of("environment", "production"))
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("examplesa")
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountReplicationType("LRS")
.build());
var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()
.name("myexamplesqldatabase")
.resourceGroupName(example.name())
.location(example.location())
.serverName(exampleSqlServer.name())
.tags(Map.of("environment", "production"))
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleSqlServer:
type: azure:sql:SqlServer
name: example
properties:
name: myexamplesqlserver
resourceGroupName: ${example.name}
location: ${example.location}
version: '12.0'
administratorLogin: 4dm1n157r470r
administratorLoginPassword: 4-v3ry-53cr37-p455w0rd
tags:
environment: production
exampleAccount:
type: azure:storage:Account
name: example
properties:
name: examplesa
resourceGroupName: ${example.name}
location: ${example.location}
accountTier: Standard
accountReplicationType: LRS
exampleDatabase:
type: azure:sql:Database
name: example
properties:
name: myexamplesqldatabase
resourceGroupName: ${example.name}
location: ${example.location}
serverName: ${exampleSqlServer.name}
tags:
environment: production
Create Database Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Database(name: string, args: DatabaseArgs, opts?: CustomResourceOptions);
@overload
def Database(resource_name: str,
args: DatabaseArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Database(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_group_name: Optional[str] = None,
server_name: Optional[str] = None,
requested_service_objective_id: Optional[str] = None,
requested_service_objective_name: Optional[str] = None,
import_: Optional[DatabaseImportArgs] = None,
location: Optional[str] = None,
max_size_bytes: Optional[str] = None,
max_size_gb: Optional[str] = None,
name: Optional[str] = None,
read_scale: Optional[bool] = None,
collation: Optional[str] = None,
elastic_pool_name: Optional[str] = None,
edition: Optional[str] = None,
restore_point_in_time: Optional[str] = None,
create_mode: Optional[str] = None,
source_database_deletion_date: Optional[str] = None,
source_database_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
threat_detection_policy: Optional[DatabaseThreatDetectionPolicyArgs] = None,
zone_redundant: Optional[bool] = None)
func NewDatabase(ctx *Context, name string, args DatabaseArgs, opts ...ResourceOption) (*Database, error)
public Database(string name, DatabaseArgs args, CustomResourceOptions? opts = null)
public Database(String name, DatabaseArgs args)
public Database(String name, DatabaseArgs args, CustomResourceOptions options)
type: azure:sql:Database
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var exampledatabaseResourceResourceFromSqldatabase = new Azure.Sql.Database("exampledatabaseResourceResourceFromSqldatabase", new()
{
ResourceGroupName = "string",
ServerName = "string",
RequestedServiceObjectiveId = "string",
RequestedServiceObjectiveName = "string",
Import = new Azure.Sql.Inputs.DatabaseImportArgs
{
AdministratorLogin = "string",
AdministratorLoginPassword = "string",
AuthenticationType = "string",
StorageKey = "string",
StorageKeyType = "string",
StorageUri = "string",
OperationMode = "string",
},
Location = "string",
MaxSizeBytes = "string",
MaxSizeGb = "string",
Name = "string",
ReadScale = false,
Collation = "string",
ElasticPoolName = "string",
Edition = "string",
RestorePointInTime = "string",
CreateMode = "string",
SourceDatabaseDeletionDate = "string",
SourceDatabaseId = "string",
Tags =
{
{ "string", "string" },
},
ThreatDetectionPolicy = new Azure.Sql.Inputs.DatabaseThreatDetectionPolicyArgs
{
DisabledAlerts = new[]
{
"string",
},
EmailAccountAdmins = "string",
EmailAddresses = new[]
{
"string",
},
RetentionDays = 0,
State = "string",
StorageAccountAccessKey = "string",
StorageEndpoint = "string",
},
ZoneRedundant = false,
});
example, err := sql.NewDatabase(ctx, "exampledatabaseResourceResourceFromSqldatabase", &sql.DatabaseArgs{
ResourceGroupName: pulumi.String("string"),
ServerName: pulumi.String("string"),
RequestedServiceObjectiveId: pulumi.String("string"),
RequestedServiceObjectiveName: pulumi.String("string"),
Import: &sql.DatabaseImportArgs{
AdministratorLogin: pulumi.String("string"),
AdministratorLoginPassword: pulumi.String("string"),
AuthenticationType: pulumi.String("string"),
StorageKey: pulumi.String("string"),
StorageKeyType: pulumi.String("string"),
StorageUri: pulumi.String("string"),
OperationMode: pulumi.String("string"),
},
Location: pulumi.String("string"),
MaxSizeBytes: pulumi.String("string"),
MaxSizeGb: pulumi.String("string"),
Name: pulumi.String("string"),
ReadScale: pulumi.Bool(false),
Collation: pulumi.String("string"),
ElasticPoolName: pulumi.String("string"),
Edition: pulumi.String("string"),
RestorePointInTime: pulumi.String("string"),
CreateMode: pulumi.String("string"),
SourceDatabaseDeletionDate: pulumi.String("string"),
SourceDatabaseId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
ThreatDetectionPolicy: &sql.DatabaseThreatDetectionPolicyArgs{
DisabledAlerts: pulumi.StringArray{
pulumi.String("string"),
},
EmailAccountAdmins: pulumi.String("string"),
EmailAddresses: pulumi.StringArray{
pulumi.String("string"),
},
RetentionDays: pulumi.Int(0),
State: pulumi.String("string"),
StorageAccountAccessKey: pulumi.String("string"),
StorageEndpoint: pulumi.String("string"),
},
ZoneRedundant: pulumi.Bool(false),
})
var exampledatabaseResourceResourceFromSqldatabase = new Database("exampledatabaseResourceResourceFromSqldatabase", DatabaseArgs.builder()
.resourceGroupName("string")
.serverName("string")
.requestedServiceObjectiveId("string")
.requestedServiceObjectiveName("string")
.import_(DatabaseImportArgs.builder()
.administratorLogin("string")
.administratorLoginPassword("string")
.authenticationType("string")
.storageKey("string")
.storageKeyType("string")
.storageUri("string")
.operationMode("string")
.build())
.location("string")
.maxSizeBytes("string")
.maxSizeGb("string")
.name("string")
.readScale(false)
.collation("string")
.elasticPoolName("string")
.edition("string")
.restorePointInTime("string")
.createMode("string")
.sourceDatabaseDeletionDate("string")
.sourceDatabaseId("string")
.tags(Map.of("string", "string"))
.threatDetectionPolicy(DatabaseThreatDetectionPolicyArgs.builder()
.disabledAlerts("string")
.emailAccountAdmins("string")
.emailAddresses("string")
.retentionDays(0)
.state("string")
.storageAccountAccessKey("string")
.storageEndpoint("string")
.build())
.zoneRedundant(false)
.build());
exampledatabase_resource_resource_from_sqldatabase = azure.sql.Database("exampledatabaseResourceResourceFromSqldatabase",
resource_group_name="string",
server_name="string",
requested_service_objective_id="string",
requested_service_objective_name="string",
import_=azure.sql.DatabaseImportArgs(
administrator_login="string",
administrator_login_password="string",
authentication_type="string",
storage_key="string",
storage_key_type="string",
storage_uri="string",
operation_mode="string",
),
location="string",
max_size_bytes="string",
max_size_gb="string",
name="string",
read_scale=False,
collation="string",
elastic_pool_name="string",
edition="string",
restore_point_in_time="string",
create_mode="string",
source_database_deletion_date="string",
source_database_id="string",
tags={
"string": "string",
},
threat_detection_policy=azure.sql.DatabaseThreatDetectionPolicyArgs(
disabled_alerts=["string"],
email_account_admins="string",
email_addresses=["string"],
retention_days=0,
state="string",
storage_account_access_key="string",
storage_endpoint="string",
),
zone_redundant=False)
const exampledatabaseResourceResourceFromSqldatabase = new azure.sql.Database("exampledatabaseResourceResourceFromSqldatabase", {
resourceGroupName: "string",
serverName: "string",
requestedServiceObjectiveId: "string",
requestedServiceObjectiveName: "string",
"import": {
administratorLogin: "string",
administratorLoginPassword: "string",
authenticationType: "string",
storageKey: "string",
storageKeyType: "string",
storageUri: "string",
operationMode: "string",
},
location: "string",
maxSizeBytes: "string",
maxSizeGb: "string",
name: "string",
readScale: false,
collation: "string",
elasticPoolName: "string",
edition: "string",
restorePointInTime: "string",
createMode: "string",
sourceDatabaseDeletionDate: "string",
sourceDatabaseId: "string",
tags: {
string: "string",
},
threatDetectionPolicy: {
disabledAlerts: ["string"],
emailAccountAdmins: "string",
emailAddresses: ["string"],
retentionDays: 0,
state: "string",
storageAccountAccessKey: "string",
storageEndpoint: "string",
},
zoneRedundant: false,
});
type: azure:sql:Database
properties:
collation: string
createMode: string
edition: string
elasticPoolName: string
import:
administratorLogin: string
administratorLoginPassword: string
authenticationType: string
operationMode: string
storageKey: string
storageKeyType: string
storageUri: string
location: string
maxSizeBytes: string
maxSizeGb: string
name: string
readScale: false
requestedServiceObjectiveId: string
requestedServiceObjectiveName: string
resourceGroupName: string
restorePointInTime: string
serverName: string
sourceDatabaseDeletionDate: string
sourceDatabaseId: string
tags:
string: string
threatDetectionPolicy:
disabledAlerts:
- string
emailAccountAdmins: string
emailAddresses:
- string
retentionDays: 0
state: string
storageAccountAccessKey: string
storageEndpoint: string
zoneRedundant: false
Database Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Database resource accepts the following input properties:
- Resource
Group stringName - The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
- Server
Name string - The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
- Collation string
- The name of the collation. Applies only if
create_mode
isDefault
. Azure default isSQL_LATIN1_GENERAL_CP1_CI_AS
. Changing this forces a new resource to be created. - Create
Mode string - Specifies how to create the database. Valid values are:
Default
,Copy
,OnlineSecondary
,NonReadableSecondary
,PointInTimeRestore
,Recovery
,Restore
orRestoreLongTermRetentionBackup
. Must beDefault
to create a new database. Defaults toDefault
. Please see Azure SQL Database REST API - Edition string
- The edition of the database to be created. Applies only if
create_mode
isDefault
. Valid values are:Basic
,Standard
,Premium
,DataWarehouse
,Business
,BusinessCritical
,Free
,GeneralPurpose
,Hyperscale
,Premium
,PremiumRS
,Standard
,Stretch
,System
,System2
, orWeb
. Please see Azure SQL database models. - Elastic
Pool stringName - The name of the elastic database pool.
- Import
Database
Import - A
import
block as documented below.create_mode
must be set toDefault
. - Location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Max
Size stringBytes - The maximum size that the database can grow to. Applies only if
create_mode
isDefault
. Please see Azure SQL database models. - Max
Size stringGb - Name string
- The name of the database. Changing this forces a new resource to be created.
- Read
Scale bool - Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.
- Requested
Service stringObjective Id - A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level. .
- Requested
Service stringObjective Name - 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
andElasticPool
. You can list the available names with the CLI:shell az sql db list-editions -l westus -o table
. For further information please see Azure CLI - az sql db. - Restore
Point stringIn Time - The point in time for the restore. Only applies if
create_mode
isPointInTimeRestore
, it should be provided in RFC3339 format, e.g.2013-11-08T22:00:40Z
. - Source
Database stringDeletion Date - The deletion date time of the source database. Only applies to deleted databases where
create_mode
isPointInTimeRestore
. - Source
Database stringId - The URI of the source database if
create_mode
value is notDefault
. - Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Threat
Detection DatabasePolicy Threat Detection Policy - Threat detection policy configuration. The
threat_detection_policy
block supports fields documented below. - Zone
Redundant bool - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
- Resource
Group stringName - The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
- Server
Name string - The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
- Collation string
- The name of the collation. Applies only if
create_mode
isDefault
. Azure default isSQL_LATIN1_GENERAL_CP1_CI_AS
. Changing this forces a new resource to be created. - Create
Mode string - Specifies how to create the database. Valid values are:
Default
,Copy
,OnlineSecondary
,NonReadableSecondary
,PointInTimeRestore
,Recovery
,Restore
orRestoreLongTermRetentionBackup
. Must beDefault
to create a new database. Defaults toDefault
. Please see Azure SQL Database REST API - Edition string
- The edition of the database to be created. Applies only if
create_mode
isDefault
. Valid values are:Basic
,Standard
,Premium
,DataWarehouse
,Business
,BusinessCritical
,Free
,GeneralPurpose
,Hyperscale
,Premium
,PremiumRS
,Standard
,Stretch
,System
,System2
, orWeb
. Please see Azure SQL database models. - Elastic
Pool stringName - The name of the elastic database pool.
- Import
Database
Import Args - A
import
block as documented below.create_mode
must be set toDefault
. - Location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Max
Size stringBytes - The maximum size that the database can grow to. Applies only if
create_mode
isDefault
. Please see Azure SQL database models. - Max
Size stringGb - Name string
- The name of the database. Changing this forces a new resource to be created.
- Read
Scale bool - Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.
- Requested
Service stringObjective Id - A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level. .
- Requested
Service stringObjective Name - 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
andElasticPool
. You can list the available names with the CLI:shell az sql db list-editions -l westus -o table
. For further information please see Azure CLI - az sql db. - Restore
Point stringIn Time - The point in time for the restore. Only applies if
create_mode
isPointInTimeRestore
, it should be provided in RFC3339 format, e.g.2013-11-08T22:00:40Z
. - Source
Database stringDeletion Date - The deletion date time of the source database. Only applies to deleted databases where
create_mode
isPointInTimeRestore
. - Source
Database stringId - The URI of the source database if
create_mode
value is notDefault
. - map[string]string
- A mapping of tags to assign to the resource.
- Threat
Detection DatabasePolicy Threat Detection Policy Args - Threat detection policy configuration. The
threat_detection_policy
block supports fields documented below. - Zone
Redundant bool - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
- resource
Group StringName - The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
- server
Name String - The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
- collation String
- The name of the collation. Applies only if
create_mode
isDefault
. Azure default isSQL_LATIN1_GENERAL_CP1_CI_AS
. Changing this forces a new resource to be created. - create
Mode String - Specifies how to create the database. Valid values are:
Default
,Copy
,OnlineSecondary
,NonReadableSecondary
,PointInTimeRestore
,Recovery
,Restore
orRestoreLongTermRetentionBackup
. Must beDefault
to create a new database. Defaults toDefault
. Please see Azure SQL Database REST API - edition String
- The edition of the database to be created. Applies only if
create_mode
isDefault
. Valid values are:Basic
,Standard
,Premium
,DataWarehouse
,Business
,BusinessCritical
,Free
,GeneralPurpose
,Hyperscale
,Premium
,PremiumRS
,Standard
,Stretch
,System
,System2
, orWeb
. Please see Azure SQL database models. - elastic
Pool StringName - The name of the elastic database pool.
- import_
Database
Import - A
import
block as documented below.create_mode
must be set toDefault
. - location String
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- max
Size StringBytes - The maximum size that the database can grow to. Applies only if
create_mode
isDefault
. Please see Azure SQL database models. - max
Size StringGb - name String
- The name of the database. Changing this forces a new resource to be created.
- read
Scale Boolean - Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.
- requested
Service StringObjective Id - A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level. .
- requested
Service StringObjective Name - 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
andElasticPool
. You can list the available names with the CLI:shell az sql db list-editions -l westus -o table
. For further information please see Azure CLI - az sql db. - restore
Point StringIn Time - The point in time for the restore. Only applies if
create_mode
isPointInTimeRestore
, it should be provided in RFC3339 format, e.g.2013-11-08T22:00:40Z
. - source
Database StringDeletion Date - The deletion date time of the source database. Only applies to deleted databases where
create_mode
isPointInTimeRestore
. - source
Database StringId - The URI of the source database if
create_mode
value is notDefault
. - Map<String,String>
- A mapping of tags to assign to the resource.
- threat
Detection DatabasePolicy Threat Detection Policy - Threat detection policy configuration. The
threat_detection_policy
block supports fields documented below. - zone
Redundant Boolean - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
- resource
Group stringName - The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
- server
Name string - The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
- collation string
- The name of the collation. Applies only if
create_mode
isDefault
. Azure default isSQL_LATIN1_GENERAL_CP1_CI_AS
. Changing this forces a new resource to be created. - create
Mode string - Specifies how to create the database. Valid values are:
Default
,Copy
,OnlineSecondary
,NonReadableSecondary
,PointInTimeRestore
,Recovery
,Restore
orRestoreLongTermRetentionBackup
. Must beDefault
to create a new database. Defaults toDefault
. Please see Azure SQL Database REST API - edition string
- The edition of the database to be created. Applies only if
create_mode
isDefault
. Valid values are:Basic
,Standard
,Premium
,DataWarehouse
,Business
,BusinessCritical
,Free
,GeneralPurpose
,Hyperscale
,Premium
,PremiumRS
,Standard
,Stretch
,System
,System2
, orWeb
. Please see Azure SQL database models. - elastic
Pool stringName - The name of the elastic database pool.
- import
Database
Import - A
import
block as documented below.create_mode
must be set toDefault
. - location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- max
Size stringBytes - The maximum size that the database can grow to. Applies only if
create_mode
isDefault
. Please see Azure SQL database models. - max
Size stringGb - name string
- The name of the database. Changing this forces a new resource to be created.
- read
Scale boolean - Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.
- requested
Service stringObjective Id - A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level. .
- requested
Service stringObjective Name - 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
andElasticPool
. You can list the available names with the CLI:shell az sql db list-editions -l westus -o table
. For further information please see Azure CLI - az sql db. - restore
Point stringIn Time - The point in time for the restore. Only applies if
create_mode
isPointInTimeRestore
, it should be provided in RFC3339 format, e.g.2013-11-08T22:00:40Z
. - source
Database stringDeletion Date - The deletion date time of the source database. Only applies to deleted databases where
create_mode
isPointInTimeRestore
. - source
Database stringId - The URI of the source database if
create_mode
value is notDefault
. - {[key: string]: string}
- A mapping of tags to assign to the resource.
- threat
Detection DatabasePolicy Threat Detection Policy - Threat detection policy configuration. The
threat_detection_policy
block supports fields documented below. - zone
Redundant boolean - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
- resource_
group_ strname - The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
- server_
name str - The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
- collation str
- The name of the collation. Applies only if
create_mode
isDefault
. Azure default isSQL_LATIN1_GENERAL_CP1_CI_AS
. Changing this forces a new resource to be created. - create_
mode str - Specifies how to create the database. Valid values are:
Default
,Copy
,OnlineSecondary
,NonReadableSecondary
,PointInTimeRestore
,Recovery
,Restore
orRestoreLongTermRetentionBackup
. Must beDefault
to create a new database. Defaults toDefault
. Please see Azure SQL Database REST API - edition str
- The edition of the database to be created. Applies only if
create_mode
isDefault
. Valid values are:Basic
,Standard
,Premium
,DataWarehouse
,Business
,BusinessCritical
,Free
,GeneralPurpose
,Hyperscale
,Premium
,PremiumRS
,Standard
,Stretch
,System
,System2
, orWeb
. Please see Azure SQL database models. - elastic_
pool_ strname - The name of the elastic database pool.
- import_
Database
Import Args - A
import
block as documented below.create_mode
must be set toDefault
. - location str
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- max_
size_ strbytes - The maximum size that the database can grow to. Applies only if
create_mode
isDefault
. Please see Azure SQL database models. - max_
size_ strgb - name str
- The name of the database. Changing this forces a new resource to be created.
- read_
scale bool - Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.
- requested_
service_ strobjective_ id - A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level. .
- requested_
service_ strobjective_ name - 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
andElasticPool
. You can list the available names with the CLI:shell az sql db list-editions -l westus -o table
. For further information please see Azure CLI - az sql db. - restore_
point_ strin_ time - The point in time for the restore. Only applies if
create_mode
isPointInTimeRestore
, it should be provided in RFC3339 format, e.g.2013-11-08T22:00:40Z
. - source_
database_ strdeletion_ date - The deletion date time of the source database. Only applies to deleted databases where
create_mode
isPointInTimeRestore
. - source_
database_ strid - The URI of the source database if
create_mode
value is notDefault
. - Mapping[str, str]
- A mapping of tags to assign to the resource.
- threat_
detection_ Databasepolicy Threat Detection Policy Args - Threat detection policy configuration. The
threat_detection_policy
block supports fields documented below. - zone_
redundant bool - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
- resource
Group StringName - The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
- server
Name String - The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
- collation String
- The name of the collation. Applies only if
create_mode
isDefault
. Azure default isSQL_LATIN1_GENERAL_CP1_CI_AS
. Changing this forces a new resource to be created. - create
Mode String - Specifies how to create the database. Valid values are:
Default
,Copy
,OnlineSecondary
,NonReadableSecondary
,PointInTimeRestore
,Recovery
,Restore
orRestoreLongTermRetentionBackup
. Must beDefault
to create a new database. Defaults toDefault
. Please see Azure SQL Database REST API - edition String
- The edition of the database to be created. Applies only if
create_mode
isDefault
. Valid values are:Basic
,Standard
,Premium
,DataWarehouse
,Business
,BusinessCritical
,Free
,GeneralPurpose
,Hyperscale
,Premium
,PremiumRS
,Standard
,Stretch
,System
,System2
, orWeb
. Please see Azure SQL database models. - elastic
Pool StringName - The name of the elastic database pool.
- import Property Map
- A
import
block as documented below.create_mode
must be set toDefault
. - location String
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- max
Size StringBytes - The maximum size that the database can grow to. Applies only if
create_mode
isDefault
. Please see Azure SQL database models. - max
Size StringGb - name String
- The name of the database. Changing this forces a new resource to be created.
- read
Scale Boolean - Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.
- requested
Service StringObjective Id - A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level. .
- requested
Service StringObjective Name - 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
andElasticPool
. You can list the available names with the CLI:shell az sql db list-editions -l westus -o table
. For further information please see Azure CLI - az sql db. - restore
Point StringIn Time - The point in time for the restore. Only applies if
create_mode
isPointInTimeRestore
, it should be provided in RFC3339 format, e.g.2013-11-08T22:00:40Z
. - source
Database StringDeletion Date - The deletion date time of the source database. Only applies to deleted databases where
create_mode
isPointInTimeRestore
. - source
Database StringId - The URI of the source database if
create_mode
value is notDefault
. - Map<String>
- A mapping of tags to assign to the resource.
- threat
Detection Property MapPolicy - Threat detection policy configuration. The
threat_detection_policy
block supports fields documented below. - zone
Redundant Boolean - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
Outputs
All input properties are implicitly available as output properties. Additionally, the Database resource produces the following output properties:
- Creation
Date string - The creation date of the SQL Database.
- Default
Secondary stringLocation - The default secondary location of the SQL Database.
- Encryption string
- Id string
- The provider-assigned unique ID for this managed resource.
- Creation
Date string - The creation date of the SQL Database.
- Default
Secondary stringLocation - The default secondary location of the SQL Database.
- Encryption string
- Id string
- The provider-assigned unique ID for this managed resource.
- creation
Date String - The creation date of the SQL Database.
- default
Secondary StringLocation - The default secondary location of the SQL Database.
- encryption String
- id String
- The provider-assigned unique ID for this managed resource.
- creation
Date string - The creation date of the SQL Database.
- default
Secondary stringLocation - The default secondary location of the SQL Database.
- encryption string
- id string
- The provider-assigned unique ID for this managed resource.
- creation_
date str - The creation date of the SQL Database.
- default_
secondary_ strlocation - The default secondary location of the SQL Database.
- encryption str
- id str
- The provider-assigned unique ID for this managed resource.
- creation
Date String - The creation date of the SQL Database.
- default
Secondary StringLocation - The default secondary location of the SQL Database.
- encryption String
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Database Resource
Get an existing Database resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DatabaseState, opts?: CustomResourceOptions): Database
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
collation: Optional[str] = None,
create_mode: Optional[str] = None,
creation_date: Optional[str] = None,
default_secondary_location: Optional[str] = None,
edition: Optional[str] = None,
elastic_pool_name: Optional[str] = None,
encryption: Optional[str] = None,
import_: Optional[DatabaseImportArgs] = None,
location: Optional[str] = None,
max_size_bytes: Optional[str] = None,
max_size_gb: Optional[str] = None,
name: Optional[str] = None,
read_scale: Optional[bool] = None,
requested_service_objective_id: Optional[str] = None,
requested_service_objective_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
restore_point_in_time: Optional[str] = None,
server_name: Optional[str] = None,
source_database_deletion_date: Optional[str] = None,
source_database_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
threat_detection_policy: Optional[DatabaseThreatDetectionPolicyArgs] = None,
zone_redundant: Optional[bool] = None) -> Database
func GetDatabase(ctx *Context, name string, id IDInput, state *DatabaseState, opts ...ResourceOption) (*Database, error)
public static Database Get(string name, Input<string> id, DatabaseState? state, CustomResourceOptions? opts = null)
public static Database get(String name, Output<String> id, DatabaseState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Collation string
- The name of the collation. Applies only if
create_mode
isDefault
. Azure default isSQL_LATIN1_GENERAL_CP1_CI_AS
. Changing this forces a new resource to be created. - Create
Mode string - Specifies how to create the database. Valid values are:
Default
,Copy
,OnlineSecondary
,NonReadableSecondary
,PointInTimeRestore
,Recovery
,Restore
orRestoreLongTermRetentionBackup
. Must beDefault
to create a new database. Defaults toDefault
. Please see Azure SQL Database REST API - Creation
Date string - The creation date of the SQL Database.
- Default
Secondary stringLocation - The default secondary location of the SQL Database.
- Edition string
- The edition of the database to be created. Applies only if
create_mode
isDefault
. Valid values are:Basic
,Standard
,Premium
,DataWarehouse
,Business
,BusinessCritical
,Free
,GeneralPurpose
,Hyperscale
,Premium
,PremiumRS
,Standard
,Stretch
,System
,System2
, orWeb
. Please see Azure SQL database models. - Elastic
Pool stringName - The name of the elastic database pool.
- Encryption string
- Import
Database
Import - A
import
block as documented below.create_mode
must be set toDefault
. - Location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Max
Size stringBytes - The maximum size that the database can grow to. Applies only if
create_mode
isDefault
. Please see Azure SQL database models. - Max
Size stringGb - Name string
- The name of the database. Changing this forces a new resource to be created.
- Read
Scale bool - Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.
- Requested
Service stringObjective Id - A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level. .
- Requested
Service stringObjective Name - 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
andElasticPool
. You can list the available names with the CLI:shell az sql db list-editions -l westus -o table
. For further information please see Azure CLI - az sql db. - Resource
Group stringName - The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
- Restore
Point stringIn Time - The point in time for the restore. Only applies if
create_mode
isPointInTimeRestore
, it should be provided in RFC3339 format, e.g.2013-11-08T22:00:40Z
. - Server
Name string - The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
- Source
Database stringDeletion Date - The deletion date time of the source database. Only applies to deleted databases where
create_mode
isPointInTimeRestore
. - Source
Database stringId - The URI of the source database if
create_mode
value is notDefault
. - Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Threat
Detection DatabasePolicy Threat Detection Policy - Threat detection policy configuration. The
threat_detection_policy
block supports fields documented below. - Zone
Redundant bool - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
- Collation string
- The name of the collation. Applies only if
create_mode
isDefault
. Azure default isSQL_LATIN1_GENERAL_CP1_CI_AS
. Changing this forces a new resource to be created. - Create
Mode string - Specifies how to create the database. Valid values are:
Default
,Copy
,OnlineSecondary
,NonReadableSecondary
,PointInTimeRestore
,Recovery
,Restore
orRestoreLongTermRetentionBackup
. Must beDefault
to create a new database. Defaults toDefault
. Please see Azure SQL Database REST API - Creation
Date string - The creation date of the SQL Database.
- Default
Secondary stringLocation - The default secondary location of the SQL Database.
- Edition string
- The edition of the database to be created. Applies only if
create_mode
isDefault
. Valid values are:Basic
,Standard
,Premium
,DataWarehouse
,Business
,BusinessCritical
,Free
,GeneralPurpose
,Hyperscale
,Premium
,PremiumRS
,Standard
,Stretch
,System
,System2
, orWeb
. Please see Azure SQL database models. - Elastic
Pool stringName - The name of the elastic database pool.
- Encryption string
- Import
Database
Import Args - A
import
block as documented below.create_mode
must be set toDefault
. - Location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Max
Size stringBytes - The maximum size that the database can grow to. Applies only if
create_mode
isDefault
. Please see Azure SQL database models. - Max
Size stringGb - Name string
- The name of the database. Changing this forces a new resource to be created.
- Read
Scale bool - Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.
- Requested
Service stringObjective Id - A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level. .
- Requested
Service stringObjective Name - 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
andElasticPool
. You can list the available names with the CLI:shell az sql db list-editions -l westus -o table
. For further information please see Azure CLI - az sql db. - Resource
Group stringName - The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
- Restore
Point stringIn Time - The point in time for the restore. Only applies if
create_mode
isPointInTimeRestore
, it should be provided in RFC3339 format, e.g.2013-11-08T22:00:40Z
. - Server
Name string - The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
- Source
Database stringDeletion Date - The deletion date time of the source database. Only applies to deleted databases where
create_mode
isPointInTimeRestore
. - Source
Database stringId - The URI of the source database if
create_mode
value is notDefault
. - map[string]string
- A mapping of tags to assign to the resource.
- Threat
Detection DatabasePolicy Threat Detection Policy Args - Threat detection policy configuration. The
threat_detection_policy
block supports fields documented below. - Zone
Redundant bool - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
- collation String
- The name of the collation. Applies only if
create_mode
isDefault
. Azure default isSQL_LATIN1_GENERAL_CP1_CI_AS
. Changing this forces a new resource to be created. - create
Mode String - Specifies how to create the database. Valid values are:
Default
,Copy
,OnlineSecondary
,NonReadableSecondary
,PointInTimeRestore
,Recovery
,Restore
orRestoreLongTermRetentionBackup
. Must beDefault
to create a new database. Defaults toDefault
. Please see Azure SQL Database REST API - creation
Date String - The creation date of the SQL Database.
- default
Secondary StringLocation - The default secondary location of the SQL Database.
- edition String
- The edition of the database to be created. Applies only if
create_mode
isDefault
. Valid values are:Basic
,Standard
,Premium
,DataWarehouse
,Business
,BusinessCritical
,Free
,GeneralPurpose
,Hyperscale
,Premium
,PremiumRS
,Standard
,Stretch
,System
,System2
, orWeb
. Please see Azure SQL database models. - elastic
Pool StringName - The name of the elastic database pool.
- encryption String
- import_
Database
Import - A
import
block as documented below.create_mode
must be set toDefault
. - location String
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- max
Size StringBytes - The maximum size that the database can grow to. Applies only if
create_mode
isDefault
. Please see Azure SQL database models. - max
Size StringGb - name String
- The name of the database. Changing this forces a new resource to be created.
- read
Scale Boolean - Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.
- requested
Service StringObjective Id - A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level. .
- requested
Service StringObjective Name - 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
andElasticPool
. You can list the available names with the CLI:shell az sql db list-editions -l westus -o table
. For further information please see Azure CLI - az sql db. - resource
Group StringName - The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
- restore
Point StringIn Time - The point in time for the restore. Only applies if
create_mode
isPointInTimeRestore
, it should be provided in RFC3339 format, e.g.2013-11-08T22:00:40Z
. - server
Name String - The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
- source
Database StringDeletion Date - The deletion date time of the source database. Only applies to deleted databases where
create_mode
isPointInTimeRestore
. - source
Database StringId - The URI of the source database if
create_mode
value is notDefault
. - Map<String,String>
- A mapping of tags to assign to the resource.
- threat
Detection DatabasePolicy Threat Detection Policy - Threat detection policy configuration. The
threat_detection_policy
block supports fields documented below. - zone
Redundant Boolean - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
- collation string
- The name of the collation. Applies only if
create_mode
isDefault
. Azure default isSQL_LATIN1_GENERAL_CP1_CI_AS
. Changing this forces a new resource to be created. - create
Mode string - Specifies how to create the database. Valid values are:
Default
,Copy
,OnlineSecondary
,NonReadableSecondary
,PointInTimeRestore
,Recovery
,Restore
orRestoreLongTermRetentionBackup
. Must beDefault
to create a new database. Defaults toDefault
. Please see Azure SQL Database REST API - creation
Date string - The creation date of the SQL Database.
- default
Secondary stringLocation - The default secondary location of the SQL Database.
- edition string
- The edition of the database to be created. Applies only if
create_mode
isDefault
. Valid values are:Basic
,Standard
,Premium
,DataWarehouse
,Business
,BusinessCritical
,Free
,GeneralPurpose
,Hyperscale
,Premium
,PremiumRS
,Standard
,Stretch
,System
,System2
, orWeb
. Please see Azure SQL database models. - elastic
Pool stringName - The name of the elastic database pool.
- encryption string
- import
Database
Import - A
import
block as documented below.create_mode
must be set toDefault
. - location string
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- max
Size stringBytes - The maximum size that the database can grow to. Applies only if
create_mode
isDefault
. Please see Azure SQL database models. - max
Size stringGb - name string
- The name of the database. Changing this forces a new resource to be created.
- read
Scale boolean - Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.
- requested
Service stringObjective Id - A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level. .
- requested
Service stringObjective Name - 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
andElasticPool
. You can list the available names with the CLI:shell az sql db list-editions -l westus -o table
. For further information please see Azure CLI - az sql db. - resource
Group stringName - The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
- restore
Point stringIn Time - The point in time for the restore. Only applies if
create_mode
isPointInTimeRestore
, it should be provided in RFC3339 format, e.g.2013-11-08T22:00:40Z
. - server
Name string - The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
- source
Database stringDeletion Date - The deletion date time of the source database. Only applies to deleted databases where
create_mode
isPointInTimeRestore
. - source
Database stringId - The URI of the source database if
create_mode
value is notDefault
. - {[key: string]: string}
- A mapping of tags to assign to the resource.
- threat
Detection DatabasePolicy Threat Detection Policy - Threat detection policy configuration. The
threat_detection_policy
block supports fields documented below. - zone
Redundant boolean - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
- collation str
- The name of the collation. Applies only if
create_mode
isDefault
. Azure default isSQL_LATIN1_GENERAL_CP1_CI_AS
. Changing this forces a new resource to be created. - create_
mode str - Specifies how to create the database. Valid values are:
Default
,Copy
,OnlineSecondary
,NonReadableSecondary
,PointInTimeRestore
,Recovery
,Restore
orRestoreLongTermRetentionBackup
. Must beDefault
to create a new database. Defaults toDefault
. Please see Azure SQL Database REST API - creation_
date str - The creation date of the SQL Database.
- default_
secondary_ strlocation - The default secondary location of the SQL Database.
- edition str
- The edition of the database to be created. Applies only if
create_mode
isDefault
. Valid values are:Basic
,Standard
,Premium
,DataWarehouse
,Business
,BusinessCritical
,Free
,GeneralPurpose
,Hyperscale
,Premium
,PremiumRS
,Standard
,Stretch
,System
,System2
, orWeb
. Please see Azure SQL database models. - elastic_
pool_ strname - The name of the elastic database pool.
- encryption str
- import_
Database
Import Args - A
import
block as documented below.create_mode
must be set toDefault
. - location str
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- max_
size_ strbytes - The maximum size that the database can grow to. Applies only if
create_mode
isDefault
. Please see Azure SQL database models. - max_
size_ strgb - name str
- The name of the database. Changing this forces a new resource to be created.
- read_
scale bool - Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.
- requested_
service_ strobjective_ id - A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level. .
- requested_
service_ strobjective_ name - 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
andElasticPool
. You can list the available names with the CLI:shell az sql db list-editions -l westus -o table
. For further information please see Azure CLI - az sql db. - resource_
group_ strname - The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
- restore_
point_ strin_ time - The point in time for the restore. Only applies if
create_mode
isPointInTimeRestore
, it should be provided in RFC3339 format, e.g.2013-11-08T22:00:40Z
. - server_
name str - The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
- source_
database_ strdeletion_ date - The deletion date time of the source database. Only applies to deleted databases where
create_mode
isPointInTimeRestore
. - source_
database_ strid - The URI of the source database if
create_mode
value is notDefault
. - Mapping[str, str]
- A mapping of tags to assign to the resource.
- threat_
detection_ Databasepolicy Threat Detection Policy Args - Threat detection policy configuration. The
threat_detection_policy
block supports fields documented below. - zone_
redundant bool - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
- collation String
- The name of the collation. Applies only if
create_mode
isDefault
. Azure default isSQL_LATIN1_GENERAL_CP1_CI_AS
. Changing this forces a new resource to be created. - create
Mode String - Specifies how to create the database. Valid values are:
Default
,Copy
,OnlineSecondary
,NonReadableSecondary
,PointInTimeRestore
,Recovery
,Restore
orRestoreLongTermRetentionBackup
. Must beDefault
to create a new database. Defaults toDefault
. Please see Azure SQL Database REST API - creation
Date String - The creation date of the SQL Database.
- default
Secondary StringLocation - The default secondary location of the SQL Database.
- edition String
- The edition of the database to be created. Applies only if
create_mode
isDefault
. Valid values are:Basic
,Standard
,Premium
,DataWarehouse
,Business
,BusinessCritical
,Free
,GeneralPurpose
,Hyperscale
,Premium
,PremiumRS
,Standard
,Stretch
,System
,System2
, orWeb
. Please see Azure SQL database models. - elastic
Pool StringName - The name of the elastic database pool.
- encryption String
- import Property Map
- A
import
block as documented below.create_mode
must be set toDefault
. - location String
- Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- max
Size StringBytes - The maximum size that the database can grow to. Applies only if
create_mode
isDefault
. Please see Azure SQL database models. - max
Size StringGb - name String
- The name of the database. Changing this forces a new resource to be created.
- read
Scale Boolean - Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.
- requested
Service StringObjective Id - A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level. .
- requested
Service StringObjective Name - 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
andElasticPool
. You can list the available names with the CLI:shell az sql db list-editions -l westus -o table
. For further information please see Azure CLI - az sql db. - resource
Group StringName - The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
- restore
Point StringIn Time - The point in time for the restore. Only applies if
create_mode
isPointInTimeRestore
, it should be provided in RFC3339 format, e.g.2013-11-08T22:00:40Z
. - server
Name String - The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
- source
Database StringDeletion Date - The deletion date time of the source database. Only applies to deleted databases where
create_mode
isPointInTimeRestore
. - source
Database StringId - The URI of the source database if
create_mode
value is notDefault
. - Map<String>
- A mapping of tags to assign to the resource.
- threat
Detection Property MapPolicy - Threat detection policy configuration. The
threat_detection_policy
block supports fields documented below. - zone
Redundant Boolean - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
Supporting Types
DatabaseImport, DatabaseImportArgs
- Administrator
Login string - Specifies the name of the SQL administrator.
- Administrator
Login stringPassword - Specifies the password of the SQL administrator.
- Authentication
Type string - Specifies the type of authentication used to access the server. Valid values are
SQL
orADPassword
. - Storage
Key string - Specifies the access key for the storage account.
- Storage
Key stringType - Specifies the type of access key for the storage account. Valid values are
StorageAccessKey
orSharedAccessKey
. - Storage
Uri string - Specifies the blob URI of the .bacpac file.
- Operation
Mode string - Specifies the type of import operation being performed. The only allowable value is
Import
. Defaults toImport
.
- Administrator
Login string - Specifies the name of the SQL administrator.
- Administrator
Login stringPassword - Specifies the password of the SQL administrator.
- Authentication
Type string - Specifies the type of authentication used to access the server. Valid values are
SQL
orADPassword
. - Storage
Key string - Specifies the access key for the storage account.
- Storage
Key stringType - Specifies the type of access key for the storage account. Valid values are
StorageAccessKey
orSharedAccessKey
. - Storage
Uri string - Specifies the blob URI of the .bacpac file.
- Operation
Mode string - Specifies the type of import operation being performed. The only allowable value is
Import
. Defaults toImport
.
- administrator
Login String - Specifies the name of the SQL administrator.
- administrator
Login StringPassword - Specifies the password of the SQL administrator.
- authentication
Type String - Specifies the type of authentication used to access the server. Valid values are
SQL
orADPassword
. - storage
Key String - Specifies the access key for the storage account.
- storage
Key StringType - Specifies the type of access key for the storage account. Valid values are
StorageAccessKey
orSharedAccessKey
. - storage
Uri String - Specifies the blob URI of the .bacpac file.
- operation
Mode String - Specifies the type of import operation being performed. The only allowable value is
Import
. Defaults toImport
.
- administrator
Login string - Specifies the name of the SQL administrator.
- administrator
Login stringPassword - Specifies the password of the SQL administrator.
- authentication
Type string - Specifies the type of authentication used to access the server. Valid values are
SQL
orADPassword
. - storage
Key string - Specifies the access key for the storage account.
- storage
Key stringType - Specifies the type of access key for the storage account. Valid values are
StorageAccessKey
orSharedAccessKey
. - storage
Uri string - Specifies the blob URI of the .bacpac file.
- operation
Mode string - Specifies the type of import operation being performed. The only allowable value is
Import
. Defaults toImport
.
- administrator_
login str - Specifies the name of the SQL administrator.
- administrator_
login_ strpassword - Specifies the password of the SQL administrator.
- authentication_
type str - Specifies the type of authentication used to access the server. Valid values are
SQL
orADPassword
. - storage_
key str - Specifies the access key for the storage account.
- storage_
key_ strtype - Specifies the type of access key for the storage account. Valid values are
StorageAccessKey
orSharedAccessKey
. - storage_
uri str - Specifies the blob URI of the .bacpac file.
- operation_
mode str - Specifies the type of import operation being performed. The only allowable value is
Import
. Defaults toImport
.
- administrator
Login String - Specifies the name of the SQL administrator.
- administrator
Login StringPassword - Specifies the password of the SQL administrator.
- authentication
Type String - Specifies the type of authentication used to access the server. Valid values are
SQL
orADPassword
. - storage
Key String - Specifies the access key for the storage account.
- storage
Key StringType - Specifies the type of access key for the storage account. Valid values are
StorageAccessKey
orSharedAccessKey
. - storage
Uri String - Specifies the blob URI of the .bacpac file.
- operation
Mode String - Specifies the type of import operation being performed. The only allowable value is
Import
. Defaults toImport
.
DatabaseThreatDetectionPolicy, DatabaseThreatDetectionPolicyArgs
- Disabled
Alerts List<string> - Specifies a list of alerts which should be disabled. Possible values include
Access_Anomaly
,Sql_Injection
andSql_Injection_Vulnerability
. - Email
Account stringAdmins - Should the account administrators be emailed when this alert is triggered? Possible values are
Disabled
andEnabled
. Defaults toDisabled
. - Email
Addresses List<string> - A list of email addresses which alerts should be sent to.
- Retention
Days int - Specifies the number of days to keep in the Threat Detection audit logs.
- State string
- The State of the Policy. Possible values are
Enabled
,Disabled
orNew
. Defaults toDisabled
. - Storage
Account stringAccess Key - Specifies the identifier key of the Threat Detection audit storage account. Required if
state
isEnabled
. - Storage
Endpoint string - Specifies the blob storage endpoint (e.g. https://example.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. Required if
state
isEnabled
.
- Disabled
Alerts []string - Specifies a list of alerts which should be disabled. Possible values include
Access_Anomaly
,Sql_Injection
andSql_Injection_Vulnerability
. - Email
Account stringAdmins - Should the account administrators be emailed when this alert is triggered? Possible values are
Disabled
andEnabled
. Defaults toDisabled
. - Email
Addresses []string - A list of email addresses which alerts should be sent to.
- Retention
Days int - Specifies the number of days to keep in the Threat Detection audit logs.
- State string
- The State of the Policy. Possible values are
Enabled
,Disabled
orNew
. Defaults toDisabled
. - Storage
Account stringAccess Key - Specifies the identifier key of the Threat Detection audit storage account. Required if
state
isEnabled
. - Storage
Endpoint string - Specifies the blob storage endpoint (e.g. https://example.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. Required if
state
isEnabled
.
- disabled
Alerts List<String> - Specifies a list of alerts which should be disabled. Possible values include
Access_Anomaly
,Sql_Injection
andSql_Injection_Vulnerability
. - email
Account StringAdmins - Should the account administrators be emailed when this alert is triggered? Possible values are
Disabled
andEnabled
. Defaults toDisabled
. - email
Addresses List<String> - A list of email addresses which alerts should be sent to.
- retention
Days Integer - Specifies the number of days to keep in the Threat Detection audit logs.
- state String
- The State of the Policy. Possible values are
Enabled
,Disabled
orNew
. Defaults toDisabled
. - storage
Account StringAccess Key - Specifies the identifier key of the Threat Detection audit storage account. Required if
state
isEnabled
. - storage
Endpoint String - Specifies the blob storage endpoint (e.g. https://example.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. Required if
state
isEnabled
.
- disabled
Alerts string[] - Specifies a list of alerts which should be disabled. Possible values include
Access_Anomaly
,Sql_Injection
andSql_Injection_Vulnerability
. - email
Account stringAdmins - Should the account administrators be emailed when this alert is triggered? Possible values are
Disabled
andEnabled
. Defaults toDisabled
. - email
Addresses string[] - A list of email addresses which alerts should be sent to.
- retention
Days number - Specifies the number of days to keep in the Threat Detection audit logs.
- state string
- The State of the Policy. Possible values are
Enabled
,Disabled
orNew
. Defaults toDisabled
. - storage
Account stringAccess Key - Specifies the identifier key of the Threat Detection audit storage account. Required if
state
isEnabled
. - storage
Endpoint string - Specifies the blob storage endpoint (e.g. https://example.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. Required if
state
isEnabled
.
- disabled_
alerts Sequence[str] - Specifies a list of alerts which should be disabled. Possible values include
Access_Anomaly
,Sql_Injection
andSql_Injection_Vulnerability
. - email_
account_ stradmins - Should the account administrators be emailed when this alert is triggered? Possible values are
Disabled
andEnabled
. Defaults toDisabled
. - email_
addresses Sequence[str] - A list of email addresses which alerts should be sent to.
- retention_
days int - Specifies the number of days to keep in the Threat Detection audit logs.
- state str
- The State of the Policy. Possible values are
Enabled
,Disabled
orNew
. Defaults toDisabled
. - storage_
account_ straccess_ key - Specifies the identifier key of the Threat Detection audit storage account. Required if
state
isEnabled
. - storage_
endpoint str - Specifies the blob storage endpoint (e.g. https://example.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. Required if
state
isEnabled
.
- disabled
Alerts List<String> - Specifies a list of alerts which should be disabled. Possible values include
Access_Anomaly
,Sql_Injection
andSql_Injection_Vulnerability
. - email
Account StringAdmins - Should the account administrators be emailed when this alert is triggered? Possible values are
Disabled
andEnabled
. Defaults toDisabled
. - email
Addresses List<String> - A list of email addresses which alerts should be sent to.
- retention
Days Number - Specifies the number of days to keep in the Threat Detection audit logs.
- state String
- The State of the Policy. Possible values are
Enabled
,Disabled
orNew
. Defaults toDisabled
. - storage
Account StringAccess Key - Specifies the identifier key of the Threat Detection audit storage account. Required if
state
isEnabled
. - storage
Endpoint String - Specifies the blob storage endpoint (e.g. https://example.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. Required if
state
isEnabled
.
Import
SQL Databases can be imported using the resource id
, e.g.
$ pulumi import azure:sql/database:Database database1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/servers/myserver/databases/database1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.