Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 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, str]] = 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, 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:cen/getInstances:getInstances
arguments:
# arguments dictionary
The following arguments are supported:
- Ids
Changes to this property will trigger replacement.
- A list of CEN instances IDs.
- Name
Regex Changes to this property will trigger replacement.
- 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
Changes to this property will trigger replacement.
- The status of CEN instance. Valid value:
Active
,Creating
andDeleting
. - Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Ids
Changes to this property will trigger replacement.
- A list of CEN instances IDs.
- Name
Regex Changes to this property will trigger replacement.
- 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
Changes to this property will trigger replacement.
- The status of CEN instance. Valid value:
Active
,Creating
andDeleting
. - map[string]string
- A mapping of tags to assign to the resource.
- ids
Changes to this property will trigger replacement.
- A list of CEN instances IDs.
- name
Regex Changes to this property will trigger replacement.
- 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
Changes to this property will trigger replacement.
- The status of CEN instance. Valid value:
Active
,Creating
andDeleting
. - Map<String,String>
- A mapping of tags to assign to the resource.
- ids
Changes to this property will trigger replacement.
- A list of CEN instances IDs.
- name
Regex Changes to this property will trigger replacement.
- 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
Changes to this property will trigger replacement.
- The status of CEN instance. Valid value:
Active
,Creating
andDeleting
. - {[key: string]: string}
- A mapping of tags to assign to the resource.
- ids
Changes to this property will trigger replacement.
- A list of CEN instances IDs.
- name_
regex Changes to this property will trigger replacement.
- 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
Changes to this property will trigger replacement.
- The status of CEN instance. Valid value:
Active
,Creating
andDeleting
. - Mapping[str, str]
- A mapping of tags to assign to the resource.
- ids
Changes to this property will trigger replacement.
- A list of CEN instances IDs.
- name
Regex Changes to this property will trigger replacement.
- 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
Changes to this property will trigger replacement.
- The status of CEN instance. Valid value:
Active
,Creating
andDeleting
. - Map<String>
- 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, string>
- 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]string
- 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,String>
- 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]: string}
- 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, str]
- 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<String>
- A map of tags assigned to the Cen Instance.
Supporting Types
GetInstancesInstance
- Cen
Bandwidth Package Ids This property is required. List<string> - List of CEN Bandwidth Package IDs in the specified CEN instance.
- Cen
Id This property is required. string - ID of the CEN instance.
- Cen
Instance Name This property is required. string - Name of the CEN instance.
- Create
Time This property is required. string - The creation time of the CEN Instance.
- Description
This property is required. string - Description of the CEN instance.
- Id
This property is required. string - ID of the CEN instance.
- Name
This property is required. string - Name of the CEN instance.
- Protection
Level This property is required. string - Indicates the allowed level of CIDR block overlapping.
- Status
This property is required. string - The status of CEN instance. Valid value:
Active
,Creating
andDeleting
. This property is required. Dictionary<string, string>- A mapping of tags to assign to the resource.
- Cen
Bandwidth Package Ids This property is required. []string - List of CEN Bandwidth Package IDs in the specified CEN instance.
- Cen
Id This property is required. string - ID of the CEN instance.
- Cen
Instance Name This property is required. string - Name of the CEN instance.
- Create
Time This property is required. string - The creation time of the CEN Instance.
- Description
This property is required. string - Description of the CEN instance.
- Id
This property is required. string - ID of the CEN instance.
- Name
This property is required. string - Name of the CEN instance.
- Protection
Level This property is required. string - Indicates the allowed level of CIDR block overlapping.
- Status
This property is required. string - The status of CEN instance. Valid value:
Active
,Creating
andDeleting
. This property is required. map[string]string- A mapping of tags to assign to the resource.
- cen
Bandwidth Package Ids This property is required. List<String> - List of CEN Bandwidth Package IDs in the specified CEN instance.
- cen
Id This property is required. String - ID of the CEN instance.
- cen
Instance Name This property is required. String - Name of the CEN instance.
- create
Time This property is required. String - The creation time of the CEN Instance.
- description
This property is required. String - Description of the CEN instance.
- id
This property is required. String - ID of the CEN instance.
- name
This property is required. String - Name of the CEN instance.
- protection
Level This property is required. String - Indicates the allowed level of CIDR block overlapping.
- status
This property is required. String - The status of CEN instance. Valid value:
Active
,Creating
andDeleting
. This property is required. Map<String,String>- A mapping of tags to assign to the resource.
- cen
Bandwidth Package Ids This property is required. string[] - List of CEN Bandwidth Package IDs in the specified CEN instance.
- cen
Id This property is required. string - ID of the CEN instance.
- cen
Instance Name This property is required. string - Name of the CEN instance.
- create
Time This property is required. string - The creation time of the CEN Instance.
- description
This property is required. string - Description of the CEN instance.
- id
This property is required. string - ID of the CEN instance.
- name
This property is required. string - Name of the CEN instance.
- protection
Level This property is required. string - Indicates the allowed level of CIDR block overlapping.
- status
This property is required. string - The status of CEN instance. Valid value:
Active
,Creating
andDeleting
. This property is required. {[key: string]: string}- A mapping of tags to assign to the resource.
- cen_
bandwidth_ package_ ids This property is required. Sequence[str] - List of CEN Bandwidth Package IDs in the specified CEN instance.
- cen_
id This property is required. str - ID of the CEN instance.
- cen_
instance_ name This property is required. str - Name of the CEN instance.
- create_
time This property is required. str - The creation time of the CEN Instance.
- description
This property is required. str - Description of the CEN instance.
- id
This property is required. str - ID of the CEN instance.
- name
This property is required. str - Name of the CEN instance.
- protection_
level This property is required. str - Indicates the allowed level of CIDR block overlapping.
- status
This property is required. str - The status of CEN instance. Valid value:
Active
,Creating
andDeleting
. This property is required. Mapping[str, str]- A mapping of tags to assign to the resource.
- cen
Bandwidth Package Ids This property is required. List<String> - List of CEN Bandwidth Package IDs in the specified CEN instance.
- cen
Id This property is required. String - ID of the CEN instance.
- cen
Instance Name This property is required. String - Name of the CEN instance.
- create
Time This property is required. String - The creation time of the CEN Instance.
- description
This property is required. String - Description of the CEN instance.
- id
This property is required. String - ID of the CEN instance.
- name
This property is required. String - Name of the CEN instance.
- protection
Level This property is required. String - Indicates the allowed level of CIDR block overlapping.
- status
This property is required. String - The status of CEN instance. Valid value:
Active
,Creating
andDeleting
. This property is required. Map<String>- 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
alicloud
Terraform Provider.