ManagedInstance

class ManagedInstance : KotlinCustomResource

An Azure SQL managed instance. Uses Azure REST API version 2021-11-01. In version 1.x of the Azure Native provider, it used API version 2020-11-01-preview. Other available API versions: 2021-02-01-preview, 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01, 2023-08-01-preview, 2024-05-01-preview.

Example Usage

Create managed instance with all properties

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var managedInstance = new AzureNative.Sql.ManagedInstance("managedInstance", new()
{
AdministratorLogin = "dummylogin",
AdministratorLoginPassword = "PLACEHOLDER",
Administrators = new AzureNative.Sql.Inputs.ManagedInstanceExternalAdministratorArgs
{
AzureADOnlyAuthentication = true,
Login = "bob@contoso.com",
PrincipalType = AzureNative.Sql.PrincipalType.User,
Sid = "00000011-1111-2222-2222-123456789111",
TenantId = "00000011-1111-2222-2222-123456789111",
},
Collation = "SQL_Latin1_General_CP1_CI_AS",
DnsZonePartner = "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance",
InstancePoolId = "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/pool1",
LicenseType = AzureNative.Sql.ManagedInstanceLicenseType.LicenseIncluded,
Location = "Japan East",
MaintenanceConfigurationId = "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1",
ManagedInstanceName = "testinstance",
MinimalTlsVersion = "1.2",
ProxyOverride = AzureNative.Sql.ManagedInstanceProxyOverride.Redirect,
PublicDataEndpointEnabled = false,
RequestedBackupStorageRedundancy = AzureNative.Sql.BackupStorageRedundancy.Geo,
ResourceGroupName = "testrg",
ServicePrincipal = new AzureNative.Sql.Inputs.ServicePrincipalArgs
{
Type = AzureNative.Sql.ServicePrincipalType.SystemAssigned,
},
Sku = new AzureNative.Sql.Inputs.SkuArgs
{
Name = "GP_Gen5",
Tier = "GeneralPurpose",
},
StorageSizeInGB = 1024,
SubnetId = "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1",
Tags =
{
{ "tagKey1", "TagValue1" },
},
TimezoneId = "UTC",
VCores = 8,
});
});
package main
import (
sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewManagedInstance(ctx, "managedInstance", &sql.ManagedInstanceArgs{
AdministratorLogin: pulumi.String("dummylogin"),
AdministratorLoginPassword: pulumi.String("PLACEHOLDER"),
Administrators: &sql.ManagedInstanceExternalAdministratorArgs{
AzureADOnlyAuthentication: pulumi.Bool(true),
Login: pulumi.String("bob@contoso.com"),
PrincipalType: pulumi.String(sql.PrincipalTypeUser),
Sid: pulumi.String("00000011-1111-2222-2222-123456789111"),
TenantId: pulumi.String("00000011-1111-2222-2222-123456789111"),
},
Collation: pulumi.String("SQL_Latin1_General_CP1_CI_AS"),
DnsZonePartner: pulumi.String("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"),
InstancePoolId: pulumi.String("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/pool1"),
LicenseType: pulumi.String(sql.ManagedInstanceLicenseTypeLicenseIncluded),
Location: pulumi.String("Japan East"),
MaintenanceConfigurationId: pulumi.String("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"),
ManagedInstanceName: pulumi.String("testinstance"),
MinimalTlsVersion: pulumi.String("1.2"),
ProxyOverride: pulumi.String(sql.ManagedInstanceProxyOverrideRedirect),
PublicDataEndpointEnabled: pulumi.Bool(false),
RequestedBackupStorageRedundancy: pulumi.String(sql.BackupStorageRedundancyGeo),
ResourceGroupName: pulumi.String("testrg"),
ServicePrincipal: &sql.ServicePrincipalArgs{
Type: pulumi.String(sql.ServicePrincipalTypeSystemAssigned),
},
Sku: &sql.SkuArgs{
Name: pulumi.String("GP_Gen5"),
Tier: pulumi.String("GeneralPurpose"),
},
StorageSizeInGB: pulumi.Int(1024),
SubnetId: pulumi.String("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
Tags: pulumi.StringMap{
"tagKey1": pulumi.String("TagValue1"),
},
TimezoneId: pulumi.String("UTC"),
VCores: pulumi.Int(8),
})
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.ManagedInstance;
import com.pulumi.azurenative.sql.ManagedInstanceArgs;
import com.pulumi.azurenative.sql.inputs.ManagedInstanceExternalAdministratorArgs;
import com.pulumi.azurenative.sql.inputs.ServicePrincipalArgs;
import com.pulumi.azurenative.sql.inputs.SkuArgs;
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 managedInstance = new ManagedInstance("managedInstance", ManagedInstanceArgs.builder()
.administratorLogin("dummylogin")
.administratorLoginPassword("PLACEHOLDER")
.administrators(ManagedInstanceExternalAdministratorArgs.builder()
.azureADOnlyAuthentication(true)
.login("bob@contoso.com")
.principalType("User")
.sid("00000011-1111-2222-2222-123456789111")
.tenantId("00000011-1111-2222-2222-123456789111")
.build())
.collation("SQL_Latin1_General_CP1_CI_AS")
.dnsZonePartner("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance")
.instancePoolId("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/pool1")
.licenseType("LicenseIncluded")
.location("Japan East")
.maintenanceConfigurationId("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1")
.managedInstanceName("testinstance")
.minimalTlsVersion("1.2")
.proxyOverride("Redirect")
.publicDataEndpointEnabled(false)
.requestedBackupStorageRedundancy("Geo")
.resourceGroupName("testrg")
.servicePrincipal(ServicePrincipalArgs.builder()
.type("SystemAssigned")
.build())
.sku(SkuArgs.builder()
.name("GP_Gen5")
.tier("GeneralPurpose")
.build())
.storageSizeInGB(1024)
.subnetId("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1")
.tags(Map.of("tagKey1", "TagValue1"))
.timezoneId("UTC")
.vCores(8)
.build());
}
}

