1. Registry
  2. Packages
  3. Ucloud Provider
  4. API Docs
  5. getSqlserverInstances
Viewing docs for ucloud 1.49.0
published on Tuesday, Oct 27, 2026 by ucloud
ucloud
Viewing docs for ucloud 1.49.0
published on Tuesday, Oct 27, 2026 by ucloud

    This data source provides a list of SQL Server instance resources.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const example = ucloud.getSqlserverInstances({});
    export const first = example.then(example => example.sqlserverInstances?.[0]?.id);
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    example = ucloud.get_sqlserver_instances()
    pulumi.export("first", example.sqlserver_instances[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ucloud.GetSqlserverInstances(ctx, &ucloud.GetSqlserverInstancesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("first", example.SqlserverInstances[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ucloud.GetSqlserverInstances.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["first"] = example.Apply(getSqlserverInstancesResult => getSqlserverInstancesResult.SqlserverInstances[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.UcloudFunctions;
    import com.pulumi.ucloud.inputs.GetSqlserverInstancesArgs;
    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 = UcloudFunctions.getSqlserverInstances(GetSqlserverInstancesArgs.builder()
                .build());
    
            ctx.export("first", example.sqlserverInstances()[0].id());
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ucloud:getSqlserverInstances
          arguments: {}
    outputs:
      first: ${example.sqlserverInstances[0].id}
    
    Example coming soon!
    

    Using getSqlserverInstances

    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 getSqlserverInstances(args: GetSqlserverInstancesArgs, opts?: InvokeOptions): Promise<GetSqlserverInstancesResult>
    function getSqlserverInstancesOutput(args: GetSqlserverInstancesOutputArgs, opts?: InvokeOutputOptions): Output<GetSqlserverInstancesResult>
    def get_sqlserver_instances(availability_zone: Optional[str] = None,
                                id: Optional[str] = None,
                                ids: Optional[Sequence[str]] = None,
                                name_regex: Optional[str] = None,
                                output_file: Optional[str] = None,
                                vpc_id: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetSqlserverInstancesResult
    def get_sqlserver_instances_output(availability_zone: pulumi.Input[Optional[str]] = None,
                                id: pulumi.Input[Optional[str]] = None,
                                ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                                name_regex: pulumi.Input[Optional[str]] = None,
                                output_file: pulumi.Input[Optional[str]] = None,
                                vpc_id: pulumi.Input[Optional[str]] = None,
                                opts: Optional[InvokeOutputOptions] = None) -> Output[GetSqlserverInstancesResult]
    func GetSqlserverInstances(ctx *Context, args *GetSqlserverInstancesArgs, opts ...InvokeOption) (*GetSqlserverInstancesResult, error)
    func GetSqlserverInstancesOutput(ctx *Context, args *GetSqlserverInstancesOutputArgs, opts ...InvokeOption) GetSqlserverInstancesResultOutput

    > Note: This function is named GetSqlserverInstances in the Go SDK.

    public static class GetSqlserverInstances 
    {
        public static Task<GetSqlserverInstancesResult> InvokeAsync(GetSqlserverInstancesArgs args, InvokeOptions? opts = null)
        public static Output<GetSqlserverInstancesResult> Invoke(GetSqlserverInstancesInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetSqlserverInstancesResult> Invoke(GetSqlserverInstancesInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetSqlserverInstancesResult> getSqlserverInstances(GetSqlserverInstancesArgs args, InvokeOptions options)
    public static Output<GetSqlserverInstancesResult> getSqlserverInstances(GetSqlserverInstancesArgs args, InvokeOptions options)
    public static Output<GetSqlserverInstancesResult> getSqlserverInstances(GetSqlserverInstancesArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: ucloud:index/getSqlserverInstances:getSqlserverInstances
      arguments:
        # arguments dictionary
    data "ucloud_get_sqlserver_instances" "name" {
        # arguments
    }

    The following arguments are supported:

    AvailabilityZone string
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    Id string
    The ID of the instance.
    Ids List<string>
    A list of SQL Server instance IDs.
    NameRegex string
    A regex string to filter resulting instances by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    VpcId string
    The ID of the VPC linked to the instances.
    AvailabilityZone string
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    Id string
    The ID of the instance.
    Ids []string
    A list of SQL Server instance IDs.
    NameRegex string
    A regex string to filter resulting instances by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    VpcId string
    The ID of the VPC linked to the instances.
    availability_zone string
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    id string
    The ID of the instance.
    ids list(string)
    A list of SQL Server instance IDs.
    name_regex string
    A regex string to filter resulting instances by name.
    output_file string
    File name where to save data source results (after running pulumi preview).
    vpc_id string
    The ID of the VPC linked to the instances.
    availabilityZone String
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    id String
    The ID of the instance.
    ids List<String>
    A list of SQL Server instance IDs.
    nameRegex String
    A regex string to filter resulting instances by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    vpcId String
    The ID of the VPC linked to the instances.
    availabilityZone string
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    id string
    The ID of the instance.
    ids string[]
    A list of SQL Server instance IDs.
    nameRegex string
    A regex string to filter resulting instances by name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    vpcId string
    The ID of the VPC linked to the instances.
    availability_zone str
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    id str
    The ID of the instance.
    ids Sequence[str]
    A list of SQL Server instance IDs.
    name_regex str
    A regex string to filter resulting instances by name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    vpc_id str
    The ID of the VPC linked to the instances.
    availabilityZone String
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    id String
    The ID of the instance.
    ids List<String>
    A list of SQL Server instance IDs.
    nameRegex String
    A regex string to filter resulting instances by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    vpcId String
    The ID of the VPC linked to the instances.

    getSqlserverInstances Result

    The following output properties are available:

    Id string
    The ID of the instance.
    Ids List<string>
    SqlserverInstances List<GetSqlserverInstancesSqlserverInstance>
    It is a nested type which documented below.
    TotalCount double
    Total number of instances that satisfy the condition.
    AvailabilityZone string
    Availability zone where the instance is located.
    NameRegex string
    OutputFile string
    VpcId string
    The ID of the VPC linked to the instance.
    Id string
    The ID of the instance.
    Ids []string
    SqlserverInstances []GetSqlserverInstancesSqlserverInstance
    It is a nested type which documented below.
    TotalCount float64
    Total number of instances that satisfy the condition.
    AvailabilityZone string
    Availability zone where the instance is located.
    NameRegex string
    OutputFile string
    VpcId string
    The ID of the VPC linked to the instance.
    id string
    The ID of the instance.
    ids list(string)
    sqlserver_instances list(object)
    It is a nested type which documented below.
    total_count number
    Total number of instances that satisfy the condition.
    availability_zone string
    Availability zone where the instance is located.
    name_regex string
    output_file string
    vpc_id string
    The ID of the VPC linked to the instance.
    id String
    The ID of the instance.
    ids List<String>
    sqlserverInstances List<GetSqlserverInstancesSqlserverInstance>
    It is a nested type which documented below.
    totalCount Double
    Total number of instances that satisfy the condition.
    availabilityZone String
    Availability zone where the instance is located.
    nameRegex String
    outputFile String
    vpcId String
    The ID of the VPC linked to the instance.
    id string
    The ID of the instance.
    ids string[]
    sqlserverInstances GetSqlserverInstancesSqlserverInstance[]
    It is a nested type which documented below.
    totalCount number
    Total number of instances that satisfy the condition.
    availabilityZone string
    Availability zone where the instance is located.
    nameRegex string
    outputFile string
    vpcId string
    The ID of the VPC linked to the instance.
    id str
    The ID of the instance.
    ids Sequence[str]
    sqlserver_instances Sequence[GetSqlserverInstancesSqlserverInstance]
    It is a nested type which documented below.
    total_count float
    Total number of instances that satisfy the condition.
    availability_zone str
    Availability zone where the instance is located.
    name_regex str
    output_file str
    vpc_id str
    The ID of the VPC linked to the instance.
    id String
    The ID of the instance.
    ids List<String>
    sqlserverInstances List<Property Map>
    It is a nested type which documented below.
    totalCount Number
    Total number of instances that satisfy the condition.
    availabilityZone String
    Availability zone where the instance is located.
    nameRegex String
    outputFile String
    vpcId String
    The ID of the VPC linked to the instance.

    Supporting Types

    GetSqlserverInstancesSqlserverInstance

    AvailabilityZone string
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    ChargeType string
    The charge type of the instance.
    Cpu double
    The number of CPU cores.
    CreateTime string
    The time when the instance was created.
    DbVersion string
    The database version.
    DiskSpace double
    The allocated storage size in gigabytes (GB).
    ExpireTime string
    The expiration time of the instance.
    Id string
    The ID of the instance.
    Memory double
    The size of memory in megabytes (MB).
    Name string
    The name of the instance.
    Port double
    The port on which the database accepts connections.
    PrivateIp string
    The private IP address assigned to the instance.
    Status string
    The current status of the instance.
    SubnetId string
    The ID of the subnet linked to the instance.
    VpcId string
    The ID of the VPC linked to the instances.
    AvailabilityZone string
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    ChargeType string
    The charge type of the instance.
    Cpu float64
    The number of CPU cores.
    CreateTime string
    The time when the instance was created.
    DbVersion string
    The database version.
    DiskSpace float64
    The allocated storage size in gigabytes (GB).
    ExpireTime string
    The expiration time of the instance.
    Id string
    The ID of the instance.
    Memory float64
    The size of memory in megabytes (MB).
    Name string
    The name of the instance.
    Port float64
    The port on which the database accepts connections.
    PrivateIp string
    The private IP address assigned to the instance.
    Status string
    The current status of the instance.
    SubnetId string
    The ID of the subnet linked to the instance.
    VpcId string
    The ID of the VPC linked to the instances.
    availability_zone string
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    charge_type string
    The charge type of the instance.
    cpu number
    The number of CPU cores.
    create_time string
    The time when the instance was created.
    db_version string
    The database version.
    disk_space number
    The allocated storage size in gigabytes (GB).
    expire_time string
    The expiration time of the instance.
    id string
    The ID of the instance.
    memory number
    The size of memory in megabytes (MB).
    name string
    The name of the instance.
    port number
    The port on which the database accepts connections.
    private_ip string
    The private IP address assigned to the instance.
    status string
    The current status of the instance.
    subnet_id string
    The ID of the subnet linked to the instance.
    vpc_id string
    The ID of the VPC linked to the instances.
    availabilityZone String
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    chargeType String
    The charge type of the instance.
    cpu Double
    The number of CPU cores.
    createTime String
    The time when the instance was created.
    dbVersion String
    The database version.
    diskSpace Double
    The allocated storage size in gigabytes (GB).
    expireTime String
    The expiration time of the instance.
    id String
    The ID of the instance.
    memory Double
    The size of memory in megabytes (MB).
    name String
    The name of the instance.
    port Double
    The port on which the database accepts connections.
    privateIp String
    The private IP address assigned to the instance.
    status String
    The current status of the instance.
    subnetId String
    The ID of the subnet linked to the instance.
    vpcId String
    The ID of the VPC linked to the instances.
    availabilityZone string
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    chargeType string
    The charge type of the instance.
    cpu number
    The number of CPU cores.
    createTime string
    The time when the instance was created.
    dbVersion string
    The database version.
    diskSpace number
    The allocated storage size in gigabytes (GB).
    expireTime string
    The expiration time of the instance.
    id string
    The ID of the instance.
    memory number
    The size of memory in megabytes (MB).
    name string
    The name of the instance.
    port number
    The port on which the database accepts connections.
    privateIp string
    The private IP address assigned to the instance.
    status string
    The current status of the instance.
    subnetId string
    The ID of the subnet linked to the instance.
    vpcId string
    The ID of the VPC linked to the instances.
    availability_zone str
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    charge_type str
    The charge type of the instance.
    cpu float
    The number of CPU cores.
    create_time str
    The time when the instance was created.
    db_version str
    The database version.
    disk_space float
    The allocated storage size in gigabytes (GB).
    expire_time str
    The expiration time of the instance.
    id str
    The ID of the instance.
    memory float
    The size of memory in megabytes (MB).
    name str
    The name of the instance.
    port float
    The port on which the database accepts connections.
    private_ip str
    The private IP address assigned to the instance.
    status str
    The current status of the instance.
    subnet_id str
    The ID of the subnet linked to the instance.
    vpc_id str
    The ID of the VPC linked to the instances.
    availabilityZone String
    Availability zone where the SQL Server instances are located. Such as: "cn-bj2-05".
    chargeType String
    The charge type of the instance.
    cpu Number
    The number of CPU cores.
    createTime String
    The time when the instance was created.
    dbVersion String
    The database version.
    diskSpace Number
    The allocated storage size in gigabytes (GB).
    expireTime String
    The expiration time of the instance.
    id String
    The ID of the instance.
    memory Number
    The size of memory in megabytes (MB).
    name String
    The name of the instance.
    port Number
    The port on which the database accepts connections.
    privateIp String
    The private IP address assigned to the instance.
    status String
    The current status of the instance.
    subnetId String
    The ID of the subnet linked to the instance.
    vpcId String
    The ID of the VPC linked to the instances.

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    ucloud
    Viewing docs for ucloud 1.49.0
    published on Tuesday, Oct 27, 2026 by ucloud

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial