Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.amqp.getInstances
Explore with Pulumi AI
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 dictionaryThe following arguments are supported:
- Enable
Details bool - Default to 
false. Set it totruecan output more details about resource attributes. - Ids List<string>
 - A list of Instance IDs.
 - Name
Regex string - A regex string to filter results by Instance name.
 - Output
File 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 totruecan output more details about resource attributes. - Ids []string
 - A list of Instance IDs.
 - Name
Regex string - A regex string to filter results by Instance name.
 - Output
File 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 Boolean - Default to 
false. Set it totruecan output more details about resource attributes. - ids List<String>
 - A list of Instance IDs.
 - name
Regex String - A regex string to filter results by Instance name.
 - output
File 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 boolean - Default to 
false. Set it totruecan output more details about resource attributes. - ids string[]
 - A list of Instance IDs.
 - name
Regex string - A regex string to filter results by Instance name.
 - output
File 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 totruecan 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".
 
- enable
Details Boolean - Default to 
false. Set it totruecan output more details about resource attributes. - ids List<String>
 - A list of Instance IDs.
 - name
Regex String - A regex string to filter results by Instance name.
 - output
File 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.
Ali Cloud. Amqp. Outputs. Get Instances Instance>  - Names List<string>
 - Enable
Details bool - Name
Regex string - Output
File string - Status string
 
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Ids []string
 - Instances
[]Get
Instances Instance  - Names []string
 - Enable
Details bool - Name
Regex string - Output
File string - Status string
 
- id String
 - The provider-assigned unique ID for this managed resource.
 - ids List<String>
 - instances
List<Get
Instances Instance>  - names List<String>
 - enable
Details Boolean - name
Regex String - output
File String - status String
 
- id string
 - The provider-assigned unique ID for this managed resource.
 - ids string[]
 - instances
Get
Instances Instance[]  - names string[]
 - enable
Details boolean - name
Regex string - output
File string - status string
 
- id str
 - The provider-assigned unique ID for this managed resource.
 - ids Sequence[str]
 - instances
Sequence[Get
Instances Instance]  - 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>
 - enable
Details Boolean - name
Regex String - output
File String - status String
 
Supporting Types
GetInstancesInstance  
- Create
Time string - OrderCreateTime.
 - Expire
Time string - ExpireTime.
 - Id string
 - The ID of the Instance.
 - Instance
Id string - THe instance Id.
 - Instance
Name string - THe instance name.
 - Instance
Type string - The instance type.
 - Payment
Type string - The Pay-as-You-Type Values Include: the Subscription of a Pre-Paid.
 - Private
End stringPoint  - The private endPoint.
 - Public
Endpoint string - The public dndpoint.
 - Renewal
Duration int - Renewal duration.
 - Renewal
Duration stringUnit  - Auto-Renewal Cycle Unit Values Include: Month: Month. Year: Years.
 - Renewal
Status string - Renew status.
 - Status string
 - The status of the resource.
 - Support
Eip bool - Whether to support eip.
 
- Create
Time string - OrderCreateTime.
 - Expire
Time string - ExpireTime.
 - Id string
 - The ID of the Instance.
 - Instance
Id string - THe instance Id.
 - Instance
Name string - THe instance name.
 - Instance
Type string - The instance type.
 - Payment
Type string - The Pay-as-You-Type Values Include: the Subscription of a Pre-Paid.
 - Private
End stringPoint  - The private endPoint.
 - Public
Endpoint string - The public dndpoint.
 - Renewal
Duration int - Renewal duration.
 - Renewal
Duration stringUnit  - Auto-Renewal Cycle Unit Values Include: Month: Month. Year: Years.
 - Renewal
Status string - Renew status.
 - Status string
 - The status of the resource.
 - Support
Eip bool - Whether to support eip.
 
- create
Time String - OrderCreateTime.
 - expire
Time String - ExpireTime.
 - id String
 - The ID of the Instance.
 - instance
Id String - THe instance Id.
 - instance
Name String - THe instance name.
 - instance
Type String - The instance type.
 - payment
Type String - The Pay-as-You-Type Values Include: the Subscription of a Pre-Paid.
 - private
End StringPoint  - The private endPoint.
 - public
Endpoint String - The public dndpoint.
 - renewal
Duration Integer - Renewal duration.
 - renewal
Duration StringUnit  - Auto-Renewal Cycle Unit Values Include: Month: Month. Year: Years.
 - renewal
Status String - Renew status.
 - status String
 - The status of the resource.
 - support
Eip Boolean - Whether to support eip.
 
- create
Time string - OrderCreateTime.
 - expire
Time string - ExpireTime.
 - id string
 - The ID of the Instance.
 - instance
Id string - THe instance Id.
 - instance
Name string - THe instance name.
 - instance
Type string - The instance type.
 - payment
Type string - The Pay-as-You-Type Values Include: the Subscription of a Pre-Paid.
 - private
End stringPoint  - The private endPoint.
 - public
Endpoint string - The public dndpoint.
 - renewal
Duration number - Renewal duration.
 - renewal
Duration stringUnit  - Auto-Renewal Cycle Unit Values Include: Month: Month. Year: Years.
 - renewal
Status string - Renew status.
 - status string
 - The status of the resource.
 - support
Eip 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_ strpoint  - The private endPoint.
 - public_
endpoint str - The public dndpoint.
 - renewal_
duration int - Renewal duration.
 - renewal_
duration_ strunit  - 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.
 
- create
Time String - OrderCreateTime.
 - expire
Time String - ExpireTime.
 - id String
 - The ID of the Instance.
 - instance
Id String - THe instance Id.
 - instance
Name String - THe instance name.
 - instance
Type String - The instance type.
 - payment
Type String - The Pay-as-You-Type Values Include: the Subscription of a Pre-Paid.
 - private
End StringPoint  - The private endPoint.
 - public
Endpoint String - The public dndpoint.
 - renewal
Duration Number - Renewal duration.
 - renewal
Duration StringUnit  - Auto-Renewal Cycle Unit Values Include: Month: Month. Year: Years.
 - renewal
Status String - Renew status.
 - status String
 - The status of the resource.
 - support
Eip 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 
alicloudTerraform Provider.