1. Packages
  2. Azure Native v1
  3. API Docs
  4. sql
  5. Database
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

azure-native.sql.Database

Explore with Pulumi AI

azure-native-v1 logo
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

    A database resource. API Version: 2020-11-01-preview.

    Example Usage

    Creates a VCore database by specifying service objective name.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var database = new AzureNative.Sql.Database("database", new()
        {
            DatabaseName = "testdb",
            Location = "southeastasia",
            ResourceGroupName = "Default-SQL-SouthEastAsia",
            ServerName = "testsvr",
            Sku = new AzureNative.Sql.Inputs.SkuArgs
            {
                Capacity = 2,
                Family = "Gen4",
                Name = "BC",
            },
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewDatabase(ctx, "database", &sql.DatabaseArgs{
    			DatabaseName:      pulumi.String("testdb"),
    			Location:          pulumi.String("southeastasia"),
    			ResourceGroupName: pulumi.String("Default-SQL-SouthEastAsia"),
    			ServerName:        pulumi.String("testsvr"),
    			Sku: &sql.SkuArgs{
    				Capacity: pulumi.Int(2),
    				Family:   pulumi.String("Gen4"),
    				Name:     pulumi.String("BC"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.Database;
    import com.pulumi.azurenative.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 database = new Database("database", DatabaseArgs.builder()        
                .databaseName("testdb")
                .location("southeastasia")
                .resourceGroupName("Default-SQL-SouthEastAsia")
                .serverName("testsvr")
                .sku(Map.ofEntries(
                    Map.entry("capacity", 2),
                    Map.entry("family", "Gen4"),
                    Map.entry("name", "BC")
                ))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    database = azure_native.sql.Database("database",
        database_name="testdb",
        location="southeastasia",
        resource_group_name="Default-SQL-SouthEastAsia",
        server_name="testsvr",
        sku=azure_native.sql.SkuArgs(
            capacity=2,
            family="Gen4",
            name="BC",
        ))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const database = new azure_native.sql.Database("database", {
        databaseName: "testdb",
        location: "southeastasia",
        resourceGroupName: "Default-SQL-SouthEastAsia",
        serverName: "testsvr",
        sku: {
            capacity: 2,
            family: "Gen4",
            name: "BC",
        },
    });
    
    resources:
      database:
        type: azure-native:sql:Database
        properties:
          databaseName: testdb
          location: southeastasia
          resourceGroupName: Default-SQL-SouthEastAsia
          serverName: testsvr
          sku:
            capacity: 2
            family: Gen4
            name: BC
    

    Creates a VCore database by specifying sku name and capacity.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var database = new AzureNative.Sql.Database("database", new()
        {
            DatabaseName = "testdb",
            Location = "southeastasia",
            ResourceGroupName = "Default-SQL-SouthEastAsia",
            ServerName = "testsvr",
            Sku = new AzureNative.Sql.Inputs.SkuArgs
            {
                Capacity = 2,
                Name = "BC_Gen4",
            },
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewDatabase(ctx, "database", &sql.DatabaseArgs{
    			DatabaseName:      pulumi.String("testdb"),
    			Location:          pulumi.String("southeastasia"),
    			ResourceGroupName: pulumi.String("Default-SQL-SouthEastAsia"),
    			ServerName:        pulumi.String("testsvr"),
    			Sku: &sql.SkuArgs{
    				Capacity: pulumi.Int(2),
    				Name:     pulumi.String("BC_Gen4"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.Database;
    import com.pulumi.azurenative.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 database = new Database("database", DatabaseArgs.builder()        
                .databaseName("testdb")
                .location("southeastasia")
                .resourceGroupName("Default-SQL-SouthEastAsia")
                .serverName("testsvr")
                .sku(Map.ofEntries(
                    Map.entry("capacity", 2),
                    Map.entry("name", "BC_Gen4")
                ))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    database = azure_native.sql.Database("database",
        database_name="testdb",
        location="southeastasia",
        resource_group_name="Default-SQL-SouthEastAsia",
        server_name="testsvr",
        sku=azure_native.sql.SkuArgs(
            capacity=2,
            name="BC_Gen4",
        ))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const database = new azure_native.sql.Database("database", {
        databaseName: "testdb",
        location: "southeastasia",
        resourceGroupName: "Default-SQL-SouthEastAsia",
        serverName: "testsvr",
        sku: {
            capacity: 2,
            name: "BC_Gen4",
        },
    });
    
    resources:
      database:
        type: azure-native:sql:Database
        properties:
          databaseName: testdb
          location: southeastasia
          resourceGroupName: Default-SQL-SouthEastAsia
          serverName: testsvr
          sku:
            capacity: 2
            name: BC_Gen4
    

    Creates a database as a copy.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var database = new AzureNative.Sql.Database("database", new()
        {
            CreateMode = "Copy",
            DatabaseName = "dbcopy",
            Location = "southeastasia",
            ResourceGroupName = "Default-SQL-SouthEastAsia",
            ServerName = "testsvr",
            Sku = new AzureNative.Sql.Inputs.SkuArgs
            {
                Name = "S0",
                Tier = "Standard",
            },
            SourceDatabaseId = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewDatabase(ctx, "database", &sql.DatabaseArgs{
    			CreateMode:        pulumi.String("Copy"),
    			DatabaseName:      pulumi.String("dbcopy"),
    			Location:          pulumi.String("southeastasia"),
    			ResourceGroupName: pulumi.String("Default-SQL-SouthEastAsia"),
    			ServerName:        pulumi.String("testsvr"),
    			Sku: &sql.SkuArgs{
    				Name: pulumi.String("S0"),
    				Tier: pulumi.String("Standard"),
    			},
    			SourceDatabaseId: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.Database;
    import com.pulumi.azurenative.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 database = new Database("database", DatabaseArgs.builder()        
                .createMode("Copy")
                .databaseName("dbcopy")
                .location("southeastasia")
                .resourceGroupName("Default-SQL-SouthEastAsia")
                .serverName("testsvr")
                .sku(Map.ofEntries(
                    Map.entry("name", "S0"),
                    Map.entry("tier", "Standard")
                ))
                .sourceDatabaseId("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    database = azure_native.sql.Database("database",
        create_mode="Copy",
        database_name="dbcopy",
        location="southeastasia",
        resource_group_name="Default-SQL-SouthEastAsia",
        server_name="testsvr",
        sku=azure_native.sql.SkuArgs(
            name="S0",
            tier="Standard",
        ),
        source_database_id="/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const database = new azure_native.sql.Database("database", {
        createMode: "Copy",
        databaseName: "dbcopy",
        location: "southeastasia",
        resourceGroupName: "Default-SQL-SouthEastAsia",
        serverName: "testsvr",
        sku: {
            name: "S0",
            tier: "Standard",
        },
        sourceDatabaseId: "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
    });
    
    resources:
      database:
        type: azure-native:sql:Database
        properties:
          createMode: Copy
          databaseName: dbcopy
          location: southeastasia
          resourceGroupName: Default-SQL-SouthEastAsia
          serverName: testsvr
          sku:
            name: S0
            tier: Standard
          sourceDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb
    

    Creates a database as an on-line secondary.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var database = new AzureNative.Sql.Database("database", new()
        {
            CreateMode = "Secondary",
            DatabaseName = "testdb",
            Location = "southeastasia",
            ResourceGroupName = "Default-SQL-SouthEastAsia",
            SecondaryType = "Geo",
            ServerName = "testsvr",
            Sku = new AzureNative.Sql.Inputs.SkuArgs
            {
                Name = "S0",
                Tier = "Standard",
            },
            SourceDatabaseId = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb",
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewDatabase(ctx, "database", &sql.DatabaseArgs{
    			CreateMode:        pulumi.String("Secondary"),
    			DatabaseName:      pulumi.String("testdb"),
    			Location:          pulumi.String("southeastasia"),
    			ResourceGroupName: pulumi.String("Default-SQL-SouthEastAsia"),
    			SecondaryType:     pulumi.String("Geo"),
    			ServerName:        pulumi.String("testsvr"),
    			Sku: &sql.SkuArgs{
    				Name: pulumi.String("S0"),
    				Tier: pulumi.String("Standard"),
    			},
    			SourceDatabaseId: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.Database;
    import com.pulumi.azurenative.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 database = new Database("database", DatabaseArgs.builder()        
                .createMode("Secondary")
                .databaseName("testdb")
                .location("southeastasia")
                .resourceGroupName("Default-SQL-SouthEastAsia")
                .secondaryType("Geo")
                .serverName("testsvr")
                .sku(Map.ofEntries(
                    Map.entry("name", "S0"),
                    Map.entry("tier", "Standard")
                ))
                .sourceDatabaseId("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    database = azure_native.sql.Database("database",
        create_mode="Secondary",
        database_name="testdb",
        location="southeastasia",
        resource_group_name="Default-SQL-SouthEastAsia",
        secondary_type="Geo",
        server_name="testsvr",
        sku=azure_native.sql.SkuArgs(
            name="S0",
            tier="Standard",
        ),
        source_database_id="/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const database = new azure_native.sql.Database("database", {
        createMode: "Secondary",
        databaseName: "testdb",
        location: "southeastasia",
        resourceGroupName: "Default-SQL-SouthEastAsia",
        secondaryType: "Geo",
        serverName: "testsvr",
        sku: {
            name: "S0",
            tier: "Standard",
        },
        sourceDatabaseId: "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb",
    });
    
    resources:
      database:
        type: azure-native:sql:Database
        properties:
          createMode: Secondary
          databaseName: testdb
          location: southeastasia
          resourceGroupName: Default-SQL-SouthEastAsia
          secondaryType: Geo
          serverName: testsvr
          sku:
            name: S0
            tier: Standard
          sourceDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb
    

    Creates a database as named replica secondary.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var database = new AzureNative.Sql.Database("database", new()
        {
            CreateMode = "Secondary",
            DatabaseName = "testdb",
            Location = "southeastasia",
            ResourceGroupName = "Default-SQL-SouthEastAsia",
            SecondaryType = "Named",
            ServerName = "testsvr",
            Sku = new AzureNative.Sql.Inputs.SkuArgs
            {
                Capacity = 2,
                Name = "HS_Gen4",
                Tier = "Hyperscale",
            },
            SourceDatabaseId = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb",
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewDatabase(ctx, "database", &sql.DatabaseArgs{
    			CreateMode:        pulumi.String("Secondary"),
    			DatabaseName:      pulumi.String("testdb"),
    			Location:          pulumi.String("southeastasia"),
    			ResourceGroupName: pulumi.String("Default-SQL-SouthEastAsia"),
    			SecondaryType:     pulumi.String("Named"),
    			ServerName:        pulumi.String("testsvr"),
    			Sku: &sql.SkuArgs{
    				Capacity: pulumi.Int(2),
    				Name:     pulumi.String("HS_Gen4"),
    				Tier:     pulumi.String("Hyperscale"),
    			},
    			SourceDatabaseId: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.Database;
    import com.pulumi.azurenative.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 database = new Database("database", DatabaseArgs.builder()        
                .createMode("Secondary")
                .databaseName("testdb")
                .location("southeastasia")
                .resourceGroupName("Default-SQL-SouthEastAsia")
                .secondaryType("Named")
                .serverName("testsvr")
                .sku(Map.ofEntries(
                    Map.entry("capacity", 2),
                    Map.entry("name", "HS_Gen4"),
                    Map.entry("tier", "Hyperscale")
                ))
                .sourceDatabaseId("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    database = azure_native.sql.Database("database",
        create_mode="Secondary",
        database_name="testdb",
        location="southeastasia",
        resource_group_name="Default-SQL-SouthEastAsia",
        secondary_type="Named",
        server_name="testsvr",
        sku=azure_native.sql.SkuArgs(
            capacity=2,
            name="HS_Gen4",
            tier="Hyperscale",
        ),
        source_database_id="/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const database = new azure_native.sql.Database("database", {
        createMode: "Secondary",
        databaseName: "testdb",
        location: "southeastasia",
        resourceGroupName: "Default-SQL-SouthEastAsia",
        secondaryType: "Named",
        serverName: "testsvr",
        sku: {
            capacity: 2,
            name: "HS_Gen4",
            tier: "Hyperscale",
        },
        sourceDatabaseId: "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb",
    });
    
    resources:
      database:
        type: azure-native:sql:Database
        properties:
          createMode: Secondary
          databaseName: testdb
          location: southeastasia
          resourceGroupName: Default-SQL-SouthEastAsia
          secondaryType: Named
          serverName: testsvr
          sku:
            capacity: 2
            name: HS_Gen4
            tier: Hyperscale
          sourceDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb
    

    Creates a database from PointInTimeRestore.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var database = new AzureNative.Sql.Database("database", new()
        {
            CreateMode = "PointInTimeRestore",
            DatabaseName = "dbpitr",
            Location = "southeastasia",
            ResourceGroupName = "Default-SQL-SouthEastAsia",
            RestorePointInTime = "2020-10-22T05:35:31.503Z",
            ServerName = "testsvr",
            SourceDatabaseId = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewDatabase(ctx, "database", &sql.DatabaseArgs{
    			CreateMode:         pulumi.String("PointInTimeRestore"),
    			DatabaseName:       pulumi.String("dbpitr"),
    			Location:           pulumi.String("southeastasia"),
    			ResourceGroupName:  pulumi.String("Default-SQL-SouthEastAsia"),
    			RestorePointInTime: pulumi.String("2020-10-22T05:35:31.503Z"),
    			ServerName:         pulumi.String("testsvr"),
    			SourceDatabaseId:   pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.Database;
    import com.pulumi.azurenative.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 database = new Database("database", DatabaseArgs.builder()        
                .createMode("PointInTimeRestore")
                .databaseName("dbpitr")
                .location("southeastasia")
                .resourceGroupName("Default-SQL-SouthEastAsia")
                .restorePointInTime("2020-10-22T05:35:31.503Z")
                .serverName("testsvr")
                .sourceDatabaseId("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    database = azure_native.sql.Database("database",
        create_mode="PointInTimeRestore",
        database_name="dbpitr",
        location="southeastasia",
        resource_group_name="Default-SQL-SouthEastAsia",
        restore_point_in_time="2020-10-22T05:35:31.503Z",
        server_name="testsvr",
        source_database_id="/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const database = new azure_native.sql.Database("database", {
        createMode: "PointInTimeRestore",
        databaseName: "dbpitr",
        location: "southeastasia",
        resourceGroupName: "Default-SQL-SouthEastAsia",
        restorePointInTime: "2020-10-22T05:35:31.503Z",
        serverName: "testsvr",
        sourceDatabaseId: "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
    });
    
    resources:
      database:
        type: azure-native:sql:Database
        properties:
          createMode: PointInTimeRestore
          databaseName: dbpitr
          location: southeastasia
          resourceGroupName: Default-SQL-SouthEastAsia
          restorePointInTime: 2020-10-22T05:35:31.503Z
          serverName: testsvr
          sourceDatabaseId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb
    

    Creates a database with default mode.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var database = new AzureNative.Sql.Database("database", new()
        {
            Collation = "SQL_Latin1_General_CP1_CI_AS",
            CreateMode = "Default",
            DatabaseName = "testdb",
            Location = "southeastasia",
            MaxSizeBytes = 1073741824,
            ResourceGroupName = "Default-SQL-SouthEastAsia",
            ServerName = "testsvr",
            Sku = new AzureNative.Sql.Inputs.SkuArgs
            {
                Name = "S0",
                Tier = "Standard",
            },
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewDatabase(ctx, "database", &sql.DatabaseArgs{
    			Collation:         pulumi.String("SQL_Latin1_General_CP1_CI_AS"),
    			CreateMode:        pulumi.String("Default"),
    			DatabaseName:      pulumi.String("testdb"),
    			Location:          pulumi.String("southeastasia"),
    			MaxSizeBytes:      pulumi.Float64(1073741824),
    			ResourceGroupName: pulumi.String("Default-SQL-SouthEastAsia"),
    			ServerName:        pulumi.String("testsvr"),
    			Sku: &sql.SkuArgs{
    				Name: pulumi.String("S0"),
    				Tier: pulumi.String("Standard"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.Database;
    import com.pulumi.azurenative.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 database = new Database("database", DatabaseArgs.builder()        
                .collation("SQL_Latin1_General_CP1_CI_AS")
                .createMode("Default")
                .databaseName("testdb")
                .location("southeastasia")
                .maxSizeBytes(1073741824)
                .resourceGroupName("Default-SQL-SouthEastAsia")
                .serverName("testsvr")
                .sku(Map.ofEntries(
                    Map.entry("name", "S0"),
                    Map.entry("tier", "Standard")
                ))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    database = azure_native.sql.Database("database",
        collation="SQL_Latin1_General_CP1_CI_AS",
        create_mode="Default",
        database_name="testdb",
        location="southeastasia",
        max_size_bytes=1073741824,
        resource_group_name="Default-SQL-SouthEastAsia",
        server_name="testsvr",
        sku=azure_native.sql.SkuArgs(
            name="S0",
            tier="Standard",
        ))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const database = new azure_native.sql.Database("database", {
        collation: "SQL_Latin1_General_CP1_CI_AS",
        createMode: "Default",
        databaseName: "testdb",
        location: "southeastasia",
        maxSizeBytes: 1073741824,
        resourceGroupName: "Default-SQL-SouthEastAsia",
        serverName: "testsvr",
        sku: {
            name: "S0",
            tier: "Standard",
        },
    });
    
    resources:
      database:
        type: azure-native:sql:Database
        properties:
          collation: SQL_Latin1_General_CP1_CI_AS
          createMode: Default
          databaseName: testdb
          location: southeastasia
          maxSizeBytes: 1.073741824e+09
          resourceGroupName: Default-SQL-SouthEastAsia
          serverName: testsvr
          sku:
            name: S0
            tier: Standard
    

    Creates a database with minimum number of parameters.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var database = new AzureNative.Sql.Database("database", new()
        {
            DatabaseName = "testdb",
            Location = "southeastasia",
            ResourceGroupName = "Default-SQL-SouthEastAsia",
            ServerName = "testsvr",
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewDatabase(ctx, "database", &sql.DatabaseArgs{
    			DatabaseName:      pulumi.String("testdb"),
    			Location:          pulumi.String("southeastasia"),
    			ResourceGroupName: pulumi.String("Default-SQL-SouthEastAsia"),
    			ServerName:        pulumi.String("testsvr"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.Database;
    import com.pulumi.azurenative.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 database = new Database("database", DatabaseArgs.builder()        
                .databaseName("testdb")
                .location("southeastasia")
                .resourceGroupName("Default-SQL-SouthEastAsia")
                .serverName("testsvr")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    database = azure_native.sql.Database("database",
        database_name="testdb",
        location="southeastasia",
        resource_group_name="Default-SQL-SouthEastAsia",
        server_name="testsvr")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const database = new azure_native.sql.Database("database", {
        databaseName: "testdb",
        location: "southeastasia",
        resourceGroupName: "Default-SQL-SouthEastAsia",
        serverName: "testsvr",
    });
    
    resources:
      database:
        type: azure-native:sql:Database
        properties:
          databaseName: testdb
          location: southeastasia
          resourceGroupName: Default-SQL-SouthEastAsia
          serverName: testsvr
    

    Creates a database with preferred maintenance window.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var database = new AzureNative.Sql.Database("database", new()
        {
            Collation = "SQL_Latin1_General_CP1_CI_AS",
            CreateMode = "Default",
            DatabaseName = "testdb",
            Location = "southeastasia",
            MaintenanceConfigurationId = "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1",
            MaxSizeBytes = 1073741824,
            ResourceGroupName = "Default-SQL-SouthEastAsia",
            ServerName = "testsvr",
            Sku = new AzureNative.Sql.Inputs.SkuArgs
            {
                Name = "S2",
                Tier = "Standard",
            },
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewDatabase(ctx, "database", &sql.DatabaseArgs{
    			Collation:                  pulumi.String("SQL_Latin1_General_CP1_CI_AS"),
    			CreateMode:                 pulumi.String("Default"),
    			DatabaseName:               pulumi.String("testdb"),
    			Location:                   pulumi.String("southeastasia"),
    			MaintenanceConfigurationId: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"),
    			MaxSizeBytes:               pulumi.Float64(1073741824),
    			ResourceGroupName:          pulumi.String("Default-SQL-SouthEastAsia"),
    			ServerName:                 pulumi.String("testsvr"),
    			Sku: &sql.SkuArgs{
    				Name: pulumi.String("S2"),
    				Tier: pulumi.String("Standard"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.Database;
    import com.pulumi.azurenative.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 database = new Database("database", DatabaseArgs.builder()        
                .collation("SQL_Latin1_General_CP1_CI_AS")
                .createMode("Default")
                .databaseName("testdb")
                .location("southeastasia")
                .maintenanceConfigurationId("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1")
                .maxSizeBytes(1073741824)
                .resourceGroupName("Default-SQL-SouthEastAsia")
                .serverName("testsvr")
                .sku(Map.ofEntries(
                    Map.entry("name", "S2"),
                    Map.entry("tier", "Standard")
                ))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    database = azure_native.sql.Database("database",
        collation="SQL_Latin1_General_CP1_CI_AS",
        create_mode="Default",
        database_name="testdb",
        location="southeastasia",
        maintenance_configuration_id="/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1",
        max_size_bytes=1073741824,
        resource_group_name="Default-SQL-SouthEastAsia",
        server_name="testsvr",
        sku=azure_native.sql.SkuArgs(
            name="S2",
            tier="Standard",
        ))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const database = new azure_native.sql.Database("database", {
        collation: "SQL_Latin1_General_CP1_CI_AS",
        createMode: "Default",
        databaseName: "testdb",
        location: "southeastasia",
        maintenanceConfigurationId: "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1",
        maxSizeBytes: 1073741824,
        resourceGroupName: "Default-SQL-SouthEastAsia",
        serverName: "testsvr",
        sku: {
            name: "S2",
            tier: "Standard",
        },
    });
    
    resources:
      database:
        type: azure-native:sql:Database
        properties:
          collation: SQL_Latin1_General_CP1_CI_AS
          createMode: Default
          databaseName: testdb
          location: southeastasia
          maintenanceConfigurationId: /subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1
          maxSizeBytes: 1.073741824e+09
          resourceGroupName: Default-SQL-SouthEastAsia
          serverName: testsvr
          sku:
            name: S2
            tier: Standard
    

    Creates a database with specified backup storage redundancy.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var database = new AzureNative.Sql.Database("database", new()
        {
            DatabaseName = "testdb",
            Location = "southeastasia",
            RequestedBackupStorageRedundancy = "Zone",
            ResourceGroupName = "Default-SQL-SouthEastAsia",
            ServerName = "testsvr",
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewDatabase(ctx, "database", &sql.DatabaseArgs{
    			DatabaseName:                     pulumi.String("testdb"),
    			Location:                         pulumi.String("southeastasia"),
    			RequestedBackupStorageRedundancy: pulumi.String("Zone"),
    			ResourceGroupName:                pulumi.String("Default-SQL-SouthEastAsia"),
    			ServerName:                       pulumi.String("testsvr"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.Database;
    import com.pulumi.azurenative.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 database = new Database("database", DatabaseArgs.builder()        
                .databaseName("testdb")
                .location("southeastasia")
                .requestedBackupStorageRedundancy("Zone")
                .resourceGroupName("Default-SQL-SouthEastAsia")
                .serverName("testsvr")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    database = azure_native.sql.Database("database",
        database_name="testdb",
        location="southeastasia",
        requested_backup_storage_redundancy="Zone",
        resource_group_name="Default-SQL-SouthEastAsia",
        server_name="testsvr")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const database = new azure_native.sql.Database("database", {
        databaseName: "testdb",
        location: "southeastasia",
        requestedBackupStorageRedundancy: "Zone",
        resourceGroupName: "Default-SQL-SouthEastAsia",
        serverName: "testsvr",
    });
    
    resources:
      database:
        type: azure-native:sql:Database
        properties:
          databaseName: testdb
          location: southeastasia
          requestedBackupStorageRedundancy: Zone
          resourceGroupName: Default-SQL-SouthEastAsia
          serverName: testsvr
    

    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,
                 recoverable_database_id: Optional[str] = None,
                 database_name: Optional[str] = None,
                 recovery_services_recovery_point_id: Optional[str] = None,
                 requested_backup_storage_redundancy: Optional[Union[str, RequestedBackupStorageRedundancy]] = None,
                 high_availability_replica_count: Optional[int] = None,
                 license_type: Optional[Union[str, DatabaseLicenseType]] = None,
                 location: Optional[str] = None,
                 long_term_retention_backup_resource_id: Optional[str] = None,
                 maintenance_configuration_id: Optional[str] = None,
                 max_size_bytes: Optional[float] = None,
                 min_capacity: Optional[float] = None,
                 read_scale: Optional[Union[str, DatabaseReadScale]] = None,
                 zone_redundant: Optional[bool] = None,
                 create_mode: Optional[Union[str, CreateMode]] = None,
                 elastic_pool_id: Optional[str] = None,
                 collation: Optional[str] = None,
                 restorable_dropped_database_id: Optional[str] = None,
                 restore_point_in_time: Optional[str] = None,
                 sample_name: Optional[Union[str, SampleName]] = None,
                 secondary_type: Optional[Union[str, SecondaryType]] = None,
                 catalog_collation: Optional[Union[str, CatalogCollationType]] = None,
                 sku: Optional[SkuArgs] = None,
                 source_database_deletion_date: Optional[str] = None,
                 source_database_id: Optional[str] = None,
                 tags: Optional[Mapping[str, str]] = None,
                 auto_pause_delay: Optional[int] = 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-native: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 exampledatabaseResourceResourceFromSql = new AzureNative.Sql.Database("exampledatabaseResourceResourceFromSql", new()
    {
        ResourceGroupName = "string",
        ServerName = "string",
        RecoverableDatabaseId = "string",
        DatabaseName = "string",
        RecoveryServicesRecoveryPointId = "string",
        RequestedBackupStorageRedundancy = "string",
        HighAvailabilityReplicaCount = 0,
        LicenseType = "string",
        Location = "string",
        LongTermRetentionBackupResourceId = "string",
        MaintenanceConfigurationId = "string",
        MaxSizeBytes = 0,
        MinCapacity = 0,
        ReadScale = "string",
        ZoneRedundant = false,
        CreateMode = "string",
        ElasticPoolId = "string",
        Collation = "string",
        RestorableDroppedDatabaseId = "string",
        RestorePointInTime = "string",
        SampleName = "string",
        SecondaryType = "string",
        CatalogCollation = "string",
        Sku = 
        {
            { "name", "string" },
            { "capacity", 0 },
            { "family", "string" },
            { "size", "string" },
            { "tier", "string" },
        },
        SourceDatabaseDeletionDate = "string",
        SourceDatabaseId = "string",
        Tags = 
        {
            { "string", "string" },
        },
        AutoPauseDelay = 0,
    });
    
    example, err := sql.NewDatabase(ctx, "exampledatabaseResourceResourceFromSql", &sql.DatabaseArgs{
    	ResourceGroupName:                 "string",
    	ServerName:                        "string",
    	RecoverableDatabaseId:             "string",
    	DatabaseName:                      "string",
    	RecoveryServicesRecoveryPointId:   "string",
    	RequestedBackupStorageRedundancy:  "string",
    	HighAvailabilityReplicaCount:      0,
    	LicenseType:                       "string",
    	Location:                          "string",
    	LongTermRetentionBackupResourceId: "string",
    	MaintenanceConfigurationId:        "string",
    	MaxSizeBytes:                      0,
    	MinCapacity:                       0,
    	ReadScale:                         "string",
    	ZoneRedundant:                     false,
    	CreateMode:                        "string",
    	ElasticPoolId:                     "string",
    	Collation:                         "string",
    	RestorableDroppedDatabaseId:       "string",
    	RestorePointInTime:                "string",
    	SampleName:                        "string",
    	SecondaryType:                     "string",
    	CatalogCollation:                  "string",
    	Sku: map[string]interface{}{
    		"name":     "string",
    		"capacity": 0,
    		"family":   "string",
    		"size":     "string",
    		"tier":     "string",
    	},
    	SourceDatabaseDeletionDate: "string",
    	SourceDatabaseId:           "string",
    	Tags: map[string]interface{}{
    		"string": "string",
    	},
    	AutoPauseDelay: 0,
    })
    
    var exampledatabaseResourceResourceFromSql = new Database("exampledatabaseResourceResourceFromSql", DatabaseArgs.builder()
        .resourceGroupName("string")
        .serverName("string")
        .recoverableDatabaseId("string")
        .databaseName("string")
        .recoveryServicesRecoveryPointId("string")
        .requestedBackupStorageRedundancy("string")
        .highAvailabilityReplicaCount(0)
        .licenseType("string")
        .location("string")
        .longTermRetentionBackupResourceId("string")
        .maintenanceConfigurationId("string")
        .maxSizeBytes(0)
        .minCapacity(0)
        .readScale("string")
        .zoneRedundant(false)
        .createMode("string")
        .elasticPoolId("string")
        .collation("string")
        .restorableDroppedDatabaseId("string")
        .restorePointInTime("string")
        .sampleName("string")
        .secondaryType("string")
        .catalogCollation("string")
        .sku(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
        .sourceDatabaseDeletionDate("string")
        .sourceDatabaseId("string")
        .tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
        .autoPauseDelay(0)
        .build());
    
    exampledatabase_resource_resource_from_sql = azure_native.sql.Database("exampledatabaseResourceResourceFromSql",
        resource_group_name=string,
        server_name=string,
        recoverable_database_id=string,
        database_name=string,
        recovery_services_recovery_point_id=string,
        requested_backup_storage_redundancy=string,
        high_availability_replica_count=0,
        license_type=string,
        location=string,
        long_term_retention_backup_resource_id=string,
        maintenance_configuration_id=string,
        max_size_bytes=0,
        min_capacity=0,
        read_scale=string,
        zone_redundant=False,
        create_mode=string,
        elastic_pool_id=string,
        collation=string,
        restorable_dropped_database_id=string,
        restore_point_in_time=string,
        sample_name=string,
        secondary_type=string,
        catalog_collation=string,
        sku={
            name: string,
            capacity: 0,
            family: string,
            size: string,
            tier: string,
        },
        source_database_deletion_date=string,
        source_database_id=string,
        tags={
            string: string,
        },
        auto_pause_delay=0)
    
    const exampledatabaseResourceResourceFromSql = new azure_native.sql.Database("exampledatabaseResourceResourceFromSql", {
        resourceGroupName: "string",
        serverName: "string",
        recoverableDatabaseId: "string",
        databaseName: "string",
        recoveryServicesRecoveryPointId: "string",
        requestedBackupStorageRedundancy: "string",
        highAvailabilityReplicaCount: 0,
        licenseType: "string",
        location: "string",
        longTermRetentionBackupResourceId: "string",
        maintenanceConfigurationId: "string",
        maxSizeBytes: 0,
        minCapacity: 0,
        readScale: "string",
        zoneRedundant: false,
        createMode: "string",
        elasticPoolId: "string",
        collation: "string",
        restorableDroppedDatabaseId: "string",
        restorePointInTime: "string",
        sampleName: "string",
        secondaryType: "string",
        catalogCollation: "string",
        sku: {
            name: "string",
            capacity: 0,
            family: "string",
            size: "string",
            tier: "string",
        },
        sourceDatabaseDeletionDate: "string",
        sourceDatabaseId: "string",
        tags: {
            string: "string",
        },
        autoPauseDelay: 0,
    });
    
    type: azure-native:sql:Database
    properties:
        autoPauseDelay: 0
        catalogCollation: string
        collation: string
        createMode: string
        databaseName: string
        elasticPoolId: string
        highAvailabilityReplicaCount: 0
        licenseType: string
        location: string
        longTermRetentionBackupResourceId: string
        maintenanceConfigurationId: string
        maxSizeBytes: 0
        minCapacity: 0
        readScale: string
        recoverableDatabaseId: string
        recoveryServicesRecoveryPointId: string
        requestedBackupStorageRedundancy: string
        resourceGroupName: string
        restorableDroppedDatabaseId: string
        restorePointInTime: string
        sampleName: string
        secondaryType: string
        serverName: string
        sku:
            capacity: 0
            family: string
            name: string
            size: string
            tier: string
        sourceDatabaseDeletionDate: string
        sourceDatabaseId: string
        tags:
            string: 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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Database resource accepts the following input properties:

    ResourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    ServerName string
    The name of the server.
    AutoPauseDelay int
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
    CatalogCollation string | Pulumi.AzureNative.Sql.CatalogCollationType
    Collation of the metadata catalog.
    Collation string
    The collation of the database.
    CreateMode string | Pulumi.AzureNative.Sql.CreateMode

    Specifies the mode of database creation.

    Default: regular database creation.

    Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.

    Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.

    PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.

    Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.

    Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.

    RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.

    Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.

    DatabaseName string
    The name of the database.
    ElasticPoolId string
    The resource identifier of the elastic pool containing this database.
    HighAvailabilityReplicaCount int
    The number of secondary replicas associated with the database that are used to provide high availability.
    LicenseType string | Pulumi.AzureNative.Sql.DatabaseLicenseType
    The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.
    Location string
    Resource location.
    LongTermRetentionBackupResourceId string
    The resource identifier of the long term retention backup associated with create operation of this database.
    MaintenanceConfigurationId string
    Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
    MaxSizeBytes double
    The max size of the database expressed in bytes.
    MinCapacity double
    Minimal capacity that database will always have allocated, if not paused
    ReadScale string | Pulumi.AzureNative.Sql.DatabaseReadScale
    The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region.
    RecoverableDatabaseId string
    The resource identifier of the recoverable database associated with create operation of this database.
    RecoveryServicesRecoveryPointId string
    The resource identifier of the recovery point associated with create operation of this database.
    RequestedBackupStorageRedundancy string | Pulumi.AzureNative.Sql.RequestedBackupStorageRedundancy
    The storage account type to be used to store backups for this database.
    RestorableDroppedDatabaseId string
    The resource identifier of the restorable dropped database associated with create operation of this database.
    RestorePointInTime string
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
    SampleName string | Pulumi.AzureNative.Sql.SampleName
    The name of the sample schema to apply when creating this database.
    SecondaryType string | Pulumi.AzureNative.Sql.SecondaryType
    The secondary type of the database if it is a secondary. Valid values are Geo and Named.
    Sku Pulumi.AzureNative.Sql.Inputs.Sku

    The database SKU.

    The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the Capabilities_ListByLocation REST API or one of the following commands:

    az sql db list-editions -l <location> -o table
    
    Get-AzSqlServerServiceObjective -Location <location>
    
    SourceDatabaseDeletionDate string
    Specifies the time that the database was deleted.
    SourceDatabaseId string
    The resource identifier of the source database associated with create operation of this database.
    Tags Dictionary<string, string>
    Resource tags.
    ZoneRedundant bool
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
    ResourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    ServerName string
    The name of the server.
    AutoPauseDelay int
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
    CatalogCollation string | CatalogCollationType
    Collation of the metadata catalog.
    Collation string
    The collation of the database.
    CreateMode string | CreateMode

    Specifies the mode of database creation.

    Default: regular database creation.

    Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.

    Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.

    PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.

    Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.

    Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.

    RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.

    Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.

    DatabaseName string
    The name of the database.
    ElasticPoolId string
    The resource identifier of the elastic pool containing this database.
    HighAvailabilityReplicaCount int
    The number of secondary replicas associated with the database that are used to provide high availability.
    LicenseType string | DatabaseLicenseType
    The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.
    Location string
    Resource location.
    LongTermRetentionBackupResourceId string
    The resource identifier of the long term retention backup associated with create operation of this database.
    MaintenanceConfigurationId string
    Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
    MaxSizeBytes float64
    The max size of the database expressed in bytes.
    MinCapacity float64
    Minimal capacity that database will always have allocated, if not paused
    ReadScale string | DatabaseReadScale
    The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region.
    RecoverableDatabaseId string
    The resource identifier of the recoverable database associated with create operation of this database.
    RecoveryServicesRecoveryPointId string
    The resource identifier of the recovery point associated with create operation of this database.
    RequestedBackupStorageRedundancy string | RequestedBackupStorageRedundancy
    The storage account type to be used to store backups for this database.
    RestorableDroppedDatabaseId string
    The resource identifier of the restorable dropped database associated with create operation of this database.
    RestorePointInTime string
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
    SampleName string | SampleName
    The name of the sample schema to apply when creating this database.
    SecondaryType string | SecondaryType
    The secondary type of the database if it is a secondary. Valid values are Geo and Named.
    Sku SkuArgs

    The database SKU.

    The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the Capabilities_ListByLocation REST API or one of the following commands:

    az sql db list-editions -l <location> -o table
    
    Get-AzSqlServerServiceObjective -Location <location>
    
    SourceDatabaseDeletionDate string
    Specifies the time that the database was deleted.
    SourceDatabaseId string
    The resource identifier of the source database associated with create operation of this database.
    Tags map[string]string
    Resource tags.
    ZoneRedundant bool
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
    resourceGroupName String
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    serverName String
    The name of the server.
    autoPauseDelay Integer
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
    catalogCollation String | CatalogCollationType
    Collation of the metadata catalog.
    collation String
    The collation of the database.
    createMode String | CreateMode

    Specifies the mode of database creation.

    Default: regular database creation.

    Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.

    Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.

    PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.

    Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.

    Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.

    RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.

    Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.

    databaseName String
    The name of the database.
    elasticPoolId String
    The resource identifier of the elastic pool containing this database.
    highAvailabilityReplicaCount Integer
    The number of secondary replicas associated with the database that are used to provide high availability.
    licenseType String | DatabaseLicenseType
    The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.
    location String
    Resource location.
    longTermRetentionBackupResourceId String
    The resource identifier of the long term retention backup associated with create operation of this database.
    maintenanceConfigurationId String
    Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
    maxSizeBytes Double
    The max size of the database expressed in bytes.
    minCapacity Double
    Minimal capacity that database will always have allocated, if not paused
    readScale String | DatabaseReadScale
    The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region.
    recoverableDatabaseId String
    The resource identifier of the recoverable database associated with create operation of this database.
    recoveryServicesRecoveryPointId String
    The resource identifier of the recovery point associated with create operation of this database.
    requestedBackupStorageRedundancy String | RequestedBackupStorageRedundancy
    The storage account type to be used to store backups for this database.
    restorableDroppedDatabaseId String
    The resource identifier of the restorable dropped database associated with create operation of this database.
    restorePointInTime String
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
    sampleName String | SampleName
    The name of the sample schema to apply when creating this database.
    secondaryType String | SecondaryType
    The secondary type of the database if it is a secondary. Valid values are Geo and Named.
    sku Sku

    The database SKU.

    The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the Capabilities_ListByLocation REST API or one of the following commands:

    az sql db list-editions -l <location> -o table
    
    Get-AzSqlServerServiceObjective -Location <location>
    
    sourceDatabaseDeletionDate String
    Specifies the time that the database was deleted.
    sourceDatabaseId String
    The resource identifier of the source database associated with create operation of this database.
    tags Map<String,String>
    Resource tags.
    zoneRedundant Boolean
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
    resourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    serverName string
    The name of the server.
    autoPauseDelay number
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
    catalogCollation string | CatalogCollationType
    Collation of the metadata catalog.
    collation string
    The collation of the database.
    createMode string | CreateMode

    Specifies the mode of database creation.

    Default: regular database creation.

    Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.

    Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.

    PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.

    Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.

    Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.

    RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.

    Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.

    databaseName string
    The name of the database.
    elasticPoolId string
    The resource identifier of the elastic pool containing this database.
    highAvailabilityReplicaCount number
    The number of secondary replicas associated with the database that are used to provide high availability.
    licenseType string | DatabaseLicenseType
    The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.
    location string
    Resource location.
    longTermRetentionBackupResourceId string
    The resource identifier of the long term retention backup associated with create operation of this database.
    maintenanceConfigurationId string
    Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
    maxSizeBytes number
    The max size of the database expressed in bytes.
    minCapacity number
    Minimal capacity that database will always have allocated, if not paused
    readScale string | DatabaseReadScale
    The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region.
    recoverableDatabaseId string
    The resource identifier of the recoverable database associated with create operation of this database.
    recoveryServicesRecoveryPointId string
    The resource identifier of the recovery point associated with create operation of this database.
    requestedBackupStorageRedundancy string | RequestedBackupStorageRedundancy
    The storage account type to be used to store backups for this database.
    restorableDroppedDatabaseId string
    The resource identifier of the restorable dropped database associated with create operation of this database.
    restorePointInTime string
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
    sampleName string | SampleName
    The name of the sample schema to apply when creating this database.
    secondaryType string | SecondaryType
    The secondary type of the database if it is a secondary. Valid values are Geo and Named.
    sku Sku

    The database SKU.

    The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the Capabilities_ListByLocation REST API or one of the following commands:

    az sql db list-editions -l <location> -o table
    
    Get-AzSqlServerServiceObjective -Location <location>
    
    sourceDatabaseDeletionDate string
    Specifies the time that the database was deleted.
    sourceDatabaseId string
    The resource identifier of the source database associated with create operation of this database.
    tags {[key: string]: string}
    Resource tags.
    zoneRedundant 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_name str
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    server_name str
    The name of the server.
    auto_pause_delay int
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
    catalog_collation str | CatalogCollationType
    Collation of the metadata catalog.
    collation str
    The collation of the database.
    create_mode str | CreateMode

    Specifies the mode of database creation.

    Default: regular database creation.

    Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.

    Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.

    PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.

    Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.

    Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.

    RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.

    Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.

    database_name str
    The name of the database.
    elastic_pool_id str
    The resource identifier of the elastic pool containing this database.
    high_availability_replica_count int
    The number of secondary replicas associated with the database that are used to provide high availability.
    license_type str | DatabaseLicenseType
    The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.
    location str
    Resource location.
    long_term_retention_backup_resource_id str
    The resource identifier of the long term retention backup associated with create operation of this database.
    maintenance_configuration_id str
    Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
    max_size_bytes float
    The max size of the database expressed in bytes.
    min_capacity float
    Minimal capacity that database will always have allocated, if not paused
    read_scale str | DatabaseReadScale
    The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region.
    recoverable_database_id str
    The resource identifier of the recoverable database associated with create operation of this database.
    recovery_services_recovery_point_id str
    The resource identifier of the recovery point associated with create operation of this database.
    requested_backup_storage_redundancy str | RequestedBackupStorageRedundancy
    The storage account type to be used to store backups for this database.
    restorable_dropped_database_id str
    The resource identifier of the restorable dropped database associated with create operation of this database.
    restore_point_in_time str
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
    sample_name str | SampleName
    The name of the sample schema to apply when creating this database.
    secondary_type str | SecondaryType
    The secondary type of the database if it is a secondary. Valid values are Geo and Named.
    sku SkuArgs

    The database SKU.

    The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the Capabilities_ListByLocation REST API or one of the following commands:

    az sql db list-editions -l <location> -o table
    
    Get-AzSqlServerServiceObjective -Location <location>
    
    source_database_deletion_date str
    Specifies the time that the database was deleted.
    source_database_id str
    The resource identifier of the source database associated with create operation of this database.
    tags Mapping[str, str]
    Resource tags.
    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.
    resourceGroupName String
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    serverName String
    The name of the server.
    autoPauseDelay Number
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
    catalogCollation String | "DATABASE_DEFAULT" | "SQL_Latin1_General_CP1_CI_AS"
    Collation of the metadata catalog.
    collation String
    The collation of the database.
    createMode String | "Default" | "Copy" | "Secondary" | "PointInTimeRestore" | "Restore" | "Recovery" | "RestoreExternalBackup" | "RestoreExternalBackupSecondary" | "RestoreLongTermRetentionBackup" | "OnlineSecondary"

    Specifies the mode of database creation.

    Default: regular database creation.

    Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.

    Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.

    PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.

    Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.

    Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.

    RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.

    Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.

    databaseName String
    The name of the database.
    elasticPoolId String
    The resource identifier of the elastic pool containing this database.
    highAvailabilityReplicaCount Number
    The number of secondary replicas associated with the database that are used to provide high availability.
    licenseType String | "LicenseIncluded" | "BasePrice"
    The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.
    location String
    Resource location.
    longTermRetentionBackupResourceId String
    The resource identifier of the long term retention backup associated with create operation of this database.
    maintenanceConfigurationId String
    Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
    maxSizeBytes Number
    The max size of the database expressed in bytes.
    minCapacity Number
    Minimal capacity that database will always have allocated, if not paused
    readScale String | "Enabled" | "Disabled"
    The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region.
    recoverableDatabaseId String
    The resource identifier of the recoverable database associated with create operation of this database.
    recoveryServicesRecoveryPointId String
    The resource identifier of the recovery point associated with create operation of this database.
    requestedBackupStorageRedundancy String | "Geo" | "Local" | "Zone"
    The storage account type to be used to store backups for this database.
    restorableDroppedDatabaseId String
    The resource identifier of the restorable dropped database associated with create operation of this database.
    restorePointInTime String
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
    sampleName String | "AdventureWorksLT" | "WideWorldImportersStd" | "WideWorldImportersFull"
    The name of the sample schema to apply when creating this database.
    secondaryType String | "Geo" | "Named"
    The secondary type of the database if it is a secondary. Valid values are Geo and Named.
    sku Property Map

    The database SKU.

    The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the Capabilities_ListByLocation REST API or one of the following commands:

    az sql db list-editions -l <location> -o table
    
    Get-AzSqlServerServiceObjective -Location <location>
    
    sourceDatabaseDeletionDate String
    Specifies the time that the database was deleted.
    sourceDatabaseId String
    The resource identifier of the source database associated with create operation of this database.
    tags Map<String>
    Resource tags.
    zoneRedundant 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:

    CreationDate string
    The creation date of the database (ISO8601 format).
    CurrentBackupStorageRedundancy string
    The storage account type used to store backups for this database.
    CurrentServiceObjectiveName string
    The current service level objective name of the database.
    CurrentSku Pulumi.AzureNative.Sql.Outputs.SkuResponse
    The name and tier of the SKU.
    DatabaseId string
    The ID of the database.
    DefaultSecondaryLocation string
    The default secondary region for this database.
    EarliestRestoreDate string
    This records the earliest start date and time that restore is available for this database (ISO8601 format).
    FailoverGroupId string
    Failover Group resource identifier that this database belongs to.
    Id string
    The provider-assigned unique ID for this managed resource.
    Kind string
    Kind of database. This is metadata used for the Azure portal experience.
    ManagedBy string
    Resource that manages the database.
    MaxLogSizeBytes double
    The max log size for this database.
    Name string
    Resource name.
    PausedDate string
    The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
    RequestedServiceObjectiveName string
    The requested service level objective name of the database.
    ResumedDate string
    The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.
    Status string
    The status of the database.
    Type string
    Resource type.
    CreationDate string
    The creation date of the database (ISO8601 format).
    CurrentBackupStorageRedundancy string
    The storage account type used to store backups for this database.
    CurrentServiceObjectiveName string
    The current service level objective name of the database.
    CurrentSku SkuResponse
    The name and tier of the SKU.
    DatabaseId string
    The ID of the database.
    DefaultSecondaryLocation string
    The default secondary region for this database.
    EarliestRestoreDate string
    This records the earliest start date and time that restore is available for this database (ISO8601 format).
    FailoverGroupId string
    Failover Group resource identifier that this database belongs to.
    Id string
    The provider-assigned unique ID for this managed resource.
    Kind string
    Kind of database. This is metadata used for the Azure portal experience.
    ManagedBy string
    Resource that manages the database.
    MaxLogSizeBytes float64
    The max log size for this database.
    Name string
    Resource name.
    PausedDate string
    The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
    RequestedServiceObjectiveName string
    The requested service level objective name of the database.
    ResumedDate string
    The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.
    Status string
    The status of the database.
    Type string
    Resource type.
    creationDate String
    The creation date of the database (ISO8601 format).
    currentBackupStorageRedundancy String
    The storage account type used to store backups for this database.
    currentServiceObjectiveName String
    The current service level objective name of the database.
    currentSku SkuResponse
    The name and tier of the SKU.
    databaseId String
    The ID of the database.
    defaultSecondaryLocation String
    The default secondary region for this database.
    earliestRestoreDate String
    This records the earliest start date and time that restore is available for this database (ISO8601 format).
    failoverGroupId String
    Failover Group resource identifier that this database belongs to.
    id String
    The provider-assigned unique ID for this managed resource.
    kind String
    Kind of database. This is metadata used for the Azure portal experience.
    managedBy String
    Resource that manages the database.
    maxLogSizeBytes Double
    The max log size for this database.
    name String
    Resource name.
    pausedDate String
    The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
    requestedServiceObjectiveName String
    The requested service level objective name of the database.
    resumedDate String
    The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.
    status String
    The status of the database.
    type String
    Resource type.
    creationDate string
    The creation date of the database (ISO8601 format).
    currentBackupStorageRedundancy string
    The storage account type used to store backups for this database.
    currentServiceObjectiveName string
    The current service level objective name of the database.
    currentSku SkuResponse
    The name and tier of the SKU.
    databaseId string
    The ID of the database.
    defaultSecondaryLocation string
    The default secondary region for this database.
    earliestRestoreDate string
    This records the earliest start date and time that restore is available for this database (ISO8601 format).
    failoverGroupId string
    Failover Group resource identifier that this database belongs to.
    id string
    The provider-assigned unique ID for this managed resource.
    kind string
    Kind of database. This is metadata used for the Azure portal experience.
    managedBy string
    Resource that manages the database.
    maxLogSizeBytes number
    The max log size for this database.
    name string
    Resource name.
    pausedDate string
    The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
    requestedServiceObjectiveName string
    The requested service level objective name of the database.
    resumedDate string
    The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.
    status string
    The status of the database.
    type string
    Resource type.
    creation_date str
    The creation date of the database (ISO8601 format).
    current_backup_storage_redundancy str
    The storage account type used to store backups for this database.
    current_service_objective_name str
    The current service level objective name of the database.
    current_sku SkuResponse
    The name and tier of the SKU.
    database_id str
    The ID of the database.
    default_secondary_location str
    The default secondary region for this database.
    earliest_restore_date str
    This records the earliest start date and time that restore is available for this database (ISO8601 format).
    failover_group_id str
    Failover Group resource identifier that this database belongs to.
    id str
    The provider-assigned unique ID for this managed resource.
    kind str
    Kind of database. This is metadata used for the Azure portal experience.
    managed_by str
    Resource that manages the database.
    max_log_size_bytes float
    The max log size for this database.
    name str
    Resource name.
    paused_date str
    The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
    requested_service_objective_name str
    The requested service level objective name of the database.
    resumed_date str
    The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.
    status str
    The status of the database.
    type str
    Resource type.
    creationDate String
    The creation date of the database (ISO8601 format).
    currentBackupStorageRedundancy String
    The storage account type used to store backups for this database.
    currentServiceObjectiveName String
    The current service level objective name of the database.
    currentSku Property Map
    The name and tier of the SKU.
    databaseId String
    The ID of the database.
    defaultSecondaryLocation String
    The default secondary region for this database.
    earliestRestoreDate String
    This records the earliest start date and time that restore is available for this database (ISO8601 format).
    failoverGroupId String
    Failover Group resource identifier that this database belongs to.
    id String
    The provider-assigned unique ID for this managed resource.
    kind String
    Kind of database. This is metadata used for the Azure portal experience.
    managedBy String
    Resource that manages the database.
    maxLogSizeBytes Number
    The max log size for this database.
    name String
    Resource name.
    pausedDate String
    The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
    requestedServiceObjectiveName String
    The requested service level objective name of the database.
    resumedDate String
    The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.
    status String
    The status of the database.
    type String
    Resource type.

    Supporting Types

    CatalogCollationType, CatalogCollationTypeArgs

    DATABASE_DEFAULT
    DATABASE_DEFAULT
    SQL_Latin1_General_CP1_CI_AS
    SQL_Latin1_General_CP1_CI_AS
    CatalogCollationType_DATABASE_DEFAULT
    DATABASE_DEFAULT
    CatalogCollationType_SQL_Latin1_General_CP1_CI_AS
    SQL_Latin1_General_CP1_CI_AS
    DATABASE_DEFAULT
    DATABASE_DEFAULT
    SQL_Latin1_General_CP1_CI_AS
    SQL_Latin1_General_CP1_CI_AS
    DATABASE_DEFAULT
    DATABASE_DEFAULT
    SQL_Latin1_General_CP1_CI_AS
    SQL_Latin1_General_CP1_CI_AS
    DATABAS_E_DEFAULT
    DATABASE_DEFAULT
    SQ_L_LATIN1_GENERAL_CP1_C_I_AS
    SQL_Latin1_General_CP1_CI_AS
    "DATABASE_DEFAULT"
    DATABASE_DEFAULT
    "SQL_Latin1_General_CP1_CI_AS"
    SQL_Latin1_General_CP1_CI_AS

    CreateMode, CreateModeArgs

    Default
    Default
    Copy
    Copy
    Secondary
    Secondary
    PointInTimeRestore
    PointInTimeRestore
    Restore
    Restore
    Recovery
    Recovery
    RestoreExternalBackup
    RestoreExternalBackup
    RestoreExternalBackupSecondary
    RestoreExternalBackupSecondary
    RestoreLongTermRetentionBackup
    RestoreLongTermRetentionBackup
    OnlineSecondary
    OnlineSecondary
    CreateModeDefault
    Default
    CreateModeCopy
    Copy
    CreateModeSecondary
    Secondary
    CreateModePointInTimeRestore
    PointInTimeRestore
    CreateModeRestore
    Restore
    CreateModeRecovery
    Recovery
    CreateModeRestoreExternalBackup
    RestoreExternalBackup
    CreateModeRestoreExternalBackupSecondary
    RestoreExternalBackupSecondary
    CreateModeRestoreLongTermRetentionBackup
    RestoreLongTermRetentionBackup
    CreateModeOnlineSecondary
    OnlineSecondary
    Default
    Default
    Copy
    Copy
    Secondary
    Secondary
    PointInTimeRestore
    PointInTimeRestore
    Restore
    Restore
    Recovery
    Recovery
    RestoreExternalBackup
    RestoreExternalBackup
    RestoreExternalBackupSecondary
    RestoreExternalBackupSecondary
    RestoreLongTermRetentionBackup
    RestoreLongTermRetentionBackup
    OnlineSecondary
    OnlineSecondary
    Default
    Default
    Copy
    Copy
    Secondary
    Secondary
    PointInTimeRestore
    PointInTimeRestore
    Restore
    Restore
    Recovery
    Recovery
    RestoreExternalBackup
    RestoreExternalBackup
    RestoreExternalBackupSecondary
    RestoreExternalBackupSecondary
    RestoreLongTermRetentionBackup
    RestoreLongTermRetentionBackup
    OnlineSecondary
    OnlineSecondary
    DEFAULT
    Default
    COPY
    Copy
    SECONDARY
    Secondary
    POINT_IN_TIME_RESTORE
    PointInTimeRestore
    RESTORE
    Restore
    RECOVERY
    Recovery
    RESTORE_EXTERNAL_BACKUP
    RestoreExternalBackup
    RESTORE_EXTERNAL_BACKUP_SECONDARY
    RestoreExternalBackupSecondary
    RESTORE_LONG_TERM_RETENTION_BACKUP
    RestoreLongTermRetentionBackup
    ONLINE_SECONDARY
    OnlineSecondary
    "Default"
    Default
    "Copy"
    Copy
    "Secondary"
    Secondary
    "PointInTimeRestore"
    PointInTimeRestore
    "Restore"
    Restore
    "Recovery"
    Recovery
    "RestoreExternalBackup"
    RestoreExternalBackup
    "RestoreExternalBackupSecondary"
    RestoreExternalBackupSecondary
    "RestoreLongTermRetentionBackup"
    RestoreLongTermRetentionBackup
    "OnlineSecondary"
    OnlineSecondary

    DatabaseLicenseType, DatabaseLicenseTypeArgs

    LicenseIncluded
    LicenseIncluded
    BasePrice
    BasePrice
    DatabaseLicenseTypeLicenseIncluded
    LicenseIncluded
    DatabaseLicenseTypeBasePrice
    BasePrice
    LicenseIncluded
    LicenseIncluded
    BasePrice
    BasePrice
    LicenseIncluded
    LicenseIncluded
    BasePrice
    BasePrice
    LICENSE_INCLUDED
    LicenseIncluded
    BASE_PRICE
    BasePrice
    "LicenseIncluded"
    LicenseIncluded
    "BasePrice"
    BasePrice

    DatabaseReadScale, DatabaseReadScaleArgs

    Enabled
    Enabled
    Disabled
    Disabled
    DatabaseReadScaleEnabled
    Enabled
    DatabaseReadScaleDisabled
    Disabled
    Enabled
    Enabled
    Disabled
    Disabled
    Enabled
    Enabled
    Disabled
    Disabled
    ENABLED
    Enabled
    DISABLED
    Disabled
    "Enabled"
    Enabled
    "Disabled"
    Disabled

    RequestedBackupStorageRedundancy, RequestedBackupStorageRedundancyArgs

    Geo
    Geo
    Local
    Local
    Zone
    Zone
    RequestedBackupStorageRedundancyGeo
    Geo
    RequestedBackupStorageRedundancyLocal
    Local
    RequestedBackupStorageRedundancyZone
    Zone
    Geo
    Geo
    Local
    Local
    Zone
    Zone
    Geo
    Geo
    Local
    Local
    Zone
    Zone
    GEO
    Geo
    LOCAL
    Local
    ZONE
    Zone
    "Geo"
    Geo
    "Local"
    Local
    "Zone"
    Zone

    SampleName, SampleNameArgs

    AdventureWorksLT
    AdventureWorksLT
    WideWorldImportersStd
    WideWorldImportersStd
    WideWorldImportersFull
    WideWorldImportersFull
    SampleNameAdventureWorksLT
    AdventureWorksLT
    SampleNameWideWorldImportersStd
    WideWorldImportersStd
    SampleNameWideWorldImportersFull
    WideWorldImportersFull
    AdventureWorksLT
    AdventureWorksLT
    WideWorldImportersStd
    WideWorldImportersStd
    WideWorldImportersFull
    WideWorldImportersFull
    AdventureWorksLT
    AdventureWorksLT
    WideWorldImportersStd
    WideWorldImportersStd
    WideWorldImportersFull
    WideWorldImportersFull
    ADVENTURE_WORKS_LT
    AdventureWorksLT
    WIDE_WORLD_IMPORTERS_STD
    WideWorldImportersStd
    WIDE_WORLD_IMPORTERS_FULL
    WideWorldImportersFull
    "AdventureWorksLT"
    AdventureWorksLT
    "WideWorldImportersStd"
    WideWorldImportersStd
    "WideWorldImportersFull"
    WideWorldImportersFull

    SecondaryType, SecondaryTypeArgs

    Geo
    Geo
    Named
    Named
    SecondaryTypeGeo
    Geo
    SecondaryTypeNamed
    Named
    Geo
    Geo
    Named
    Named
    Geo
    Geo
    Named
    Named
    GEO
    Geo
    NAMED
    Named
    "Geo"
    Geo
    "Named"
    Named

    Sku, SkuArgs

    Name string
    The name of the SKU, typically, a letter + Number code, e.g. P3.
    Capacity int
    Capacity of the particular SKU.
    Family string
    If the service has different generations of hardware, for the same SKU, then that can be captured here.
    Size string
    Size of the particular SKU
    Tier string
    The tier or edition of the particular SKU, e.g. Basic, Premium.
    Name string
    The name of the SKU, typically, a letter + Number code, e.g. P3.
    Capacity int
    Capacity of the particular SKU.
    Family string
    If the service has different generations of hardware, for the same SKU, then that can be captured here.
    Size string
    Size of the particular SKU
    Tier string
    The tier or edition of the particular SKU, e.g. Basic, Premium.
    name String
    The name of the SKU, typically, a letter + Number code, e.g. P3.
    capacity Integer
    Capacity of the particular SKU.
    family String
    If the service has different generations of hardware, for the same SKU, then that can be captured here.
    size String
    Size of the particular SKU
    tier String
    The tier or edition of the particular SKU, e.g. Basic, Premium.
    name string
    The name of the SKU, typically, a letter + Number code, e.g. P3.
    capacity number
    Capacity of the particular SKU.
    family string
    If the service has different generations of hardware, for the same SKU, then that can be captured here.
    size string
    Size of the particular SKU
    tier string
    The tier or edition of the particular SKU, e.g. Basic, Premium.
    name str
    The name of the SKU, typically, a letter + Number code, e.g. P3.
    capacity int
    Capacity of the particular SKU.
    family str
    If the service has different generations of hardware, for the same SKU, then that can be captured here.
    size str
    Size of the particular SKU
    tier str
    The tier or edition of the particular SKU, e.g. Basic, Premium.
    name String
    The name of the SKU, typically, a letter + Number code, e.g. P3.
    capacity Number
    Capacity of the particular SKU.
    family String
    If the service has different generations of hardware, for the same SKU, then that can be captured here.
    size String
    Size of the particular SKU
    tier String
    The tier or edition of the particular SKU, e.g. Basic, Premium.

    SkuResponse, SkuResponseArgs

    Name string
    The name of the SKU, typically, a letter + Number code, e.g. P3.
    Capacity int
    Capacity of the particular SKU.
    Family string
    If the service has different generations of hardware, for the same SKU, then that can be captured here.
    Size string
    Size of the particular SKU
    Tier string
    The tier or edition of the particular SKU, e.g. Basic, Premium.
    Name string
    The name of the SKU, typically, a letter + Number code, e.g. P3.
    Capacity int
    Capacity of the particular SKU.
    Family string
    If the service has different generations of hardware, for the same SKU, then that can be captured here.
    Size string
    Size of the particular SKU
    Tier string
    The tier or edition of the particular SKU, e.g. Basic, Premium.
    name String
    The name of the SKU, typically, a letter + Number code, e.g. P3.
    capacity Integer
    Capacity of the particular SKU.
    family String
    If the service has different generations of hardware, for the same SKU, then that can be captured here.
    size String
    Size of the particular SKU
    tier String
    The tier or edition of the particular SKU, e.g. Basic, Premium.
    name string
    The name of the SKU, typically, a letter + Number code, e.g. P3.
    capacity number
    Capacity of the particular SKU.
    family string
    If the service has different generations of hardware, for the same SKU, then that can be captured here.
    size string
    Size of the particular SKU
    tier string
    The tier or edition of the particular SKU, e.g. Basic, Premium.
    name str
    The name of the SKU, typically, a letter + Number code, e.g. P3.
    capacity int
    Capacity of the particular SKU.
    family str
    If the service has different generations of hardware, for the same SKU, then that can be captured here.
    size str
    Size of the particular SKU
    tier str
    The tier or edition of the particular SKU, e.g. Basic, Premium.
    name String
    The name of the SKU, typically, a letter + Number code, e.g. P3.
    capacity Number
    Capacity of the particular SKU.
    family String
    If the service has different generations of hardware, for the same SKU, then that can be captured here.
    size String
    Size of the particular SKU
    tier String
    The tier or edition of the particular SKU, e.g. Basic, Premium.

    Import

    An existing resource can be imported using its type token, name, and identifier, e.g.

    $ pulumi import azure-native:sql:Database testdb /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb 
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    azure-native-v1 pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native-v1 logo
    These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
    Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi