We recommend using Azure Native.
Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi
azure.sql.getSqlManagedInstance
Explore with Pulumi AI
Use this data source to access information about an existing SQL Managed Instance.
Note: The
azure.sql.ManagedInstance
data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use theazure.mssql.ManagedInstance
data source instead.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.sql.getSqlManagedInstance({
name: "example_mi",
resourceGroupName: "example-resources",
});
export const sqlInstanceId = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.sql.get_sql_managed_instance(name="example_mi",
resource_group_name="example-resources")
pulumi.export("sqlInstanceId", example.id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := sql.GetSqlManagedInstance(ctx, &sql.GetSqlManagedInstanceArgs{
Name: "example_mi",
ResourceGroupName: "example-resources",
}, nil)
if err != nil {
return err
}
ctx.Export("sqlInstanceId", example.Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Sql.GetSqlManagedInstance.Invoke(new()
{
Name = "example_mi",
ResourceGroupName = "example-resources",
});
return new Dictionary<string, object?>
{
["sqlInstanceId"] = example.Apply(getSqlManagedInstanceResult => getSqlManagedInstanceResult.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.sql.SqlFunctions;
import com.pulumi.azure.sql.inputs.GetSqlManagedInstanceArgs;
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) {
final var example = SqlFunctions.getSqlManagedInstance(GetSqlManagedInstanceArgs.builder()
.name("example_mi")
.resourceGroupName("example-resources")
.build());
ctx.export("sqlInstanceId", example.applyValue(getSqlManagedInstanceResult -> getSqlManagedInstanceResult.id()));
}
}
variables:
example:
fn::invoke:
Function: azure:sql:getSqlManagedInstance
Arguments:
name: example_mi
resourceGroupName: example-resources
outputs:
sqlInstanceId: ${example.id}
Using getSqlManagedInstance
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getSqlManagedInstance(args: GetSqlManagedInstanceArgs, opts?: InvokeOptions): Promise<GetSqlManagedInstanceResult>
function getSqlManagedInstanceOutput(args: GetSqlManagedInstanceOutputArgs, opts?: InvokeOptions): Output<GetSqlManagedInstanceResult>
def get_sql_managed_instance(name: Optional[str] = None,
resource_group_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetSqlManagedInstanceResult
def get_sql_managed_instance_output(name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSqlManagedInstanceResult]
func GetSqlManagedInstance(ctx *Context, args *GetSqlManagedInstanceArgs, opts ...InvokeOption) (*GetSqlManagedInstanceResult, error)
func GetSqlManagedInstanceOutput(ctx *Context, args *GetSqlManagedInstanceOutputArgs, opts ...InvokeOption) GetSqlManagedInstanceResultOutput
> Note: This function is named GetSqlManagedInstance
in the Go SDK.
public static class GetSqlManagedInstance
{
public static Task<GetSqlManagedInstanceResult> InvokeAsync(GetSqlManagedInstanceArgs args, InvokeOptions? opts = null)
public static Output<GetSqlManagedInstanceResult> Invoke(GetSqlManagedInstanceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSqlManagedInstanceResult> getSqlManagedInstance(GetSqlManagedInstanceArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: azure:sql/getSqlManagedInstance:getSqlManagedInstance
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- The name of the SQL Managed Instance.
- Resource
Group stringName - The name of the Resource Group in which the SQL Managed Instance exists.
- Dictionary<string, string>
- A mapping of tags assigned to the resource.
- Name string
- The name of the SQL Managed Instance.
- Resource
Group stringName - The name of the Resource Group in which the SQL Managed Instance exists.
- map[string]string
- A mapping of tags assigned to the resource.
- name String
- The name of the SQL Managed Instance.
- resource
Group StringName - The name of the Resource Group in which the SQL Managed Instance exists.
- Map<String,String>
- A mapping of tags assigned to the resource.
- name string
- The name of the SQL Managed Instance.
- resource
Group stringName - The name of the Resource Group in which the SQL Managed Instance exists.
- {[key: string]: string}
- A mapping of tags assigned to the resource.
- name str
- The name of the SQL Managed Instance.
- resource_
group_ strname - The name of the Resource Group in which the SQL Managed Instance exists.
- Mapping[str, str]
- A mapping of tags assigned to the resource.
- name String
- The name of the SQL Managed Instance.
- resource
Group StringName - The name of the Resource Group in which the SQL Managed Instance exists.
- Map<String>
- A mapping of tags assigned to the resource.
getSqlManagedInstance Result
The following output properties are available:
- Administrator
Login string - The administrator login name for the new server.
- Collation string
- Specifies how the SQL Managed Instance is collated.
- Dns
Zone stringPartner Id - The ID of the Managed Instance which is sharing the DNS zone.
- Fqdn string
- The fully qualified domain name of the Azure Managed SQL Instance.
- Id string
- The provider-assigned unique ID for this managed resource.
- Identities
List<Get
Sql Managed Instance Identity> - An
identity
block as defined below. - License
Type string - Type of license the Managed Instance uses.
- Location string
- Location where the resource exists.
- Minimum
Tls stringVersion - The Minimum TLS Version.
- Name string
- Proxy
Override string - How the SQL Managed Instance is accessed.
- Public
Data boolEndpoint Enabled - Is the public data endpoint enabled?
- Resource
Group stringName - Sku
Name string - SKU Name for the SQL Managed Instance.
- Storage
Account stringType - Storage account type used to store backups for this SQL Managed Instance.
- Storage
Size intIn Gb - Maximum storage space for your instance.
- Subnet
Id string - The subnet resource id that the SQL Managed Instance is associated with.
- Timezone
Id string - The TimeZone ID that the SQL Managed Instance is operating in.
- Vcores int
- Number of cores assigned to your instance.
- Dictionary<string, string>
- A mapping of tags assigned to the resource.
- Administrator
Login string - The administrator login name for the new server.
- Collation string
- Specifies how the SQL Managed Instance is collated.
- Dns
Zone stringPartner Id - The ID of the Managed Instance which is sharing the DNS zone.
- Fqdn string
- The fully qualified domain name of the Azure Managed SQL Instance.
- Id string
- The provider-assigned unique ID for this managed resource.
- Identities
[]Get
Sql Managed Instance Identity - An
identity
block as defined below. - License
Type string - Type of license the Managed Instance uses.
- Location string
- Location where the resource exists.
- Minimum
Tls stringVersion - The Minimum TLS Version.
- Name string
- Proxy
Override string - How the SQL Managed Instance is accessed.
- Public
Data boolEndpoint Enabled - Is the public data endpoint enabled?
- Resource
Group stringName - Sku
Name string - SKU Name for the SQL Managed Instance.
- Storage
Account stringType - Storage account type used to store backups for this SQL Managed Instance.
- Storage
Size intIn Gb - Maximum storage space for your instance.
- Subnet
Id string - The subnet resource id that the SQL Managed Instance is associated with.
- Timezone
Id string - The TimeZone ID that the SQL Managed Instance is operating in.
- Vcores int
- Number of cores assigned to your instance.
- map[string]string
- A mapping of tags assigned to the resource.
- administrator
Login String - The administrator login name for the new server.
- collation String
- Specifies how the SQL Managed Instance is collated.
- dns
Zone StringPartner Id - The ID of the Managed Instance which is sharing the DNS zone.
- fqdn String
- The fully qualified domain name of the Azure Managed SQL Instance.
- id String
- The provider-assigned unique ID for this managed resource.
- identities
List<Get
Sql Managed Instance Identity> - An
identity
block as defined below. - license
Type String - Type of license the Managed Instance uses.
- location String
- Location where the resource exists.
- minimum
Tls StringVersion - The Minimum TLS Version.
- name String
- proxy
Override String - How the SQL Managed Instance is accessed.
- public
Data BooleanEndpoint Enabled - Is the public data endpoint enabled?
- resource
Group StringName - sku
Name String - SKU Name for the SQL Managed Instance.
- storage
Account StringType - Storage account type used to store backups for this SQL Managed Instance.
- storage
Size IntegerIn Gb - Maximum storage space for your instance.
- subnet
Id String - The subnet resource id that the SQL Managed Instance is associated with.
- timezone
Id String - The TimeZone ID that the SQL Managed Instance is operating in.
- vcores Integer
- Number of cores assigned to your instance.
- Map<String,String>
- A mapping of tags assigned to the resource.
- administrator
Login string - The administrator login name for the new server.
- collation string
- Specifies how the SQL Managed Instance is collated.
- dns
Zone stringPartner Id - The ID of the Managed Instance which is sharing the DNS zone.
- fqdn string
- The fully qualified domain name of the Azure Managed SQL Instance.
- id string
- The provider-assigned unique ID for this managed resource.
- identities
Get
Sql Managed Instance Identity[] - An
identity
block as defined below. - license
Type string - Type of license the Managed Instance uses.
- location string
- Location where the resource exists.
- minimum
Tls stringVersion - The Minimum TLS Version.
- name string
- proxy
Override string - How the SQL Managed Instance is accessed.
- public
Data booleanEndpoint Enabled - Is the public data endpoint enabled?
- resource
Group stringName - sku
Name string - SKU Name for the SQL Managed Instance.
- storage
Account stringType - Storage account type used to store backups for this SQL Managed Instance.
- storage
Size numberIn Gb - Maximum storage space for your instance.
- subnet
Id string - The subnet resource id that the SQL Managed Instance is associated with.
- timezone
Id string - The TimeZone ID that the SQL Managed Instance is operating in.
- vcores number
- Number of cores assigned to your instance.
- {[key: string]: string}
- A mapping of tags assigned to the resource.
- administrator_
login str - The administrator login name for the new server.
- collation str
- Specifies how the SQL Managed Instance is collated.
- dns_
zone_ strpartner_ id - The ID of the Managed Instance which is sharing the DNS zone.
- fqdn str
- The fully qualified domain name of the Azure Managed SQL Instance.
- id str
- The provider-assigned unique ID for this managed resource.
- identities
Sequence[Get
Sql Managed Instance Identity] - An
identity
block as defined below. - license_
type str - Type of license the Managed Instance uses.
- location str
- Location where the resource exists.
- minimum_
tls_ strversion - The Minimum TLS Version.
- name str
- proxy_
override str - How the SQL Managed Instance is accessed.
- public_
data_ boolendpoint_ enabled - Is the public data endpoint enabled?
- resource_
group_ strname - sku_
name str - SKU Name for the SQL Managed Instance.
- storage_
account_ strtype - Storage account type used to store backups for this SQL Managed Instance.
- storage_
size_ intin_ gb - Maximum storage space for your instance.
- subnet_
id str - The subnet resource id that the SQL Managed Instance is associated with.
- timezone_
id str - The TimeZone ID that the SQL Managed Instance is operating in.
- vcores int
- Number of cores assigned to your instance.
- Mapping[str, str]
- A mapping of tags assigned to the resource.
- administrator
Login String - The administrator login name for the new server.
- collation String
- Specifies how the SQL Managed Instance is collated.
- dns
Zone StringPartner Id - The ID of the Managed Instance which is sharing the DNS zone.
- fqdn String
- The fully qualified domain name of the Azure Managed SQL Instance.
- id String
- The provider-assigned unique ID for this managed resource.
- identities List<Property Map>
- An
identity
block as defined below. - license
Type String - Type of license the Managed Instance uses.
- location String
- Location where the resource exists.
- minimum
Tls StringVersion - The Minimum TLS Version.
- name String
- proxy
Override String - How the SQL Managed Instance is accessed.
- public
Data BooleanEndpoint Enabled - Is the public data endpoint enabled?
- resource
Group StringName - sku
Name String - SKU Name for the SQL Managed Instance.
- storage
Account StringType - Storage account type used to store backups for this SQL Managed Instance.
- storage
Size NumberIn Gb - Maximum storage space for your instance.
- subnet
Id String - The subnet resource id that the SQL Managed Instance is associated with.
- timezone
Id String - The TimeZone ID that the SQL Managed Instance is operating in.
- vcores Number
- Number of cores assigned to your instance.
- Map<String>
- A mapping of tags assigned to the resource.
Supporting Types
GetSqlManagedInstanceIdentity
- Principal
Id string - The Principal ID for the Service Principal associated with the Identity of this SQL Managed Instance.
- Tenant
Id string - The Tenant ID for the Service Principal associated with the Identity of this SQL Managed Instance.
- Type string
- Principal
Id string - The Principal ID for the Service Principal associated with the Identity of this SQL Managed Instance.
- Tenant
Id string - The Tenant ID for the Service Principal associated with the Identity of this SQL Managed Instance.
- Type string
- principal
Id String - The Principal ID for the Service Principal associated with the Identity of this SQL Managed Instance.
- tenant
Id String - The Tenant ID for the Service Principal associated with the Identity of this SQL Managed Instance.
- type String
- principal
Id string - The Principal ID for the Service Principal associated with the Identity of this SQL Managed Instance.
- tenant
Id string - The Tenant ID for the Service Principal associated with the Identity of this SQL Managed Instance.
- type string
- principal_
id str - The Principal ID for the Service Principal associated with the Identity of this SQL Managed Instance.
- tenant_
id str - The Tenant ID for the Service Principal associated with the Identity of this SQL Managed Instance.
- type str
- principal
Id String - The Principal ID for the Service Principal associated with the Identity of this SQL Managed Instance.
- tenant
Id String - The Tenant ID for the Service Principal associated with the Identity of this SQL Managed Instance.
- type String
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.