Module sql

@pulumi/azure > sql

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-azure repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-azurerm repo.

class ActiveDirectoryAdministrator

extends CustomResource

Allows you to set a user or group as the AD administrator for an Azure SQL server

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West US",
    name: "acceptanceTestResourceGroup1",
});
const current = pulumi.output(azure.core.getClientConfig({}));
const testSqlServer = new azure.sql.SqlServer("test", {
    administratorLogin: "4dm1n157r470r",
    administratorLoginPassword: "4-v3ry-53cr37-p455w0rd",
    location: testResourceGroup.location,
    name: "mysqlserver",
    resourceGroupName: testResourceGroup.name,
    version: "12.0",
});
const testActiveDirectoryAdministrator = new azure.sql.ActiveDirectoryAdministrator("test", {
    login: "sqladmin",
    objectId: current.servicePrincipalObjectId,
    resourceGroupName: testResourceGroup.name,
    serverName: testSqlServer.name,
    tenantId: current.tenantId,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/sql_active_directory_administrator.html.markdown.

constructor

new ActiveDirectoryAdministrator(name: string, args: ActiveDirectoryAdministratorArgs, opts?: pulumi.CustomResourceOptions)

Create a ActiveDirectoryAdministrator resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ActiveDirectoryAdministratorState, opts?: pulumi.CustomResourceOptions): ActiveDirectoryAdministrator

Get an existing ActiveDirectoryAdministrator resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of ActiveDirectoryAdministrator. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property login

public login: pulumi.Output<string>;

The login name of the principal to set as the server administrator

property objectId

public objectId: pulumi.Output<string>;

The ID of the principal to set as the server administrator

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group for the SQL server. Changing this forces a new resource to be created.

property serverName

public serverName: pulumi.Output<string>;

The name of the SQL Server on which to set the administrator. Changing this forces a new resource to be created.

property tenantId

public tenantId: pulumi.Output<string>;

The Azure Tenant ID

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Database

extends CustomResource

Allows you to manage an Azure SQL Database

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West US",
    name: "acceptanceTestResourceGroup1",
});
const testSqlServer = new azure.sql.SqlServer("test", {
    administratorLogin: "4dm1n157r470r",
    administratorLoginPassword: "4-v3ry-53cr37-p455w0rd",
    location: "West US",
    name: "mysqlserver",
    resourceGroupName: testResourceGroup.name,
    version: "12.0",
});
const testDatabase = new azure.sql.Database("test", {
    location: "West US",
    name: "mysqldatabase",
    resourceGroupName: testResourceGroup.name,
    serverName: testSqlServer.name,
    tags: {
        environment: "production",
    },
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/sql_database.html.markdown.

constructor

new Database(name: string, args: DatabaseArgs, opts?: pulumi.CustomResourceOptions)

Create a Database resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatabaseState, opts?: pulumi.CustomResourceOptions): Database

Get an existing Database resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of Database. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property collation

public collation: pulumi.Output<string>;

The name of the collation. Applies only if createMode is Default. Azure default is SQL_LATIN1_GENERAL_CP1_CI_AS. Changing this forces a new resource to be created.

property createMode

public createMode: pulumi.Output<string | undefined>;

Specifies how to create the database. Must be either Default to create a new database or PointInTimeRestore to restore from a snapshot. Defaults to Default.

property creationDate

public creationDate: pulumi.Output<string>;

The creation date of the SQL Database.

property defaultSecondaryLocation

public defaultSecondaryLocation: pulumi.Output<string>;

The default secondary location of the SQL Database.

property edition

public edition: pulumi.Output<string>;

The edition of the database to be created. Applies only if createMode 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.

property elasticPoolName

public elasticPoolName: pulumi.Output<string>;

The name of the elastic database pool.

property encryption

public encryption: pulumi.Output<string>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property import

public import: pulumi.Output<{
    administratorLogin: string;
    administratorLoginPassword: string;
    authenticationType: string;
    operationMode: undefined | string;
    storageKey: string;
    storageKeyType: string;
    storageUri: string;
} | undefined>;

A Database Import block as documented below. createMode must be set to Default.

property location

public location: pulumi.Output<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property maxSizeBytes

public maxSizeBytes: pulumi.Output<string>;

The maximum size that the database can grow to. Applies only if createMode is Default. Please see Azure SQL Database Service Tiers.

property name

public name: pulumi.Output<string>;

The name of the database.

property readScale

public readScale: pulumi.Output<boolean | undefined>;

Read-only connections will be redirected to a high-available replica. Please see Use read-only replicas to load-balance read-only query workloads.

property requestedServiceObjectiveId

public requestedServiceObjectiveId: pulumi.Output<string>;

Use requestedServiceObjectiveId or requestedServiceObjectiveName to set the performance level for the database. Please see Azure SQL Database Service Tiers.

property requestedServiceObjectiveName

public requestedServiceObjectiveName: pulumi.Output<string>;

Use requestedServiceObjectiveName or requestedServiceObjectiveId to set the performance level for the database. Valid values are: S0, S1, S2, S3, P1, P2, P4, P6, P11 and ElasticPool. Please see Azure SQL Database Service Tiers.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the database. This must be the same as Database Server resource group currently.

property restorePointInTime

public restorePointInTime: pulumi.Output<string>;

The point in time for the restore. Only applies if createMode is PointInTimeRestore e.g. 2013-11-08T22:00:40Z

property serverName

public serverName: pulumi.Output<string>;

The name of the SQL Server on which to create the database.

property sourceDatabaseDeletionDate

public sourceDatabaseDeletionDate: pulumi.Output<string>;

The deletion date time of the source database. Only applies to deleted databases where createMode is PointInTimeRestore.

property sourceDatabaseId

public sourceDatabaseId: pulumi.Output<string>;

The URI of the source database if createMode value is not Default.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property threatDetectionPolicy

public threatDetectionPolicy: pulumi.Output<{
    disabledAlerts: string[];
    emailAccountAdmins: undefined | string;
    emailAddresses: string[];
    retentionDays: undefined | number;
    state: undefined | string;
    storageAccountAccessKey: undefined | string;
    storageEndpoint: undefined | string;
    useServerDefault: undefined | string;
}>;

Threat detection policy configuration. The threatDetectionPolicy block supports fields documented below.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class ElasticPool

extends CustomResource

Allows you to manage an Azure SQL Elastic Pool.

NOTE: - This version of the Elasticpool resource is being deprecated and should no longer be used. Please use the azure.mssql.ElasticPool version instead.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West US",
    name: "my-resource-group",
});
const testSqlServer = new azure.sql.SqlServer("test", {
    administratorLogin: "4dm1n157r470r",
    administratorLoginPassword: "4-v3ry-53cr37-p455w0rd",
    location: testResourceGroup.location,
    name: "my-sql-server", // NOTE: needs to be globally unique
    resourceGroupName: testResourceGroup.name,
    version: "12.0",
});
const testElasticPool = new azure.sql.ElasticPool("test", {
    dbDtuMax: 5,
    dbDtuMin: 0,
    dtu: 50,
    edition: "Basic",
    location: testResourceGroup.location,
    name: "test",
    poolSize: 5000,
    resourceGroupName: testResourceGroup.name,
    serverName: testSqlServer.name,
});

