Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.cen.getInstances
Explore with Pulumi AI
This data source provides CEN instances available to the user.
Example Usage
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);
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)
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
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() => 
{
    var cenInstancesDs = AliCloud.Cen.GetInstances.Invoke(new()
    {
        Ids = new[]
        {
            "cen-id1",
        },
        NameRegex = "^foo",
    });
    return new Dictionary<string, object?>
    {
        ["firstCenInstanceId"] = cenInstancesDs.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.cen.CenFunctions;
import com.pulumi.alicloud.cen.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 cenInstancesDs = CenFunctions.getInstances(GetInstancesArgs.builder()
            .ids("cen-id1")
            .nameRegex("^foo")
            .build());
        ctx.export("firstCenInstanceId", cenInstancesDs.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()));
    }
}
variables:
  cenInstancesDs:
    fn::invoke:
      Function: alicloud:cen:getInstances
      Arguments:
        ids:
          - cen-id1
        nameRegex: ^foo
outputs:
  firstCenInstanceId: ${cenInstancesDs.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(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 dictionaryThe following arguments are supported:
- Ids List<string>
 - A list of CEN instances IDs.
 - Name
Regex string - A regex string to filter CEN instances by name.
 - Output
File string - File name where to save data source results (after running 
pulumi preview). - Status string
 - The status of CEN instance. Valid value: 
Active,CreatingandDeleting. - Dictionary<string, object>
 - A mapping of tags to assign to the resource.
 
- Ids []string
 - A list of CEN instances IDs.
 - Name
Regex string - A regex string to filter CEN instances by name.
 - Output
File string - File name where to save data source results (after running 
pulumi preview). - Status string
 - The status of CEN instance. Valid value: 
Active,CreatingandDeleting. - map[string]interface{}
 - A mapping of tags to assign to the resource.
 
- ids List<String>
 - A list of CEN instances IDs.
 - name
Regex String - A regex string to filter CEN instances by name.
 - output
File String - File name where to save data source results (after running 
pulumi preview). - status String
 - The status of CEN instance. Valid value: 
Active,CreatingandDeleting. - Map<String,Object>
 - A mapping of tags to assign to the resource.
 
- ids string[]
 - A list of CEN instances IDs.
 - name
Regex string - A regex string to filter CEN instances by name.
 - output
File string - File name where to save data source results (after running 
pulumi preview). - status string
 - The status of CEN instance. Valid value: 
Active,CreatingandDeleting. - {[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 - File name where to save data source results (after running 
pulumi preview). - status str
 - The status of CEN instance. Valid value: 
Active,CreatingandDeleting. - Mapping[str, Any]
 - A mapping of tags to assign to the resource.
 
- ids List<String>
 - A list of CEN instances IDs.
 - name
Regex String - A regex string to filter CEN instances by name.
 - output
File String - File name where to save data source results (after running 
pulumi preview). - status String
 - The status of CEN instance. Valid value: 
Active,CreatingandDeleting. - Map<Any>
 - 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.
Ali Cloud. Cen. Outputs. Get Instances Instance>  - A list of CEN instances. Each element contains the following attributes:
 - Names List<string>
 - A list of CEN instances names.
 - Name
Regex string - Output
File string - Status string
 - Status of the CEN instance, including "Creating", "Active" and "Deleting".
 - 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
[]Get
Instances Instance  - A list of CEN instances. Each element contains the following attributes:
 - Names []string
 - A list of CEN instances names.
 - Name
Regex string - Output
File string - Status string
 - Status of the CEN instance, including "Creating", "Active" and "Deleting".
 - 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<String>
 - A list of CEN instances IDs.
 - instances
List<Get
Instances Instance>  - A list of CEN instances. Each element contains the following attributes:
 - names List<String>
 - A list of CEN instances names.
 - name
Regex String - output
File String - status String
 - Status of the CEN instance, including "Creating", "Active" and "Deleting".
 - Map<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
Get
Instances Instance[]  - A list of CEN instances. Each element contains the following attributes:
 - names string[]
 - A list of CEN instances names.
 - name
Regex string - output
File string - status string
 - Status of the CEN instance, including "Creating", "Active" and "Deleting".
 - {[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[Get
Instances Instance]  - 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".
 - 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<String>
 - A list of CEN instances IDs.
 - instances List<Property Map>
 - A list of CEN instances. Each element contains the following attributes:
 - names List<String>
 - A list of CEN instances names.
 - name
Regex String - output
File String - status String
 - Status of the CEN instance, including "Creating", "Active" and "Deleting".
 - Map<Any>
 - A map of tags assigned to the Cen Instance.
 
Supporting Types
GetInstancesInstance  
- Cen
Bandwidth List<string>Package Ids  - List of CEN Bandwidth Package IDs in the specified CEN instance.
 - Cen
Id string - ID of the CEN instance.
 - Cen
Instance stringName  - Name of the CEN instance.
 - Create
Time 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.
 - Protection
Level string - Indicates the allowed level of CIDR block overlapping.
 - Status string
 - The status of CEN instance. Valid value: 
Active,CreatingandDeleting. - Dictionary<string, object>
 - A mapping of tags to assign to the resource.
 
- Cen
Bandwidth []stringPackage Ids  - List of CEN Bandwidth Package IDs in the specified CEN instance.
 - Cen
Id string - ID of the CEN instance.
 - Cen
Instance stringName  - Name of the CEN instance.
 - Create
Time 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.
 - Protection
Level string - Indicates the allowed level of CIDR block overlapping.
 - Status string
 - The status of CEN instance. Valid value: 
Active,CreatingandDeleting. - map[string]interface{}
 - A mapping of tags to assign to the resource.
 
- cen
Bandwidth List<String>Package Ids  - List of CEN Bandwidth Package IDs in the specified CEN instance.
 - cen
Id String - ID of the CEN instance.
 - cen
Instance StringName  - Name of the CEN instance.
 - create
Time 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.
 - protection
Level String - Indicates the allowed level of CIDR block overlapping.
 - status String
 - The status of CEN instance. Valid value: 
Active,CreatingandDeleting. - Map<String,Object>
 - A mapping of tags to assign to the resource.
 
- cen
Bandwidth string[]Package Ids  - List of CEN Bandwidth Package IDs in the specified CEN instance.
 - cen
Id string - ID of the CEN instance.
 - cen
Instance stringName  - Name of the CEN instance.
 - create
Time 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.
 - protection
Level string - Indicates the allowed level of CIDR block overlapping.
 - status string
 - The status of CEN instance. Valid value: 
Active,CreatingandDeleting. - {[key: string]: any}
 - A mapping of tags to assign to the resource.
 
- cen_
bandwidth_ Sequence[str]package_ ids  - List of CEN Bandwidth Package IDs in the specified CEN instance.
 - cen_
id str - ID of the CEN instance.
 - cen_
instance_ strname  - 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,CreatingandDeleting. - Mapping[str, Any]
 - A mapping of tags to assign to the resource.
 
- cen
Bandwidth List<String>Package Ids  - List of CEN Bandwidth Package IDs in the specified CEN instance.
 - cen
Id String - ID of the CEN instance.
 - cen
Instance StringName  - Name of the CEN instance.
 - create
Time 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.
 - protection
Level String - Indicates the allowed level of CIDR block overlapping.
 - status String
 - The status of CEN instance. Valid value: 
Active,CreatingandDeleting. - Map<Any>
 - A mapping of tags to assign to the resource.
 
Package Details
- Repository
 - Alibaba Cloud pulumi/pulumi-alicloud
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
alicloudTerraform Provider.