Create managed instance with minimal properties

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var managedInstance = new AzureNative.Sql.ManagedInstance("managedInstance", new()
{
AdministratorLogin = "dummylogin",
AdministratorLoginPassword = "PLACEHOLDER",
LicenseType = AzureNative.Sql.ManagedInstanceLicenseType.LicenseIncluded,
Location = "Japan East",
ManagedInstanceName = "testinstance",
ResourceGroupName = "testrg",
Sku = new AzureNative.Sql.Inputs.SkuArgs
{
Name = "GP_Gen4",
Tier = "GeneralPurpose",
},
StorageSizeInGB = 1024,
SubnetId = "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1",
VCores = 8,
});
});
package main
import (
sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewManagedInstance(ctx, "managedInstance", &sql.ManagedInstanceArgs{
AdministratorLogin: pulumi.String("dummylogin"),
AdministratorLoginPassword: pulumi.String("PLACEHOLDER"),
LicenseType: pulumi.String(sql.ManagedInstanceLicenseTypeLicenseIncluded),
Location: pulumi.String("Japan East"),
ManagedInstanceName: pulumi.String("testinstance"),
ResourceGroupName: pulumi.String("testrg"),
Sku: &sql.SkuArgs{
Name: pulumi.String("GP_Gen4"),
Tier: pulumi.String("GeneralPurpose"),
},
StorageSizeInGB: pulumi.Int(1024),
SubnetId: pulumi.String("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"),
VCores: pulumi.Int(8),
})
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.ManagedInstance;
import com.pulumi.azurenative.sql.ManagedInstanceArgs;
import com.pulumi.azurenative.sql.inputs.SkuArgs;
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 managedInstance = new ManagedInstance("managedInstance", ManagedInstanceArgs.builder()
.administratorLogin("dummylogin")
.administratorLoginPassword("PLACEHOLDER")
.licenseType("LicenseIncluded")
.location("Japan East")
.managedInstanceName("testinstance")
.resourceGroupName("testrg")
.sku(SkuArgs.builder()
.name("GP_Gen4")
.tier("GeneralPurpose")
.build())
.storageSizeInGB(1024)
.subnetId("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1")
.vCores(8)
.build());
}
}

Import

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

$ pulumi import azure-native:sql:ManagedInstance testinstance /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}

Properties

Link copied to clipboard

Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation).

Link copied to clipboard

The Azure Active Directory administrator of the server.

Link copied to clipboard
val collation: Output<String>?

Collation of the managed instance.

Link copied to clipboard

The storage account type used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage)

Link copied to clipboard
val dnsZone: Output<String>

The Dns Zone that the managed instance is in.

Link copied to clipboard

The fully qualified domain name of the managed instance.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

The Azure Active Directory identity of the managed instance.

Link copied to clipboard
val instancePoolId: Output<String>?

The Id of the instance pool this managed server belongs to.

Link copied to clipboard
val keyId: Output<String>?

A CMK URI of the key to use for encryption.

Link copied to clipboard
val licenseType: Output<String>?

The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses).

Link copied to clipboard
val location: Output<String>

Resource location.

Link copied to clipboard

Specifies maintenance configuration id to apply to this managed instance.

Link copied to clipboard

Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'

Link copied to clipboard
val name: Output<String>

Resource name.

Link copied to clipboard

The resource id of a user assigned identity to be used by default.

Link copied to clipboard

List of private endpoint connections on a managed instance.

Link copied to clipboard
Link copied to clipboard
val proxyOverride: Output<String>?

Connection type used for connecting to the instance.

Link copied to clipboard

Whether or not the public data endpoint is enabled.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The storage account type to be used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage)

Link copied to clipboard

The managed instance's service principal.

Link copied to clipboard
val sku: Output<SkuResponse>?

Managed instance SKU. Allowed values for sku.name: GP_Gen5, GP_G8IM, GP_G8IH, BC_Gen5, BC_G8IM, BC_G8IH

Link copied to clipboard
val state: Output<String>

The state of the managed instance.

Link copied to clipboard
val storageSizeInGB: Output<Int>?

Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores.

Link copied to clipboard
val subnetId: Output<String>?

Subnet resource ID for the managed instance.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Resource tags.

Link copied to clipboard
val timezoneId: Output<String>?

Id of the timezone. Allowed values are timezones supported by Windows. Windows keeps details on supported timezones, including the id, in registry under KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. List of Ids can also be obtained by executing System.TimeZoneInfo::GetSystemTimeZones() in PowerShell. An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time".

Link copied to clipboard
val type: Output<String>

Resource type.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val vCores: Output<Int>?

The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80.

Link copied to clipboard
val zoneRedundant: Output<Boolean>?

Whether or not the multi-az is enabled.