Managed Instance Args
An Azure SQL managed instance. Uses Azure REST API version 2023-08-01. In version 2.x of the Azure Native provider, it used API version 2021-11-01. Other available API versions: 2015-05-01-preview, 2018-06-01-preview, 2020-02-02-preview, 2020-08-01-preview, 2020-11-01-preview, 2021-02-01-preview, 2021-05-01-preview, 2021-08-01-preview, 2021-11-01, 2021-11-01-preview, 2022-02-01-preview, 2022-05-01-preview, 2022-08-01-preview, 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview, 2024-05-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native sql [ApiVersion]
. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.
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",
},
AuthenticationMetadata = AzureNative.Sql.AuthMetadataLookupModes.AzureAD,
Collation = "SQL_Latin1_General_CP1_CI_AS",
DatabaseFormat = AzureNative.Sql.ManagedInstanceDatabaseFormat.AlwaysUpToDate,
DnsZonePartner = "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance",
HybridSecondaryUsage = AzureNative.Sql.HybridSecondaryUsage.Passive,
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/v3"
"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"),
},
AuthenticationMetadata: pulumi.String(sql.AuthMetadataLookupModesAzureAD),
Collation: pulumi.String("SQL_Latin1_General_CP1_CI_AS"),
DatabaseFormat: pulumi.String(sql.ManagedInstanceDatabaseFormatAlwaysUpToDate),
DnsZonePartner: pulumi.String("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"),
HybridSecondaryUsage: pulumi.String(sql.HybridSecondaryUsagePassive),
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())
.authenticationMetadata("AzureAD")
.collation("SQL_Latin1_General_CP1_CI_AS")
.databaseFormat("AlwaysUpToDate")
.dnsZonePartner("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance")
.hybridSecondaryUsage("Passive")
.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_Gen5",
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/v3"
"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_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"),
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_Gen5")
.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}
Constructors
Properties
Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation).
The administrator login password (required for managed instance creation).
The Azure Active Directory administrator of the instance. This can only be used at instance create time. If used for instance update, it will be ignored or it will result in an error. For updates individual APIs will need to be used.
The managed instance's authentication metadata lookup mode.
Specifies the internal format of instance databases specific to the SQL engine version.
The resource id of another managed instance whose DNS zone this managed instance will share after creation.
Hybrid secondary usage. Possible values are 'Active' (default value) and 'Passive' (customer uses the secondary as Passive DR).
The Azure Active Directory identity of the managed instance.
The Id of the instance pool this managed server belongs to.
Whether or not this is a GPv2 variant of General Purpose edition.
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).
Specifies maintenance configuration id to apply to this managed instance.
Specifies the mode of database creation. Default: Regular instance creation. Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified.
The name of the managed instance.
Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'
Pricing model of Managed Instance.
The resource id of a user assigned identity to be used by default.
Connection type used for connecting to the instance.
Whether or not the public data endpoint is enabled.
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)
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
The managed instance's service principal.
The resource identifier of the source managed instance associated with create operation of this instance.
Storage IOps. Minimum value: 300. Maximum value: 80000. Increments of 1 IOps allowed only. Maximum value depends on the selected hardware family and number of vCores.
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.
Storage throughput MBps parameter is not supported in the instance create/update operation.
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".
Whether or not the multi-az is enabled.