NOTE on azure.sql.ElasticPool: - The values of edition, dtu, and poolSize must be consistent with the Azure SQL Database Service Tiers. Any inconsistent argument configuration will be rejected.

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/sql_elasticpool.html.markdown.

constructor

new ElasticPool(name: string, args: ElasticPoolArgs, opts?: pulumi.CustomResourceOptions)

Create a ElasticPool resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ElasticPoolState, opts?: pulumi.CustomResourceOptions): ElasticPool

Get an existing ElasticPool resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of ElasticPool. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property creationDate

public creationDate: pulumi.Output<string>;

The creation date of the SQL Elastic Pool.

property dbDtuMax

public dbDtuMax: pulumi.Output<number>;

The maximum DTU which will be guaranteed to all databases in the elastic pool to be created.

property dbDtuMin

public dbDtuMin: pulumi.Output<number>;

The minimum DTU which will be guaranteed to all databases in the elastic pool to be created.

property dtu

public dtu: pulumi.Output<number>;

The total shared DTU for the elastic pool. Valid values depend on the edition which has been defined. Refer to Azure SQL Database Service Tiers for valid combinations.

property edition

public edition: pulumi.Output<string>;

The edition of the elastic pool to be created. Valid values are Basic, Standard, and Premium. Refer to Azure SQL Database Service Tiers for details. Changing this forces a new resource to be created.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property location

