1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. amqp
  5. getInstances
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

alicloud.amqp.getInstances

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

    This data source provides the Amqp Instances of the current Alibaba Cloud user.

    NOTE: Available since v1.128.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = new alicloud.amqp.Instance("default", {
        instanceName: name,
        instanceType: "enterprise",
        maxTps: "3000",
        maxConnections: 2000,
        queueCapacity: "200",
        paymentType: "Subscription",
        renewalStatus: "AutoRenewal",
        renewalDuration: 1,
        renewalDurationUnit: "Year",
        supportEip: true,
    });
    const ids = alicloud.amqp.getInstancesOutput({
        ids: [_default.id],
    });
    export const amqpInstanceId0 = ids.apply(ids => ids.instances?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.amqp.Instance("default",
        instance_name=name,
        instance_type="enterprise",
        max_tps="3000",
        max_connections=2000,
        queue_capacity="200",
        payment_type="Subscription",
        renewal_status="AutoRenewal",
        renewal_duration=1,
        renewal_duration_unit="Year",
        support_eip=True)
    ids = alicloud.amqp.get_instances_output(ids=[default.id])
    pulumi.export("amqpInstanceId0", ids.instances[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/amqp"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := amqp.NewInstance(ctx, "default", &amqp.InstanceArgs{
    			InstanceName:        pulumi.String(name),
    			InstanceType:        pulumi.String("enterprise"),
    			MaxTps:              pulumi.String("3000"),
    			MaxConnections:      pulumi.Int(2000),
    			QueueCapacity:       pulumi.String("200"),
    			PaymentType:         pulumi.String("Subscription"),
    			RenewalStatus:       pulumi.String("AutoRenewal"),
    			RenewalDuration:     pulumi.Int(1),
    			RenewalDurationUnit: pulumi.String("Year"),
    			SupportEip:          pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		ids := amqp.GetInstancesOutput(ctx, amqp.GetInstancesOutputArgs{
    			Ids: pulumi.StringArray{
    				_default.ID(),
    			},
    		}, nil)
    		ctx.Export("amqpInstanceId0", ids.ApplyT(func(ids amqp.GetInstancesResult) (*string, error) {
    			return &ids.Instances[0].Id, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = new AliCloud.Amqp.Instance("default", new()
        {
            InstanceName = name,
            InstanceType = "enterprise",
            MaxTps = "3000",
            MaxConnections = 2000,
            QueueCapacity = "200",
            PaymentType = "Subscription",
            RenewalStatus = "AutoRenewal",
            RenewalDuration = 1,
            RenewalDurationUnit = "Year",
            SupportEip = true,
        });
    
        var ids = AliCloud.Amqp.GetInstances.Invoke(new()
        {
            Ids = new[]
            {
                @default.Id,
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["amqpInstanceId0"] = ids.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.amqp.Instance;
    import com.pulumi.alicloud.amqp.InstanceArgs;
    import com.pulumi.alicloud.amqp.AmqpFunctions;
    import com.pulumi.alicloud.amqp.inputs.GetInstancesArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var default_ = new Instance("default", InstanceArgs.builder()
                .instanceName(name)
                .instanceType("enterprise")
                .maxTps("3000")
                .maxConnections(2000)
                .queueCapacity("200")
                .paymentType("Subscription")
                .renewalStatus("AutoRenewal")
                .renewalDuration(1)
                .renewalDurationUnit("Year")
                .supportEip(true)
                .build());
    
            final var ids = AmqpFunctions.getInstances(GetInstancesArgs.builder()
                .ids(default_.id())
                .build());
    
            ctx.export("amqpInstanceId0", ids.applyValue(_ids -> _ids.instances()[0].id()));
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: alicloud:amqp:Instance
        properties:
          instanceName: ${name}
          instanceType: enterprise
          maxTps: 3000
          maxConnections: 2000
          queueCapacity: 200
          paymentType: Subscription
          renewalStatus: AutoRenewal
          renewalDuration: 1
          renewalDurationUnit: Year
          supportEip: true
    variables:
      ids:
        fn::invoke:
          function: alicloud:amqp:getInstances
          arguments:
            ids:
              - ${default.id}
    outputs:
      amqpInstanceId0: ${ids.instances[0].id}
    

    Using getInstances

    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 getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
    function getInstancesOutput(args: GetInstancesOutputArgs, opts?: InvokeOptions): Output<GetInstancesResult>
    def get_instances(enable_details: Optional[bool] = None,
                      ids: Optional[Sequence[str]] = None,
                      name_regex: Optional[str] = None,
                      output_file: Optional[str] = None,
                      status: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetInstancesResult
    def get_instances_output(enable_details: Optional[pulumi.Input[bool]] = None,
                      ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      name_regex: Optional[pulumi.Input[str]] = None,
                      output_file: Optional[pulumi.Input[str]] = None,
                      status: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetInstancesResult]
    func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
    func GetInstancesOutput(ctx *Context, args *GetInstancesOutputArgs, opts ...InvokeOption) GetInstancesResultOutput

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

    public static class GetInstances 
    {
        public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
        public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
    public static Output<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: alicloud:amqp/getInstances:getInstances
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EnableDetails bool
    Whether to query the detailed list of resource attributes. Default value: false.
    Ids List<string>
    A list of Instance IDs.
    NameRegex string
    A regex string to filter results by Instance name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the resource. Valid values: DEPLOYING, SERVING, EXPIRED, RELEASED.
    EnableDetails bool
    Whether to query the detailed list of resource attributes. Default value: false.
    Ids []string
    A list of Instance IDs.
    NameRegex string
    A regex string to filter results by Instance name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the resource. Valid values: DEPLOYING, SERVING, EXPIRED, RELEASED.
    enableDetails Boolean
    Whether to query the detailed list of resource attributes. Default value: false.
    ids List<String>
    A list of Instance IDs.
    nameRegex String
    A regex string to filter results by Instance name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the resource. Valid values: DEPLOYING, SERVING, EXPIRED, RELEASED.
    enableDetails boolean
    Whether to query the detailed list of resource attributes. Default value: false.
    ids string[]
    A list of Instance IDs.
    nameRegex string
    A regex string to filter results by Instance name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status string
    The status of the resource. Valid values: DEPLOYING, SERVING, EXPIRED, RELEASED.
    enable_details bool
    Whether to query the detailed list of resource attributes. Default value: false.
    ids Sequence[str]
    A list of Instance IDs.
    name_regex str
    A regex string to filter results by Instance name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    status str
    The status of the resource. Valid values: DEPLOYING, SERVING, EXPIRED, RELEASED.
    enableDetails Boolean
    Whether to query the detailed list of resource attributes. Default value: false.
    ids List<String>
    A list of Instance IDs.
    nameRegex String
    A regex string to filter results by Instance name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the resource. Valid values: DEPLOYING, SERVING, EXPIRED, RELEASED.

    getInstances Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Instances List<Pulumi.AliCloud.Amqp.Outputs.GetInstancesInstance>
    A list of Amqp Instances. Each element contains the following attributes:
    Names List<string>
    A list of Instance names.
    EnableDetails bool
    NameRegex string
    OutputFile string
    Status string
    The status of the instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Instances []GetInstancesInstance
    A list of Amqp Instances. Each element contains the following attributes:
    Names []string
    A list of Instance names.
    EnableDetails bool
    NameRegex string
    OutputFile string
    Status string
    The status of the instance.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instances List<GetInstancesInstance>
    A list of Amqp Instances. Each element contains the following attributes:
    names List<String>
    A list of Instance names.
    enableDetails Boolean
    nameRegex String
    outputFile String
    status String
    The status of the instance.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    instances GetInstancesInstance[]
    A list of Amqp Instances. Each element contains the following attributes:
    names string[]
    A list of Instance names.
    enableDetails boolean
    nameRegex string
    outputFile string
    status string
    The status of the instance.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    instances Sequence[GetInstancesInstance]
    A list of Amqp Instances. Each element contains the following attributes:
    names Sequence[str]
    A list of Instance names.
    enable_details bool
    name_regex str
    output_file str
    status str
    The status of the instance.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instances List<Property Map>
    A list of Amqp Instances. Each element contains the following attributes:
    names List<String>
    A list of Instance names.
    enableDetails Boolean
    nameRegex String
    outputFile String
    status String
    The status of the instance.

    Supporting Types

    GetInstancesInstance

    CreateTime string
    The timestamp that indicates when the order was created.
    ExpireTime string
    The timestamp that indicates when the instance expires.
    Id string
    The ID of the Instance.
    InstanceId string
    THe instance Id.
    InstanceName string
    THe instance name.
    InstanceType string
    The instance type.
    PaymentType string
    The billing method of the instance. Note: payment_type takes effect only if enable_details is set to true.
    PrivateEndPoint string
    The virtual private cloud (VPC) endpoint of the instance.
    PublicEndpoint string
    The public endpoint of the instance.
    RenewalDuration int
    Auto renewal period of an instance. Note: renewal_duration takes effect only if enable_details is set to true.
    RenewalDurationUnit string
    Automatic renewal period unit. Note: renewal_duration_unit takes effect only if enable_details is set to true.
    RenewalStatus string
    Whether to renew an instance automatically or not. Note: renewal_status takes effect only if enable_details is set to true.
    Status string
    The status of the resource. Valid values: DEPLOYING, SERVING, EXPIRED, RELEASED.
    SupportEip bool
    Indicates whether the instance supports elastic IP addresses (EIPs).
    CreateTime string
    The timestamp that indicates when the order was created.
    ExpireTime string
    The timestamp that indicates when the instance expires.
    Id string
    The ID of the Instance.
    InstanceId string
    THe instance Id.
    InstanceName string
    THe instance name.
    InstanceType string
    The instance type.
    PaymentType string
    The billing method of the instance. Note: payment_type takes effect only if enable_details is set to true.
    PrivateEndPoint string
    The virtual private cloud (VPC) endpoint of the instance.
    PublicEndpoint string
    The public endpoint of the instance.
    RenewalDuration int
    Auto renewal period of an instance. Note: renewal_duration takes effect only if enable_details is set to true.
    RenewalDurationUnit string
    Automatic renewal period unit. Note: renewal_duration_unit takes effect only if enable_details is set to true.
    RenewalStatus string
    Whether to renew an instance automatically or not. Note: renewal_status takes effect only if enable_details is set to true.
    Status string
    The status of the resource. Valid values: DEPLOYING, SERVING, EXPIRED, RELEASED.
    SupportEip bool
    Indicates whether the instance supports elastic IP addresses (EIPs).
    createTime String
    The timestamp that indicates when the order was created.
    expireTime String
    The timestamp that indicates when the instance expires.
    id String
    The ID of the Instance.
    instanceId String
    THe instance Id.
    instanceName String
    THe instance name.
    instanceType String
    The instance type.
    paymentType String
    The billing method of the instance. Note: payment_type takes effect only if enable_details is set to true.
    privateEndPoint String
    The virtual private cloud (VPC) endpoint of the instance.
    publicEndpoint String
    The public endpoint of the instance.
    renewalDuration Integer
    Auto renewal period of an instance. Note: renewal_duration takes effect only if enable_details is set to true.
    renewalDurationUnit String
    Automatic renewal period unit. Note: renewal_duration_unit takes effect only if enable_details is set to true.
    renewalStatus String
    Whether to renew an instance automatically or not. Note: renewal_status takes effect only if enable_details is set to true.
    status String
    The status of the resource. Valid values: DEPLOYING, SERVING, EXPIRED, RELEASED.
    supportEip Boolean
    Indicates whether the instance supports elastic IP addresses (EIPs).
    createTime string
    The timestamp that indicates when the order was created.
    expireTime string
    The timestamp that indicates when the instance expires.
    id string
    The ID of the Instance.
    instanceId string
    THe instance Id.
    instanceName string
    THe instance name.
    instanceType string
    The instance type.
    paymentType string
    The billing method of the instance. Note: payment_type takes effect only if enable_details is set to true.
    privateEndPoint string
    The virtual private cloud (VPC) endpoint of the instance.
    publicEndpoint string
    The public endpoint of the instance.
    renewalDuration number
    Auto renewal period of an instance. Note: renewal_duration takes effect only if enable_details is set to true.
    renewalDurationUnit string
    Automatic renewal period unit. Note: renewal_duration_unit takes effect only if enable_details is set to true.
    renewalStatus string
    Whether to renew an instance automatically or not. Note: renewal_status takes effect only if enable_details is set to true.
    status string
    The status of the resource. Valid values: DEPLOYING, SERVING, EXPIRED, RELEASED.
    supportEip boolean
    Indicates whether the instance supports elastic IP addresses (EIPs).
    create_time str
    The timestamp that indicates when the order was created.
    expire_time str
    The timestamp that indicates when the instance expires.
    id str
    The ID of the Instance.
    instance_id str
    THe instance Id.
    instance_name str
    THe instance name.
    instance_type str
    The instance type.
    payment_type str
    The billing method of the instance. Note: payment_type takes effect only if enable_details is set to true.
    private_end_point str
    The virtual private cloud (VPC) endpoint of the instance.
    public_endpoint str
    The public endpoint of the instance.
    renewal_duration int
    Auto renewal period of an instance. Note: renewal_duration takes effect only if enable_details is set to true.
    renewal_duration_unit str
    Automatic renewal period unit. Note: renewal_duration_unit takes effect only if enable_details is set to true.
    renewal_status str
    Whether to renew an instance automatically or not. Note: renewal_status takes effect only if enable_details is set to true.
    status str
    The status of the resource. Valid values: DEPLOYING, SERVING, EXPIRED, RELEASED.
    support_eip bool
    Indicates whether the instance supports elastic IP addresses (EIPs).
    createTime String
    The timestamp that indicates when the order was created.
    expireTime String
    The timestamp that indicates when the instance expires.
    id String
    The ID of the Instance.
    instanceId String
    THe instance Id.
    instanceName String
    THe instance name.
    instanceType String
    The instance type.
    paymentType String
    The billing method of the instance. Note: payment_type takes effect only if enable_details is set to true.
    privateEndPoint String
    The virtual private cloud (VPC) endpoint of the instance.
    publicEndpoint String
    The public endpoint of the instance.
    renewalDuration Number
    Auto renewal period of an instance. Note: renewal_duration takes effect only if enable_details is set to true.
    renewalDurationUnit String
    Automatic renewal period unit. Note: renewal_duration_unit takes effect only if enable_details is set to true.
    renewalStatus String
    Whether to renew an instance automatically or not. Note: renewal_status takes effect only if enable_details is set to true.
    status String
    The status of the resource. Valid values: DEPLOYING, SERVING, EXPIRED, RELEASED.
    supportEip Boolean
    Indicates whether the instance supports elastic IP addresses (EIPs).

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi