1. Packages
  2. Azure Classic
  3. API Docs
  4. mssql
  5. ManagedDatabase

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

azure.mssql.ManagedDatabase

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example",
        location: "West Europe",
    });
    const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
        name: "example",
        location: example.location,
        resourceGroupName: example.name,
        addressSpaces: ["10.0.0.0/16"],
    });
    const exampleSubnet = new azure.network.Subnet("example", {
        name: "example",
        resourceGroupName: example.name,
        virtualNetworkName: exampleVirtualNetwork.name,
        addressPrefixes: ["10.0.2.0/24"],
    });
    const exampleManagedInstance = new azure.mssql.ManagedInstance("example", {
        name: "managedsqlinstance",
        resourceGroupName: example.name,
        location: example.location,
        licenseType: "BasePrice",
        skuName: "GP_Gen5",
        storageSizeInGb: 32,
        subnetId: exampleSubnet.id,
        vcores: 4,
        administratorLogin: "msadministrator",
        administratorLoginPassword: "thisIsDog11",
    });
    const exampleManagedDatabase = new azure.mssql.ManagedDatabase("example", {
        name: "example",
        managedInstanceId: exampleManagedInstance.id,
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example",
        location="West Europe")
    example_virtual_network = azure.network.VirtualNetwork("example",
        name="example",
        location=example.location,
        resource_group_name=example.name,
        address_spaces=["10.0.0.0/16"])
    example_subnet = azure.network.Subnet("example",
        name="example",
        resource_group_name=example.name,
        virtual_network_name=example_virtual_network.name,
        address_prefixes=["10.0.2.0/24"])
    example_managed_instance = azure.mssql.ManagedInstance("example",
        name="managedsqlinstance",
        resource_group_name=example.name,
        location=example.location,
        license_type="BasePrice",
        sku_name="GP_Gen5",
        storage_size_in_gb=32,
        subnet_id=example_subnet.id,
        vcores=4,
        administrator_login="msadministrator",
        administrator_login_password="thisIsDog11")
    example_managed_database = azure.mssql.ManagedDatabase("example",
        name="example",
        managed_instance_id=example_managed_instance.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
    			Name:              pulumi.String("example"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			AddressSpaces: pulumi.StringArray{
    				pulumi.String("10.0.0.0/16"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
    			Name:               pulumi.String("example"),
    			ResourceGroupName:  example.Name,
    			VirtualNetworkName: exampleVirtualNetwork.Name,
    			AddressPrefixes: pulumi.StringArray{
    				pulumi.String("10.0.2.0/24"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleManagedInstance, err := mssql.NewManagedInstance(ctx, "example", &mssql.ManagedInstanceArgs{
    			Name:                       pulumi.String("managedsqlinstance"),
    			ResourceGroupName:          example.Name,
    			Location:                   example.Location,
    			LicenseType:                pulumi.String("BasePrice"),
    			SkuName:                    pulumi.String("GP_Gen5"),
    			StorageSizeInGb:            pulumi.Int(32),
    			SubnetId:                   exampleSubnet.ID(),
    			Vcores:                     pulumi.Int(4),
    			AdministratorLogin:         pulumi.String("msadministrator"),
    			AdministratorLoginPassword: pulumi.String("thisIsDog11"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = mssql.NewManagedDatabase(ctx, "example", &mssql.ManagedDatabaseArgs{
    			Name:              pulumi.String("example"),
    			ManagedInstanceId: exampleManagedInstance.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example",
            Location = "West Europe",
        });
    
        var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
        {
            Name = "example",
            Location = example.Location,
            ResourceGroupName = example.Name,
            AddressSpaces = new[]
            {
                "10.0.0.0/16",
            },
        });
    
        var exampleSubnet = new Azure.Network.Subnet("example", new()
        {
            Name = "example",
            ResourceGroupName = example.Name,
            VirtualNetworkName = exampleVirtualNetwork.Name,
            AddressPrefixes = new[]
            {
                "10.0.2.0/24",
            },
        });
    
        var exampleManagedInstance = new Azure.MSSql.ManagedInstance("example", new()
        {
            Name = "managedsqlinstance",
            ResourceGroupName = example.Name,
            Location = example.Location,
            LicenseType = "BasePrice",
            SkuName = "GP_Gen5",
            StorageSizeInGb = 32,
            SubnetId = exampleSubnet.Id,
            Vcores = 4,
            AdministratorLogin = "msadministrator",
            AdministratorLoginPassword = "thisIsDog11",
        });
    
        var exampleManagedDatabase = new Azure.MSSql.ManagedDatabase("example", new()
        {
            Name = "example",
            ManagedInstanceId = exampleManagedInstance.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.network.VirtualNetwork;
    import com.pulumi.azure.network.VirtualNetworkArgs;
    import com.pulumi.azure.network.Subnet;
    import com.pulumi.azure.network.SubnetArgs;
    import com.pulumi.azure.mssql.ManagedInstance;
    import com.pulumi.azure.mssql.ManagedInstanceArgs;
    import com.pulumi.azure.mssql.ManagedDatabase;
    import com.pulumi.azure.mssql.ManagedDatabaseArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("example")
                .location("West Europe")
                .build());
    
            var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
                .name("example")
                .location(example.location())
                .resourceGroupName(example.name())
                .addressSpaces("10.0.0.0/16")
                .build());
    
            var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
                .name("example")
                .resourceGroupName(example.name())
                .virtualNetworkName(exampleVirtualNetwork.name())
                .addressPrefixes("10.0.2.0/24")
                .build());
    
            var exampleManagedInstance = new ManagedInstance("exampleManagedInstance", ManagedInstanceArgs.builder()
                .name("managedsqlinstance")
                .resourceGroupName(example.name())
                .location(example.location())
                .licenseType("BasePrice")
                .skuName("GP_Gen5")
                .storageSizeInGb(32)
                .subnetId(exampleSubnet.id())
                .vcores(4)
                .administratorLogin("msadministrator")
                .administratorLoginPassword("thisIsDog11")
                .build());
    
            var exampleManagedDatabase = new ManagedDatabase("exampleManagedDatabase", ManagedDatabaseArgs.builder()
                .name("example")
                .managedInstanceId(exampleManagedInstance.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example
          location: West Europe
      exampleVirtualNetwork:
        type: azure:network:VirtualNetwork
        name: example
        properties:
          name: example
          location: ${example.location}
          resourceGroupName: ${example.name}
          addressSpaces:
            - 10.0.0.0/16
      exampleSubnet:
        type: azure:network:Subnet
        name: example
        properties:
          name: example
          resourceGroupName: ${example.name}
          virtualNetworkName: ${exampleVirtualNetwork.name}
          addressPrefixes:
            - 10.0.2.0/24
      exampleManagedInstance:
        type: azure:mssql:ManagedInstance
        name: example
        properties:
          name: managedsqlinstance
          resourceGroupName: ${example.name}
          location: ${example.location}
          licenseType: BasePrice
          skuName: GP_Gen5
          storageSizeInGb: 32
          subnetId: ${exampleSubnet.id}
          vcores: 4
          administratorLogin: msadministrator
          administratorLoginPassword: thisIsDog11
      exampleManagedDatabase:
        type: azure:mssql:ManagedDatabase
        name: example
        properties:
          name: example
          managedInstanceId: ${exampleManagedInstance.id}
    

    Create ManagedDatabase Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ManagedDatabase(name: string, args: ManagedDatabaseArgs, opts?: CustomResourceOptions);
    @overload
    def ManagedDatabase(resource_name: str,
                        args: ManagedDatabaseArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def ManagedDatabase(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        managed_instance_id: Optional[str] = None,
                        long_term_retention_policy: Optional[ManagedDatabaseLongTermRetentionPolicyArgs] = None,
                        name: Optional[str] = None,
                        point_in_time_restore: Optional[ManagedDatabasePointInTimeRestoreArgs] = None,
                        short_term_retention_days: Optional[int] = None)
    func NewManagedDatabase(ctx *Context, name string, args ManagedDatabaseArgs, opts ...ResourceOption) (*ManagedDatabase, error)
    public ManagedDatabase(string name, ManagedDatabaseArgs args, CustomResourceOptions? opts = null)
    public ManagedDatabase(String name, ManagedDatabaseArgs args)
    public ManagedDatabase(String name, ManagedDatabaseArgs args, CustomResourceOptions options)
    
    type: azure:mssql:ManagedDatabase
    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 ManagedDatabaseArgs
    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 ManagedDatabaseArgs
    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 ManagedDatabaseArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ManagedDatabaseArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ManagedDatabaseArgs
    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 managedDatabaseResource = new Azure.MSSql.ManagedDatabase("managedDatabaseResource", new()
    {
        ManagedInstanceId = "string",
        LongTermRetentionPolicy = new Azure.MSSql.Inputs.ManagedDatabaseLongTermRetentionPolicyArgs
        {
            ImmutableBackupsEnabled = false,
            MonthlyRetention = "string",
            WeekOfYear = 0,
            WeeklyRetention = "string",
            YearlyRetention = "string",
        },
        Name = "string",
        PointInTimeRestore = new Azure.MSSql.Inputs.ManagedDatabasePointInTimeRestoreArgs
        {
            RestorePointInTime = "string",
            SourceDatabaseId = "string",
        },
        ShortTermRetentionDays = 0,
    });
    
    example, err := mssql.NewManagedDatabase(ctx, "managedDatabaseResource", &mssql.ManagedDatabaseArgs{
    	ManagedInstanceId: pulumi.String("string"),
    	LongTermRetentionPolicy: &mssql.ManagedDatabaseLongTermRetentionPolicyArgs{
    		ImmutableBackupsEnabled: pulumi.Bool(false),
    		MonthlyRetention:        pulumi.String("string"),
    		WeekOfYear:              pulumi.Int(0),
    		WeeklyRetention:         pulumi.String("string"),
    		YearlyRetention:         pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    	PointInTimeRestore: &mssql.ManagedDatabasePointInTimeRestoreArgs{
    		RestorePointInTime: pulumi.String("string"),
    		SourceDatabaseId:   pulumi.String("string"),
    	},
    	ShortTermRetentionDays: pulumi.Int(0),
    })
    
    var managedDatabaseResource = new ManagedDatabase("managedDatabaseResource", ManagedDatabaseArgs.builder()
        .managedInstanceId("string")
        .longTermRetentionPolicy(ManagedDatabaseLongTermRetentionPolicyArgs.builder()
            .immutableBackupsEnabled(false)
            .monthlyRetention("string")
            .weekOfYear(0)
            .weeklyRetention("string")
            .yearlyRetention("string")
            .build())
        .name("string")
        .pointInTimeRestore(ManagedDatabasePointInTimeRestoreArgs.builder()
            .restorePointInTime("string")
            .sourceDatabaseId("string")
            .build())
        .shortTermRetentionDays(0)
        .build());
    
    managed_database_resource = azure.mssql.ManagedDatabase("managedDatabaseResource",
        managed_instance_id="string",
        long_term_retention_policy=azure.mssql.ManagedDatabaseLongTermRetentionPolicyArgs(
            immutable_backups_enabled=False,
            monthly_retention="string",
            week_of_year=0,
            weekly_retention="string",
            yearly_retention="string",
        ),
        name="string",
        point_in_time_restore=azure.mssql.ManagedDatabasePointInTimeRestoreArgs(
            restore_point_in_time="string",
            source_database_id="string",
        ),
        short_term_retention_days=0)
    
    const managedDatabaseResource = new azure.mssql.ManagedDatabase("managedDatabaseResource", {
        managedInstanceId: "string",
        longTermRetentionPolicy: {
            immutableBackupsEnabled: false,
            monthlyRetention: "string",
            weekOfYear: 0,
            weeklyRetention: "string",
            yearlyRetention: "string",
        },
        name: "string",
        pointInTimeRestore: {
            restorePointInTime: "string",
            sourceDatabaseId: "string",
        },
        shortTermRetentionDays: 0,
    });
    
    type: azure:mssql:ManagedDatabase
    properties:
        longTermRetentionPolicy:
            immutableBackupsEnabled: false
            monthlyRetention: string
            weekOfYear: 0
            weeklyRetention: string
            yearlyRetention: string
        managedInstanceId: string
        name: string
        pointInTimeRestore:
            restorePointInTime: string
            sourceDatabaseId: string
        shortTermRetentionDays: 0
    

    ManagedDatabase Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The ManagedDatabase resource accepts the following input properties:

    ManagedInstanceId string
    The ID of the Azure SQL Managed Instance on which to create this Managed Database. Changing this forces a new resource to be created.
    LongTermRetentionPolicy ManagedDatabaseLongTermRetentionPolicy
    A long_term_retention_policy block as defined below.
    Name string
    The name of the Managed Database to create. Changing this forces a new resource to be created.
    PointInTimeRestore ManagedDatabasePointInTimeRestore
    A point_in_time_restore block as defined below. Changing this forces a new resource to be created.
    ShortTermRetentionDays int
    The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
    ManagedInstanceId string
    The ID of the Azure SQL Managed Instance on which to create this Managed Database. Changing this forces a new resource to be created.
    LongTermRetentionPolicy ManagedDatabaseLongTermRetentionPolicyArgs
    A long_term_retention_policy block as defined below.
    Name string
    The name of the Managed Database to create. Changing this forces a new resource to be created.
    PointInTimeRestore ManagedDatabasePointInTimeRestoreArgs
    A point_in_time_restore block as defined below. Changing this forces a new resource to be created.
    ShortTermRetentionDays int
    The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
    managedInstanceId String
    The ID of the Azure SQL Managed Instance on which to create this Managed Database. Changing this forces a new resource to be created.
    longTermRetentionPolicy ManagedDatabaseLongTermRetentionPolicy
    A long_term_retention_policy block as defined below.
    name String
    The name of the Managed Database to create. Changing this forces a new resource to be created.
    pointInTimeRestore ManagedDatabasePointInTimeRestore
    A point_in_time_restore block as defined below. Changing this forces a new resource to be created.
    shortTermRetentionDays Integer
    The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
    managedInstanceId string
    The ID of the Azure SQL Managed Instance on which to create this Managed Database. Changing this forces a new resource to be created.
    longTermRetentionPolicy ManagedDatabaseLongTermRetentionPolicy
    A long_term_retention_policy block as defined below.
    name string
    The name of the Managed Database to create. Changing this forces a new resource to be created.
    pointInTimeRestore ManagedDatabasePointInTimeRestore
    A point_in_time_restore block as defined below. Changing this forces a new resource to be created.
    shortTermRetentionDays number
    The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
    managed_instance_id str
    The ID of the Azure SQL Managed Instance on which to create this Managed Database. Changing this forces a new resource to be created.
    long_term_retention_policy ManagedDatabaseLongTermRetentionPolicyArgs
    A long_term_retention_policy block as defined below.
    name str
    The name of the Managed Database to create. Changing this forces a new resource to be created.
    point_in_time_restore ManagedDatabasePointInTimeRestoreArgs
    A point_in_time_restore block as defined below. Changing this forces a new resource to be created.
    short_term_retention_days int
    The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
    managedInstanceId String
    The ID of the Azure SQL Managed Instance on which to create this Managed Database. Changing this forces a new resource to be created.
    longTermRetentionPolicy Property Map
    A long_term_retention_policy block as defined below.
    name String
    The name of the Managed Database to create. Changing this forces a new resource to be created.
    pointInTimeRestore Property Map
    A point_in_time_restore block as defined below. Changing this forces a new resource to be created.
    shortTermRetentionDays Number
    The backup retention period in days. This is how many days Point-in-Time Restore will be supported.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ManagedDatabase resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ManagedDatabase Resource

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

    public static get(name: string, id: Input<ID>, state?: ManagedDatabaseState, opts?: CustomResourceOptions): ManagedDatabase
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            long_term_retention_policy: Optional[ManagedDatabaseLongTermRetentionPolicyArgs] = None,
            managed_instance_id: Optional[str] = None,
            name: Optional[str] = None,
            point_in_time_restore: Optional[ManagedDatabasePointInTimeRestoreArgs] = None,
            short_term_retention_days: Optional[int] = None) -> ManagedDatabase
    func GetManagedDatabase(ctx *Context, name string, id IDInput, state *ManagedDatabaseState, opts ...ResourceOption) (*ManagedDatabase, error)
    public static ManagedDatabase Get(string name, Input<string> id, ManagedDatabaseState? state, CustomResourceOptions? opts = null)
    public static ManagedDatabase get(String name, Output<String> id, ManagedDatabaseState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    LongTermRetentionPolicy ManagedDatabaseLongTermRetentionPolicy
    A long_term_retention_policy block as defined below.
    ManagedInstanceId string
    The ID of the Azure SQL Managed Instance on which to create this Managed Database. Changing this forces a new resource to be created.
    Name string
    The name of the Managed Database to create. Changing this forces a new resource to be created.
    PointInTimeRestore ManagedDatabasePointInTimeRestore
    A point_in_time_restore block as defined below. Changing this forces a new resource to be created.
    ShortTermRetentionDays int
    The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
    LongTermRetentionPolicy ManagedDatabaseLongTermRetentionPolicyArgs
    A long_term_retention_policy block as defined below.
    ManagedInstanceId string
    The ID of the Azure SQL Managed Instance on which to create this Managed Database. Changing this forces a new resource to be created.
    Name string
    The name of the Managed Database to create. Changing this forces a new resource to be created.
    PointInTimeRestore ManagedDatabasePointInTimeRestoreArgs
    A point_in_time_restore block as defined below. Changing this forces a new resource to be created.
    ShortTermRetentionDays int
    The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
    longTermRetentionPolicy ManagedDatabaseLongTermRetentionPolicy
    A long_term_retention_policy block as defined below.
    managedInstanceId String
    The ID of the Azure SQL Managed Instance on which to create this Managed Database. Changing this forces a new resource to be created.
    name String
    The name of the Managed Database to create. Changing this forces a new resource to be created.
    pointInTimeRestore ManagedDatabasePointInTimeRestore
    A point_in_time_restore block as defined below. Changing this forces a new resource to be created.
    shortTermRetentionDays Integer
    The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
    longTermRetentionPolicy ManagedDatabaseLongTermRetentionPolicy
    A long_term_retention_policy block as defined below.
    managedInstanceId string
    The ID of the Azure SQL Managed Instance on which to create this Managed Database. Changing this forces a new resource to be created.
    name string
    The name of the Managed Database to create. Changing this forces a new resource to be created.
    pointInTimeRestore ManagedDatabasePointInTimeRestore
    A point_in_time_restore block as defined below. Changing this forces a new resource to be created.
    shortTermRetentionDays number
    The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
    long_term_retention_policy ManagedDatabaseLongTermRetentionPolicyArgs
    A long_term_retention_policy block as defined below.
    managed_instance_id str
    The ID of the Azure SQL Managed Instance on which to create this Managed Database. Changing this forces a new resource to be created.
    name str
    The name of the Managed Database to create. Changing this forces a new resource to be created.
    point_in_time_restore ManagedDatabasePointInTimeRestoreArgs
    A point_in_time_restore block as defined below. Changing this forces a new resource to be created.
    short_term_retention_days int
    The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
    longTermRetentionPolicy Property Map
    A long_term_retention_policy block as defined below.
    managedInstanceId String
    The ID of the Azure SQL Managed Instance on which to create this Managed Database. Changing this forces a new resource to be created.
    name String
    The name of the Managed Database to create. Changing this forces a new resource to be created.
    pointInTimeRestore Property Map
    A point_in_time_restore block as defined below. Changing this forces a new resource to be created.
    shortTermRetentionDays Number
    The backup retention period in days. This is how many days Point-in-Time Restore will be supported.

    Supporting Types

    ManagedDatabaseLongTermRetentionPolicy, ManagedDatabaseLongTermRetentionPolicyArgs

    ImmutableBackupsEnabled bool
    Specifies if the backups are immutable. Defaults to false.
    MonthlyRetention string
    The monthly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 120 months. e.g. P1Y, P1M, P4W or P30D.
    WeekOfYear int
    The week of year to take the yearly backup. Value has to be between 1 and 52.
    WeeklyRetention string
    The weekly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 520 weeks. e.g. P1Y, P1M, P1W or P7D.
    YearlyRetention string
    The yearly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 10 years. e.g. P1Y, P12M, P52W or P365D.
    ImmutableBackupsEnabled bool
    Specifies if the backups are immutable. Defaults to false.
    MonthlyRetention string
    The monthly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 120 months. e.g. P1Y, P1M, P4W or P30D.
    WeekOfYear int
    The week of year to take the yearly backup. Value has to be between 1 and 52.
    WeeklyRetention string
    The weekly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 520 weeks. e.g. P1Y, P1M, P1W or P7D.
    YearlyRetention string
    The yearly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 10 years. e.g. P1Y, P12M, P52W or P365D.
    immutableBackupsEnabled Boolean
    Specifies if the backups are immutable. Defaults to false.
    monthlyRetention String
    The monthly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 120 months. e.g. P1Y, P1M, P4W or P30D.
    weekOfYear Integer
    The week of year to take the yearly backup. Value has to be between 1 and 52.
    weeklyRetention String
    The weekly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 520 weeks. e.g. P1Y, P1M, P1W or P7D.
    yearlyRetention String
    The yearly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 10 years. e.g. P1Y, P12M, P52W or P365D.
    immutableBackupsEnabled boolean
    Specifies if the backups are immutable. Defaults to false.
    monthlyRetention string
    The monthly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 120 months. e.g. P1Y, P1M, P4W or P30D.
    weekOfYear number
    The week of year to take the yearly backup. Value has to be between 1 and 52.
    weeklyRetention string
    The weekly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 520 weeks. e.g. P1Y, P1M, P1W or P7D.
    yearlyRetention string
    The yearly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 10 years. e.g. P1Y, P12M, P52W or P365D.
    immutable_backups_enabled bool
    Specifies if the backups are immutable. Defaults to false.
    monthly_retention str
    The monthly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 120 months. e.g. P1Y, P1M, P4W or P30D.
    week_of_year int
    The week of year to take the yearly backup. Value has to be between 1 and 52.
    weekly_retention str
    The weekly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 520 weeks. e.g. P1Y, P1M, P1W or P7D.
    yearly_retention str
    The yearly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 10 years. e.g. P1Y, P12M, P52W or P365D.
    immutableBackupsEnabled Boolean
    Specifies if the backups are immutable. Defaults to false.
    monthlyRetention String
    The monthly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 120 months. e.g. P1Y, P1M, P4W or P30D.
    weekOfYear Number
    The week of year to take the yearly backup. Value has to be between 1 and 52.
    weeklyRetention String
    The weekly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 520 weeks. e.g. P1Y, P1M, P1W or P7D.
    yearlyRetention String
    The yearly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 10 years. e.g. P1Y, P12M, P52W or P365D.

    ManagedDatabasePointInTimeRestore, ManagedDatabasePointInTimeRestoreArgs

    RestorePointInTime string
    The point in time for the restore from source_database_id. Changing this forces a new resource to be created.
    SourceDatabaseId string
    The source database id that will be used to restore from. Changing this forces a new resource to be created.
    RestorePointInTime string
    The point in time for the restore from source_database_id. Changing this forces a new resource to be created.
    SourceDatabaseId string
    The source database id that will be used to restore from. Changing this forces a new resource to be created.
    restorePointInTime String
    The point in time for the restore from source_database_id. Changing this forces a new resource to be created.
    sourceDatabaseId String
    The source database id that will be used to restore from. Changing this forces a new resource to be created.
    restorePointInTime string
    The point in time for the restore from source_database_id. Changing this forces a new resource to be created.
    sourceDatabaseId string
    The source database id that will be used to restore from. Changing this forces a new resource to be created.
    restore_point_in_time str
    The point in time for the restore from source_database_id. Changing this forces a new resource to be created.
    source_database_id str
    The source database id that will be used to restore from. Changing this forces a new resource to be created.
    restorePointInTime String
    The point in time for the restore from source_database_id. Changing this forces a new resource to be created.
    sourceDatabaseId String
    The source database id that will be used to restore from. Changing this forces a new resource to be created.

    Import

    SQL Managed Databases can be imported using the resource id, e.g.

    $ pulumi import azure:mssql/managedDatabase:ManagedDatabase example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/managedInstances/myserver/databases/mydatabase
    

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

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi