1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. amqp
  5. getInstances
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.amqp.getInstances

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

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

    NOTE: Available in v1.128.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.amqp.getInstances({
        ids: [
            "amqp-abc12345",
            "amqp-abc34567",
        ],
    });
    export const amqpInstanceId1 = ids.then(ids => ids.instances?.[0]?.id);
    const nameRegex = alicloud.amqp.getInstances({
        nameRegex: "^my-Instance",
    });
    export const amqpInstanceId2 = nameRegex.then(nameRegex => nameRegex.instances?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.amqp.get_instances(ids=[
        "amqp-abc12345",
        "amqp-abc34567",
    ])
    pulumi.export("amqpInstanceId1", ids.instances[0].id)
    name_regex = alicloud.amqp.get_instances(name_regex="^my-Instance")
    pulumi.export("amqpInstanceId2", name_regex.instances[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/amqp"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := amqp.GetInstances(ctx, &amqp.GetInstancesArgs{
    			Ids: []string{
    				"amqp-abc12345",
    				"amqp-abc34567",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("amqpInstanceId1", ids.Instances[0].Id)
    		nameRegex, err := amqp.GetInstances(ctx, &amqp.GetInstancesArgs{
    			NameRegex: pulumi.StringRef("^my-Instance"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("amqpInstanceId2", nameRegex.Instances[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Amqp.GetInstances.Invoke(new()
        {
            Ids = new[]
            {
                "amqp-abc12345",
                "amqp-abc34567",
            },
        });
    
        var nameRegex = AliCloud.Amqp.GetInstances.Invoke(new()
        {
            NameRegex = "^my-Instance",
        });
    
        return new Dictionary<string, object?>
        {
            ["amqpInstanceId1"] = ids.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
            ["amqpInstanceId2"] = nameRegex.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.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 ids = AmqpFunctions.getInstances(GetInstancesArgs.builder()
                .ids(            
                    "amqp-abc12345",
                    "amqp-abc34567")
                .build());
    
            ctx.export("amqpInstanceId1", ids.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()));
            final var nameRegex = AmqpFunctions.getInstances(GetInstancesArgs.builder()
                .nameRegex("^my-Instance")
                .build());
    
            ctx.export("amqpInstanceId2", nameRegex.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:amqp:getInstances
          Arguments:
            ids:
              - amqp-abc12345
              - amqp-abc34567
      nameRegex:
        fn::invoke:
          Function: alicloud:amqp:getInstances
          Arguments:
            nameRegex: ^my-Instance
    outputs:
      amqpInstanceId1: ${ids.instances[0].id}
      amqpInstanceId2: ${nameRegex.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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:amqp/getInstances:getInstances
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    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", "EXPIRED", "RELEASED", "SERVING".
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    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", "EXPIRED", "RELEASED", "SERVING".
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    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", "EXPIRED", "RELEASED", "SERVING".
    enableDetails boolean
    Default to false. Set it to true can output more details about resource attributes.
    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", "EXPIRED", "RELEASED", "SERVING".
    enable_details bool
    Default to false. Set it to true can output more details about resource attributes.
    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", "EXPIRED", "RELEASED", "SERVING".
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    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", "EXPIRED", "RELEASED", "SERVING".

    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>
    Names List<string>
    EnableDetails bool
    NameRegex string
    OutputFile string
    Status string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Instances []GetInstancesInstance
    Names []string
    EnableDetails bool
    NameRegex string
    OutputFile string
    Status string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instances List<GetInstancesInstance>
    names List<String>
    enableDetails Boolean
    nameRegex String
    outputFile String
    status String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    instances GetInstancesInstance[]
    names string[]
    enableDetails boolean
    nameRegex string
    outputFile string
    status string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    instances Sequence[GetInstancesInstance]
    names Sequence[str]
    enable_details bool
    name_regex str
    output_file str
    status str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instances List<Property Map>
    names List<String>
    enableDetails Boolean
    nameRegex String
    outputFile String
    status String

    Supporting Types

    GetInstancesInstance

    CreateTime string
    OrderCreateTime.
    ExpireTime string
    ExpireTime.
    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 Pay-as-You-Type Values Include: the Subscription of a Pre-Paid.
    PrivateEndPoint string
    The private endPoint.
    PublicEndpoint string
    The public dndpoint.
    RenewalDuration int
    Renewal duration.
    RenewalDurationUnit string
    Auto-Renewal Cycle Unit Values Include: Month: Month. Year: Years.
    RenewalStatus string
    Renew status.
    Status string
    The status of the resource.
    SupportEip bool
    Whether to support eip.
    CreateTime string
    OrderCreateTime.
    ExpireTime string
    ExpireTime.
    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 Pay-as-You-Type Values Include: the Subscription of a Pre-Paid.
    PrivateEndPoint string
    The private endPoint.
    PublicEndpoint string
    The public dndpoint.
    RenewalDuration int
    Renewal duration.
    RenewalDurationUnit string
    Auto-Renewal Cycle Unit Values Include: Month: Month. Year: Years.
    RenewalStatus string
    Renew status.
    Status string
    The status of the resource.
    SupportEip bool
    Whether to support eip.
    createTime String
    OrderCreateTime.
    expireTime String
    ExpireTime.
    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 Pay-as-You-Type Values Include: the Subscription of a Pre-Paid.
    privateEndPoint String
    The private endPoint.
    publicEndpoint String
    The public dndpoint.
    renewalDuration Integer
    Renewal duration.
    renewalDurationUnit String
    Auto-Renewal Cycle Unit Values Include: Month: Month. Year: Years.
    renewalStatus String
    Renew status.
    status String
    The status of the resource.
    supportEip Boolean
    Whether to support eip.
    createTime string
    OrderCreateTime.
    expireTime string
    ExpireTime.
    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 Pay-as-You-Type Values Include: the Subscription of a Pre-Paid.
    privateEndPoint string
    The private endPoint.
    publicEndpoint string
    The public dndpoint.
    renewalDuration number
    Renewal duration.
    renewalDurationUnit string
    Auto-Renewal Cycle Unit Values Include: Month: Month. Year: Years.
    renewalStatus string
    Renew status.
    status string
    The status of the resource.
    supportEip boolean
    Whether to support eip.
    create_time str
    OrderCreateTime.
    expire_time str
    ExpireTime.
    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 Pay-as-You-Type Values Include: the Subscription of a Pre-Paid.
    private_end_point str
    The private endPoint.
    public_endpoint str
    The public dndpoint.
    renewal_duration int
    Renewal duration.
    renewal_duration_unit str
    Auto-Renewal Cycle Unit Values Include: Month: Month. Year: Years.
    renewal_status str
    Renew status.
    status str
    The status of the resource.
    support_eip bool
    Whether to support eip.
    createTime String
    OrderCreateTime.
    expireTime String
    ExpireTime.
    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 Pay-as-You-Type Values Include: the Subscription of a Pre-Paid.
    privateEndPoint String
    The private endPoint.
    publicEndpoint String
    The public dndpoint.
    renewalDuration Number
    Renewal duration.
    renewalDurationUnit String
    Auto-Renewal Cycle Unit Values Include: Month: Month. Year: Years.
    renewalStatus String
    Renew status.
    status String
    The status of the resource.
    supportEip Boolean
    Whether to support eip.

    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.66.0 published on Friday, Nov 15, 2024 by Pulumi