public location: pulumi.Output<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

public name: pulumi.Output<string>;

The name of the elastic pool. This needs to be globally unique. Changing this forces a new resource to be created.

property poolSize

public poolSize: pulumi.Output<number>;

The maximum size in MB that all databases in the elastic pool can grow to. The maximum size must be consistent with combination of edition and dtu and the limits documented in Azure SQL Database Service Tiers. If not defined when creating an elastic pool, the value is set to the size implied by edition and dtu.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the elastic pool. This must be the same as the resource group of the underlying SQL server.

property serverName

public serverName: pulumi.Output<string>;

The name of the SQL Server on which to create the elastic pool. Changing this forces a new resource to be created.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class FirewallRule

extends CustomResource

Allows you to manage an Azure SQL Firewall Rule

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West US",
    name: "acceptanceTestResourceGroup1",
});
const testSqlServer = new azure.sql.SqlServer("test", {
    administratorLogin: "4dm1n157r470r",
    administratorLoginPassword: "4-v3ry-53cr37-p455w0rd",
    location: "West US",
    name: "mysqlserver",
    resourceGroupName: testResourceGroup.name,
    version: "12.0",
});
const testFirewallRule = new azure.sql.FirewallRule("test", {
    endIpAddress: "10.0.17.62",
    name: "FirewallRule1",
    resourceGroupName: testResourceGroup.name,
    serverName: testSqlServer.name,
    startIpAddress: "10.0.17.62",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/sql_firewall_rule.html.markdown.

constructor

new FirewallRule(name: string, args: FirewallRuleArgs, opts?: pulumi.CustomResourceOptions)

Create a FirewallRule resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: FirewallRuleState, opts?: pulumi.CustomResourceOptions): FirewallRule

Get an existing FirewallRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of FirewallRule. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property endIpAddress

public endIpAddress: pulumi.Output<string>;

The ending IP address to allow through the firewall for this rule.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the firewall rule.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the sql server.

property serverName

public serverName: pulumi.Output<string>;

The name of the SQL Server on which to create the Firewall Rule.

property startIpAddress

public startIpAddress: pulumi.Output<string>;

The starting IP address to allow through the firewall for this rule.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class SqlServer

extends CustomResource

Manages a SQL Azure Database Server.

Note: All arguments including the administrator login and password will be stored in the raw state as plain-text. Read more about sensitive data in state.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West US",
    name: "database-rg",
});
const testSqlServer = new azure.sql.SqlServer("test", {
    administratorLogin: "mradministrator",
    administratorLoginPassword: "thisIsDog11",
    location: testResourceGroup.location,
    name: "mysqlserver",
    resourceGroupName: testResourceGroup.name,
    tags: {
        environment: "production",
    },
    version: "12.0",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/sql_server.html.markdown.

constructor

new SqlServer(name: string, args: SqlServerArgs, opts?: pulumi.CustomResourceOptions)

Create a SqlServer resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SqlServerState, opts?: pulumi.CustomResourceOptions): SqlServer

Get an existing SqlServer resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of SqlServer. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property administratorLogin

public administratorLogin: pulumi.Output<string>;

The administrator login name for the new server. Changing this forces a new resource to be created.

property administratorLoginPassword

public administratorLoginPassword: pulumi.Output<string>;

The password associated with the administratorLogin user. Needs to comply with Azure’s Password Policy

property fullyQualifiedDomainName

public fullyQualifiedDomainName: pulumi.Output<string>;

The fully qualified domain name of the Azure SQL Server (e.g. myServerName.database.windows.net)

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property location

public location: pulumi.Output<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

public name: pulumi.Output<string>;

The name of the SQL Server. This needs to be globally unique within Azure.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the SQL Server.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property version

public version: pulumi.Output<string>;

The version for the new server. Valid values are: 2.0 (for v11 server) and 12.0 (for v12 server).

class VirtualNetworkRule

extends CustomResource

Allows you to add, update, or remove an Azure SQL server to a subnet of a virtual network.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = new azure.core.ResourceGroup("example", {
    location: "West US",
    name: "example-sql-server-vnet-rule",
});
const sqlserver = new azure.sql.SqlServer("sqlserver", {
    administratorLogin: "4dm1n157r470r",
    administratorLoginPassword: "4-v3ry-53cr37-p455w0rd",
    location: example.location,
    name: "unqiueazuresqlserver",
    resourceGroupName: example.name,
    version: "12.0",
});
const vnet = new azure.network.VirtualNetwork("vnet", {
    addressSpaces: ["10.7.29.0/29"],
    location: example.location,
    name: "example-vnet",
    resourceGroupName: example.name,
});
const subnet = new azure.network.Subnet("subnet", {
    addressPrefix: "10.7.29.0/29",
    name: "example-subnet",
    resourceGroupName: example.name,
    serviceEndpoints: ["Microsoft.Sql"],
    virtualNetworkName: vnet.name,
});
const sqlvnetrule = new azure.sql.VirtualNetworkRule("sqlvnetrule", {
    name: "sql-vnet-rule",
    resourceGroupName: example.name,
    serverName: sqlserver.name,
    subnetId: subnet.id,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/sql_virtual_network_rule.html.markdown.

constructor

new VirtualNetworkRule(name: string, args: VirtualNetworkRuleArgs, opts?: pulumi.CustomResourceOptions)

Create a VirtualNetworkRule resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VirtualNetworkRuleState, opts?: pulumi.CustomResourceOptions): VirtualNetworkRule

Get an existing VirtualNetworkRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of VirtualNetworkRule. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ignoreMissingVnetServiceEndpoint

public ignoreMissingVnetServiceEndpoint: pulumi.Output<boolean | undefined>;

Create the virtual network rule before the subnet has the virtual network service endpoint enabled. The default value is false.

property name

public name: pulumi.Output<string>;

The name of the SQL virtual network rule. Changing this forces a new resource to be created. Cannot be empty and must only contain alphanumeric characters and hyphens. Cannot start with a number, and cannot start or end with a hyphen.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group where the SQL server resides. Changing this forces a new resource to be created.

property serverName

public serverName: pulumi.Output<string>;

The name of the SQL Server to which this SQL virtual network rule will be applied to. Changing this forces a new resource to be created.

property subnetId

public subnetId: pulumi.Output<string>;

The ID of the subnet that the SQL server will be connected to.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

function getServer

getServer(args: GetServerArgs, opts?: pulumi.InvokeOptions): Promise<GetServerResult> & GetServerResult

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

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = pulumi.output(azure.sql.getServer({
    name: "examplesqlservername",
    resourceGroupName: "example-resources",
}));

export const sqlServerId = azurerm_sql_server_test.id;

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/d/sql_server.html.markdown.

interface ActiveDirectoryAdministratorArgs

The set of arguments for constructing a ActiveDirectoryAdministrator resource.

property login

login: pulumi.Input<string>;

The login name of the principal to set as the server administrator

property objectId

objectId: pulumi.Input<string>;

The ID of the principal to set as the server administrator

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group for the SQL server. Changing this forces a new resource to be created.

property serverName

serverName: pulumi.Input<string>;

The name of the SQL Server on which to set the administrator. Changing this forces a new resource to be created.

property tenantId

tenantId: pulumi.Input<string>;

The Azure Tenant ID

interface ActiveDirectoryAdministratorState

Input properties used for looking up and filtering ActiveDirectoryAdministrator resources.

property login

login?: pulumi.Input<string>;

The login name of the principal to set as the server administrator

property objectId

objectId?: pulumi.Input<string>;

The ID of the principal to set as the server administrator

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group for the SQL server. Changing this forces a new resource to be created.

property serverName

serverName?: pulumi.Input<string>;

The name of the SQL Server on which to set the administrator. Changing this forces a new resource to be created.

property tenantId

tenantId?: pulumi.Input<string>;

The Azure Tenant ID

interface DatabaseArgs

The set of arguments for constructing a Database resource.

property collation

collation?: pulumi.Input<string>;

The name of the collation. Applies only if createMode is Default. Azure default is SQL_LATIN1_GENERAL_CP1_CI_AS. Changing this forces a new resource to be created.

property createMode

createMode?: pulumi.Input<string>;

Specifies how to create the database. Must be either Default to create a new database or PointInTimeRestore to restore from a snapshot. Defaults to Default.

property edition

edition?: pulumi.Input<string>;

The edition of the database to be created. Applies only if createMode 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.

property elasticPoolName

elasticPoolName?: pulumi.Input<string>;

The name of the elastic database pool.

property import

import?: pulumi.Input<{
    administratorLogin: pulumi.Input<string>;
    administratorLoginPassword: pulumi.Input<string>;
    authenticationType: pulumi.Input<string>;
    operationMode: pulumi.Input<string>;
    storageKey: pulumi.Input<string>;
    storageKeyType: pulumi.Input<string>;
    storageUri: pulumi.Input<string>;
}>;

A Database Import block as documented below. createMode must be set to Default.

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property maxSizeBytes

maxSizeBytes?: pulumi.Input<string>;

The maximum size that the database can grow to. Applies only if createMode is Default. Please see Azure SQL Database Service Tiers.

property name

name?: pulumi.Input<string>;

The name of the database.

property readScale

readScale?: pulumi.Input<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.

property requestedServiceObjectiveId

requestedServiceObjectiveId?: pulumi.Input<string>;

Use requestedServiceObjectiveId or requestedServiceObjectiveName to set the performance level for the database. Please see Azure SQL Database Service Tiers.

property requestedServiceObjectiveName

requestedServiceObjectiveName?: pulumi.Input<string>;

Use requestedServiceObjectiveName or requestedServiceObjectiveId to set the performance level for the database. Valid values are: S0, S1, S2, S3, P1, P2, P4, P6, P11 and ElasticPool. Please see Azure SQL Database Service Tiers.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the database. This must be the same as Database Server resource group currently.

property restorePointInTime

restorePointInTime?: pulumi.Input<string>;

The point in time for the restore. Only applies if createMode is PointInTimeRestore e.g. 2013-11-08T22:00:40Z

property serverName

serverName: pulumi.Input<string>;

The name of the SQL Server on which to create the database.

property sourceDatabaseDeletionDate

sourceDatabaseDeletionDate?: pulumi.Input<string>;

The deletion date time of the source database. Only applies to deleted databases where createMode is PointInTimeRestore.

property sourceDatabaseId

sourceDatabaseId?: pulumi.Input<string>;

The URI of the source database if createMode value is not Default.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property threatDetectionPolicy

threatDetectionPolicy?: pulumi.Input<{
    disabledAlerts: pulumi.Input<pulumi.Input<string>[]>;
    emailAccountAdmins: pulumi.Input<string>;
    emailAddresses: pulumi.Input<pulumi.Input<string>[]>;
    retentionDays: pulumi.Input<number>;
    state: pulumi.Input<string>;
    storageAccountAccessKey: pulumi.Input<string>;
    storageEndpoint: pulumi.Input<string>;
    useServerDefault: pulumi.Input<string>;
}>;

Threat detection policy configuration. The threatDetectionPolicy block supports fields documented below.

interface DatabaseState

Input properties used for looking up and filtering Database resources.

property collation

collation?: pulumi.Input<string>;

The name of the collation. Applies only if createMode is Default. Azure default is SQL_LATIN1_GENERAL_CP1_CI_AS. Changing this forces a new resource to be created.

property createMode

createMode?: pulumi.Input<string>;

Specifies how to create the database. Must be either Default to create a new database or PointInTimeRestore to restore from a snapshot. Defaults to Default.

property creationDate

creationDate?: pulumi.Input<string>;

The creation date of the SQL Database.

property defaultSecondaryLocation

defaultSecondaryLocation?: pulumi.Input<string>;

The default secondary location of the SQL Database.

property edition

edition?: pulumi.Input<string>;

The edition of the database to be created. Applies only if createMode 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.

property elasticPoolName

elasticPoolName?: pulumi.Input<string>;

The name of the elastic database pool.

property encryption

encryption?: pulumi.Input<string>;

property import

import?: pulumi.Input<{
    administratorLogin: pulumi.Input<string>;
    administratorLoginPassword: pulumi.Input<string>;
    authenticationType: pulumi.Input<string>;
    operationMode: pulumi.Input<string>;
    storageKey: pulumi.Input<string>;
    storageKeyType: pulumi.Input<string>;
    storageUri: pulumi.Input<string>;
}>;

A Database Import block as documented below. createMode must be set to Default.

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property maxSizeBytes

maxSizeBytes?: pulumi.Input<string>;

The maximum size that the database can grow to. Applies only if createMode is Default. Please see Azure SQL Database Service Tiers.

property name

name?: pulumi.Input<string>;

The name of the database.

property readScale

readScale?: pulumi.Input<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.

property requestedServiceObjectiveId

requestedServiceObjectiveId?: pulumi.Input<string>;

Use requestedServiceObjectiveId or requestedServiceObjectiveName to set the performance level for the database. Please see Azure SQL Database Service Tiers.

property requestedServiceObjectiveName

requestedServiceObjectiveName?: pulumi.Input<string>;

Use requestedServiceObjectiveName or requestedServiceObjectiveId to set the performance level for the database. Valid values are: S0, S1, S2, S3, P1, P2, P4, P6, P11 and ElasticPool. Please see Azure SQL Database Service Tiers.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the database. This must be the same as Database Server resource group currently.

property restorePointInTime

restorePointInTime?: pulumi.Input<string>;

The point in time for the restore. Only applies if createMode is PointInTimeRestore e.g. 2013-11-08T22:00:40Z

property serverName

serverName?: pulumi.Input<string>;

The name of the SQL Server on which to create the database.

property sourceDatabaseDeletionDate

sourceDatabaseDeletionDate?: pulumi.Input<string>;

The deletion date time of the source database. Only applies to deleted databases where createMode is PointInTimeRestore.

property sourceDatabaseId

sourceDatabaseId?: pulumi.Input<string>;

The URI of the source database if createMode value is not Default.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property threatDetectionPolicy

threatDetectionPolicy?: pulumi.Input<{
    disabledAlerts: pulumi.Input<pulumi.Input<string>[]>;
    emailAccountAdmins: pulumi.Input<string>;
    emailAddresses: pulumi.Input<pulumi.Input<string>[]>;
    retentionDays: pulumi.Input<number>;
    state: pulumi.Input<string>;
    storageAccountAccessKey: pulumi.Input<string>;
    storageEndpoint: pulumi.Input<string>;
    useServerDefault: pulumi.Input<string>;
}>;

Threat detection policy configuration. The threatDetectionPolicy block supports fields documented below.

interface ElasticPoolArgs

The set of arguments for constructing a ElasticPool resource.

property dbDtuMax

dbDtuMax?: pulumi.Input<number>;

The maximum DTU which will be guaranteed to all databases in the elastic pool to be created.

property dbDtuMin

dbDtuMin?: pulumi.Input<number>;

The minimum DTU which will be guaranteed to all databases in the elastic pool to be created.

property dtu

dtu: pulumi.Input<number>;

The total shared DTU for the elastic pool. Valid values depend on the edition which has been defined. Refer to Azure SQL Database Service Tiers for valid combinations.

property edition

edition: pulumi.Input<string>;

The edition of the elastic pool to be created. Valid values are Basic, Standard, and Premium. Refer to Azure SQL Database Service Tiers for details. Changing this forces a new resource to be created.

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

The name of the elastic pool. This needs to be globally unique. Changing this forces a new resource to be created.

property poolSize

poolSize?: pulumi.Input<number>;

The maximum size in MB that all databases in the elastic pool can grow to. The maximum size must be consistent with combination of edition and dtu and the limits documented in Azure SQL Database Service Tiers. If not defined when creating an elastic pool, the value is set to the size implied by edition and dtu.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the elastic pool. This must be the same as the resource group of the underlying SQL server.

property serverName

serverName: pulumi.Input<string>;

The name of the SQL Server on which to create the elastic pool. Changing this forces a new resource to be created.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface ElasticPoolState

Input properties used for looking up and filtering ElasticPool resources.

property creationDate

creationDate?: pulumi.Input<string>;

The creation date of the SQL Elastic Pool.

property dbDtuMax

dbDtuMax?: pulumi.Input<number>;

The maximum DTU which will be guaranteed to all databases in the elastic pool to be created.

property dbDtuMin

dbDtuMin?: pulumi.Input<number>;

The minimum DTU which will be guaranteed to all databases in the elastic pool to be created.

property dtu

dtu?: pulumi.Input<number>;

The total shared DTU for the elastic pool. Valid values depend on the edition which has been defined. Refer to Azure SQL Database Service Tiers for valid combinations.

property edition

edition?: pulumi.Input<string>;

The edition of the elastic pool to be created. Valid values are Basic, Standard, and Premium. Refer to Azure SQL Database Service Tiers for details. Changing this forces a new resource to be created.

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

The name of the elastic pool. This needs to be globally unique. Changing this forces a new resource to be created.

property poolSize

poolSize?: pulumi.Input<number>;

The maximum size in MB that all databases in the elastic pool can grow to. The maximum size must be consistent with combination of edition and dtu and the limits documented in Azure SQL Database Service Tiers. If not defined when creating an elastic pool, the value is set to the size implied by edition and dtu.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the elastic pool. This must be the same as the resource group of the underlying SQL server.

property serverName

serverName?: pulumi.Input<string>;

The name of the SQL Server on which to create the elastic pool. Changing this forces a new resource to be created.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface FirewallRuleArgs

The set of arguments for constructing a FirewallRule resource.

property endIpAddress

endIpAddress: pulumi.Input<string>;

The ending IP address to allow through the firewall for this rule.

property name

name?: pulumi.Input<string>;

The name of the firewall rule.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the sql server.

property serverName

serverName: pulumi.Input<string>;

The name of the SQL Server on which to create the Firewall Rule.

property startIpAddress

startIpAddress: pulumi.Input<string>;

The starting IP address to allow through the firewall for this rule.

interface FirewallRuleState

Input properties used for looking up and filtering FirewallRule resources.

property endIpAddress

endIpAddress?: pulumi.Input<string>;

The ending IP address to allow through the firewall for this rule.

property name

name?: pulumi.Input<string>;

The name of the firewall rule.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the sql server.

property serverName

serverName?: pulumi.Input<string>;

The name of the SQL Server on which to create the Firewall Rule.

property startIpAddress

startIpAddress?: pulumi.Input<string>;

The starting IP address to allow through the firewall for this rule.

interface GetServerArgs

A collection of arguments for invoking getServer.

property name

name: string;

The name of the SQL Server.

property resourceGroupName

resourceGroupName: string;

Specifies the name of the Resource Group where the SQL Server exists.

interface GetServerResult

A collection of values returned by getServer.

property administratorLogin

administratorLogin: string;

The administrator username of the SQL Server.

property fqdn

fqdn: string;

The fully qualified domain name of the SQL Server.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property location

location: string;

The location of the Resource Group in which the SQL Server exists.

property name

name: string;

property resourceGroupName

resourceGroupName: string;

property tags

tags: {[key: string]: any};

A mapping of tags assigned to the resource.

property version

version: string;

The version of the SQL Server.

interface SqlServerArgs

The set of arguments for constructing a SqlServer resource.

property administratorLogin

administratorLogin: pulumi.Input<string>;

The administrator login name for the new server. Changing this forces a new resource to be created.

property administratorLoginPassword

administratorLoginPassword: pulumi.Input<string>;

The password associated with the administratorLogin user. Needs to comply with Azure’s Password Policy

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

The name of the SQL Server. This needs to be globally unique within Azure.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the SQL Server.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property version

version: pulumi.Input<string>;

The version for the new server. Valid values are: 2.0 (for v11 server) and 12.0 (for v12 server).

interface SqlServerState

Input properties used for looking up and filtering SqlServer resources.

property administratorLogin

administratorLogin?: pulumi.Input<string>;

The administrator login name for the new server. Changing this forces a new resource to be created.

property administratorLoginPassword

administratorLoginPassword?: pulumi.Input<string>;

The password associated with the administratorLogin user. Needs to comply with Azure’s Password Policy

property fullyQualifiedDomainName

fullyQualifiedDomainName?: pulumi.Input<string>;

The fully qualified domain name of the Azure SQL Server (e.g. myServerName.database.windows.net)

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

The name of the SQL Server. This needs to be globally unique within Azure.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the SQL Server.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property version

version?: pulumi.Input<string>;

The version for the new server. Valid values are: 2.0 (for v11 server) and 12.0 (for v12 server).

interface VirtualNetworkRuleArgs

The set of arguments for constructing a VirtualNetworkRule resource.

property ignoreMissingVnetServiceEndpoint

ignoreMissingVnetServiceEndpoint?: pulumi.Input<boolean>;

Create the virtual network rule before the subnet has the virtual network service endpoint enabled. The default value is false.

property name

name?: pulumi.Input<string>;

The name of the SQL virtual network rule. Changing this forces a new resource to be created. Cannot be empty and must only contain alphanumeric characters and hyphens. Cannot start with a number, and cannot start or end with a hyphen.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group where the SQL server resides. Changing this forces a new resource to be created.

property serverName

serverName: pulumi.Input<string>;

The name of the SQL Server to which this SQL virtual network rule will be applied to. Changing this forces a new resource to be created.

property subnetId

subnetId: pulumi.Input<string>;

The ID of the subnet that the SQL server will be connected to.

interface VirtualNetworkRuleState

Input properties used for looking up and filtering VirtualNetworkRule resources.

property ignoreMissingVnetServiceEndpoint

ignoreMissingVnetServiceEndpoint?: pulumi.Input<boolean>;

Create the virtual network rule before the subnet has the virtual network service endpoint enabled. The default value is false.

property name

name?: pulumi.Input<string>;

The name of the SQL virtual network rule. Changing this forces a new resource to be created. Cannot be empty and must only contain alphanumeric characters and hyphens. Cannot start with a number, and cannot start or end with a hyphen.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group where the SQL server resides. Changing this forces a new resource to be created.

property serverName

serverName?: pulumi.Input<string>;

The name of the SQL Server to which this SQL virtual network rule will be applied to. Changing this forces a new resource to be created.

property subnetId

subnetId?: pulumi.Input<string>;

The ID of the subnet that the SQL server will be connected to.