Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.19.0 published on Friday, Mar 18, 2022 by Pulumi

getInstances

This data source provides CEN instances available to the user.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var cenInstancesDs = Output.Create(AliCloud.Cen.GetInstances.InvokeAsync(new AliCloud.Cen.GetInstancesArgs
        {
            Ids = 
            {
                "cen-id1",
            },
            NameRegex = "^foo",
        }));
        this.FirstCenInstanceId = cenInstancesDs.Apply(cenInstancesDs => cenInstancesDs.Instances?[0]?.Id);
    }

    [Output("firstCenInstanceId")]
    public Output<string> FirstCenInstanceId { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cenInstancesDs, err := cen.GetInstances(ctx, &cen.GetInstancesArgs{
			Ids: []string{
				"cen-id1",
			},
			NameRegex: pulumi.StringRef("^foo"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstCenInstanceId", cenInstancesDs.Instances[0].Id)
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

cen_instances_ds = alicloud.cen.get_instances(ids=["cen-id1"],
    name_regex="^foo")
pulumi.export("firstCenInstanceId", cen_instances_ds.instances[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const cenInstancesDs = alicloud.cen.getInstances({
    ids: ["cen-id1"],
    nameRegex: "^foo",
});
export const firstCenInstanceId = cenInstancesDs.then(cenInstancesDs => cenInstancesDs.instances?[0]?.id);

Coming soon!

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(ids: Optional[Sequence[str]] = None,
                  name_regex: Optional[str] = None,
                  output_file: Optional[str] = None,
                  status: Optional[str] = None,
                  tags: Optional[Mapping[str, Any]] = None,
                  opts: Optional[InvokeOptions] = None) -> GetInstancesResult
def get_instances_output(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,
                  tags: Optional[pulumi.Input[Mapping[str, Any]]] = 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:cen/getInstances:getInstances
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Ids List<string>

A list of CEN instances IDs.

NameRegex string

A regex string to filter CEN instances by name.

OutputFile string
Status string

The status of CEN instance. Valid value: Active, Creating and Deleting.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

Ids []string

A list of CEN instances IDs.

NameRegex string

A regex string to filter CEN instances by name.

OutputFile string
Status string

The status of CEN instance. Valid value: Active, Creating and Deleting.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

ids List

A list of CEN instances IDs.

nameRegex String

A regex string to filter CEN instances by name.

outputFile String
status String

The status of CEN instance. Valid value: Active, Creating and Deleting.

tags Map

A mapping of tags to assign to the resource.

ids string[]

A list of CEN instances IDs.

nameRegex string

A regex string to filter CEN instances by name.

outputFile string
status string

The status of CEN instance. Valid value: Active, Creating and Deleting.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

ids Sequence[str]

A list of CEN instances IDs.

name_regex str

A regex string to filter CEN instances by name.

output_file str
status str

The status of CEN instance. Valid value: Active, Creating and Deleting.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

ids List

A list of CEN instances IDs.

nameRegex String

A regex string to filter CEN instances by name.

outputFile String
status String

The status of CEN instance. Valid value: Active, Creating and Deleting.

tags Map

A mapping of tags to assign to the resource.

getInstances Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of CEN instances IDs.

Instances List<Pulumi.AliCloud.Cen.Outputs.GetInstancesInstance>

A list of CEN instances. Each element contains the following attributes:

Names List<string>

A list of CEN instances names.

NameRegex string
OutputFile string
Status string

Status of the CEN instance, including "Creating", "Active" and "Deleting".

Tags Dictionary<string, object>

A map of tags assigned to the Cen Instance.

Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of CEN instances IDs.

Instances []GetInstancesInstance

A list of CEN instances. Each element contains the following attributes:

Names []string

A list of CEN instances names.

NameRegex string
OutputFile string
Status string

Status of the CEN instance, including "Creating", "Active" and "Deleting".

Tags map[string]interface{}

A map of tags assigned to the Cen Instance.

id String

The provider-assigned unique ID for this managed resource.

ids List

A list of CEN instances IDs.

instances ListInstancesInstance>

A list of CEN instances. Each element contains the following attributes:

names List

A list of CEN instances names.

nameRegex String
outputFile String
status String

Status of the CEN instance, including "Creating", "Active" and "Deleting".

tags Map

A map of tags assigned to the Cen Instance.

id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of CEN instances IDs.

instances GetInstancesInstance[]

A list of CEN instances. Each element contains the following attributes:

names string[]

A list of CEN instances names.

nameRegex string
outputFile string
status string

Status of the CEN instance, including "Creating", "Active" and "Deleting".

tags {[key: string]: any}

A map of tags assigned to the Cen Instance.

id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

A list of CEN instances IDs.

instances Sequence[GetInstancesInstance]

A list of CEN instances. Each element contains the following attributes:

names Sequence[str]

A list of CEN instances names.

name_regex str
output_file str
status str

Status of the CEN instance, including "Creating", "Active" and "Deleting".

tags Mapping[str, Any]

A map of tags assigned to the Cen Instance.

id String

The provider-assigned unique ID for this managed resource.

ids List

A list of CEN instances IDs.

instances List

A list of CEN instances. Each element contains the following attributes:

names List

A list of CEN instances names.

nameRegex String
outputFile String
status String

Status of the CEN instance, including "Creating", "Active" and "Deleting".

tags Map

A map of tags assigned to the Cen Instance.

Supporting Types

GetInstancesInstance

CenBandwidthPackageIds List<string>

List of CEN Bandwidth Package IDs in the specified CEN instance.

CenId string

ID of the CEN instance.

CenInstanceName string

Name of the CEN instance.

CreateTime string

The creation time of the CEN Instance.

Description string

Description of the CEN instance.

Id string

ID of the CEN instance.

Name string

Name of the CEN instance.

ProtectionLevel string

Indicates the allowed level of CIDR block overlapping.

Status string

The status of CEN instance. Valid value: Active, Creating and Deleting.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

CenBandwidthPackageIds []string

List of CEN Bandwidth Package IDs in the specified CEN instance.

CenId string

ID of the CEN instance.

CenInstanceName string

Name of the CEN instance.

CreateTime string

The creation time of the CEN Instance.

Description string

Description of the CEN instance.

Id string

ID of the CEN instance.

Name string

Name of the CEN instance.

ProtectionLevel string

Indicates the allowed level of CIDR block overlapping.

Status string

The status of CEN instance. Valid value: Active, Creating and Deleting.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

cenBandwidthPackageIds List

List of CEN Bandwidth Package IDs in the specified CEN instance.

cenId String

ID of the CEN instance.

cenInstanceName String

Name of the CEN instance.

createTime String

The creation time of the CEN Instance.

description String

Description of the CEN instance.

id String

ID of the CEN instance.

name String

Name of the CEN instance.

protectionLevel String

Indicates the allowed level of CIDR block overlapping.

status String

The status of CEN instance. Valid value: Active, Creating and Deleting.

tags Map

A mapping of tags to assign to the resource.

cenBandwidthPackageIds string[]

List of CEN Bandwidth Package IDs in the specified CEN instance.

cenId string

ID of the CEN instance.

cenInstanceName string

Name of the CEN instance.

createTime string

The creation time of the CEN Instance.

description string

Description of the CEN instance.

id string

ID of the CEN instance.

name string

Name of the CEN instance.

protectionLevel string

Indicates the allowed level of CIDR block overlapping.

status string

The status of CEN instance. Valid value: Active, Creating and Deleting.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

cen_bandwidth_package_ids Sequence[str]

List of CEN Bandwidth Package IDs in the specified CEN instance.

cen_id str

ID of the CEN instance.

cen_instance_name str

Name of the CEN instance.

create_time str

The creation time of the CEN Instance.

description str

Description of the CEN instance.

id str

ID of the CEN instance.

name str

Name of the CEN instance.

protection_level str

Indicates the allowed level of CIDR block overlapping.

status str

The status of CEN instance. Valid value: Active, Creating and Deleting.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

cenBandwidthPackageIds List

List of CEN Bandwidth Package IDs in the specified CEN instance.

cenId String

ID of the CEN instance.

cenInstanceName String

Name of the CEN instance.

createTime String

The creation time of the CEN Instance.

description String

Description of the CEN instance.

id String

ID of the CEN instance.

name String

Name of the CEN instance.

protectionLevel String

Indicates the allowed level of CIDR block overlapping.

status String

The status of CEN instance. Valid value: Active, Creating and Deleting.

tags Map

A mapping of tags to assign to the resource.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.