GetInstances

This data source provides a list of ALIKAFKA Instances in an Alibaba Cloud account according to the specified filters.

NOTE: Available in 1.59.0+

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var instanceName = config.Get("instanceName") ?? "alikafkaInstanceName";
        var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
        {
            AvailableResourceCreation = "VSwitch",
        }));
        var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new AliCloud.Vpc.NetworkArgs
        {
            CidrBlock = "172.16.0.0/12",
        });
        var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new AliCloud.Vpc.SwitchArgs
        {
            AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
            CidrBlock = "172.16.0.0/24",
            VpcId = defaultNetwork.Id,
        });
        var defaultInstance = new AliCloud.AliKafka.Instance("defaultInstance", new AliCloud.AliKafka.InstanceArgs
        {
            DeployType = 4,
            DiskSize = 500,
            DiskType = 1,
            IoMax = 20,
            TopicQuota = 50,
            VswitchId = defaultSwitch.Id,
        });
        var instancesDs = Output.Create(AliCloud.ActionTrail.GetInstances.InvokeAsync(new AliCloud.ActionTrail.GetInstancesArgs
        {
            NameRegex = "alikafkaInstanceName",
            OutputFile = "instances.txt",
        }));
        this.FirstInstanceName = instancesDs.Apply(instancesDs => instancesDs.Instances[0].Name);
    }

    [Output("firstInstanceName")]
    public Output<string> FirstInstanceName { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
instance_name = config.get("instanceName")
if instance_name is None:
    instance_name = "alikafkaInstanceName"
default_zones = alicloud.get_zones(available_resource_creation="VSwitch")
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/12")
default_switch = alicloud.vpc.Switch("defaultSwitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="172.16.0.0/24",
    vpc_id=default_network.id)
default_instance = alicloud.alikafka.Instance("defaultInstance",
    deploy_type="4",
    disk_size="500",
    disk_type="1",
    io_max="20",
    topic_quota="50",
    vswitch_id=default_switch.id)
instances_ds = alicloud.actiontrail.get_instances(name_regex="alikafkaInstanceName",
    output_file="instances.txt")
pulumi.export("firstInstanceName", instances_ds.instances[0]["name"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const instanceName = config.get("instanceName") || "alikafkaInstanceName";

const defaultZones = pulumi.output(alicloud.getZones({
    availableResourceCreation: "VSwitch",
}, { async: true }));
const defaultNetwork = new alicloud.vpc.Network("default", {
    cidrBlock: "172.16.0.0/12",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
    availabilityZone: defaultZones.zones[0].id,
    cidrBlock: "172.16.0.0/24",
    vpcId: defaultNetwork.id,
});
const defaultInstance = new alicloud.alikafka.Instance("default", {
    deployType: 4,
    diskSize: 500,
    diskType: 1,
    ioMax: 20,
    topicQuota: 50,
    vswitchId: defaultSwitch.id,
});
const instancesDs = pulumi.output(alicloud.actiontrail.getInstances({
    nameRegex: "alikafkaInstanceName",
    outputFile: "instances.txt",
}, { async: true }));

export const firstInstanceName = instancesDs.instances[0].name;

Using GetInstances

function getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
function  get_instances(ids=None, name_regex=None, output_file=None, opts=None)
func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
public static class GetInstances {
    public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Ids List<string>

A list of instance IDs to filter results.

NameRegex string

A regex string to filter results by the instance name.

OutputFile string
Ids []string

A list of instance IDs to filter results.

NameRegex string

A regex string to filter results by the instance name.

OutputFile string
ids string[]

A list of instance IDs to filter results.

nameRegex string

A regex string to filter results by the instance name.

outputFile string
ids List[str]

A list of instance IDs to filter results.

name_regex str

A regex string to filter results by the instance name.

output_file str

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 instance IDs.

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

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

Names List<string>

A list of instance names.

NameRegex string
OutputFile string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of instance IDs.

Instances []GetInstancesInstance

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

Names []string

A list of instance names.

NameRegex string
OutputFile string
id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of instance IDs.

instances GetInstancesInstance[]

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

names string[]

A list of instance names.

nameRegex string
outputFile string
id str

The provider-assigned unique ID for this managed resource.

ids List[str]

A list of instance IDs.

instances List[GetInstancesInstance]

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

names List[str]

A list of instance names.

name_regex str
output_file str

Supporting Types

GetInstancesInstance

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

CreateTime string

The create time of the instance.

DeployType int

The deploy type of the instance. 0: sharing instance, 1: vpc instance, 2: vpc instance(support ip mapping), 3: eip instance, 4: eip/vpc instance, 5: vpc instance.

DiskSize int

The disk size of the instance.

DiskType int

The disk type of the instance. 0: efficient cloud disk , 1: SSD.

EipMax int

The peak bandwidth of the instance.

Id string

ID of the instance.

IoMax int

The peak value of io of the instance.

Name string

Name of the instance.

PaidType string

The paid type of the instance.

ServiceStatus int

The current status of the instance. -1: unknown status, 0: wait deploy, 1: initializing, 2: preparing, 3 starting, 5: in service, 7: wait upgrade, 8: upgrading, 10: released, 15: freeze, 101: deploy error, 102: upgrade error.

SpecType string

The spec type of the instance.

TopicQuota int

The max num of topic can be create of the instance.

VpcId string

The ID of attaching VPC to instance.

VswitchId string

The ID of attaching vswitch to instance.

ZoneId string

The ID of attaching zone to instance.

CreateTime string

The create time of the instance.

DeployType int

The deploy type of the instance. 0: sharing instance, 1: vpc instance, 2: vpc instance(support ip mapping), 3: eip instance, 4: eip/vpc instance, 5: vpc instance.

DiskSize int

The disk size of the instance.

DiskType int

The disk type of the instance. 0: efficient cloud disk , 1: SSD.

EipMax int

The peak bandwidth of the instance.

Id string

ID of the instance.

IoMax int

The peak value of io of the instance.

Name string

Name of the instance.

PaidType string

The paid type of the instance.

ServiceStatus int

The current status of the instance. -1: unknown status, 0: wait deploy, 1: initializing, 2: preparing, 3 starting, 5: in service, 7: wait upgrade, 8: upgrading, 10: released, 15: freeze, 101: deploy error, 102: upgrade error.

SpecType string

The spec type of the instance.

TopicQuota int

The max num of topic can be create of the instance.

VpcId string

The ID of attaching VPC to instance.

VswitchId string

The ID of attaching vswitch to instance.

ZoneId string

The ID of attaching zone to instance.

createTime string

The create time of the instance.

deployType number

The deploy type of the instance. 0: sharing instance, 1: vpc instance, 2: vpc instance(support ip mapping), 3: eip instance, 4: eip/vpc instance, 5: vpc instance.

diskSize number

The disk size of the instance.

diskType number

The disk type of the instance. 0: efficient cloud disk , 1: SSD.

eipMax number

The peak bandwidth of the instance.

id string

ID of the instance.

ioMax number

The peak value of io of the instance.

name string

Name of the instance.

paidType string

The paid type of the instance.

serviceStatus number

The current status of the instance. -1: unknown status, 0: wait deploy, 1: initializing, 2: preparing, 3 starting, 5: in service, 7: wait upgrade, 8: upgrading, 10: released, 15: freeze, 101: deploy error, 102: upgrade error.

specType string

The spec type of the instance.

topicQuota number

The max num of topic can be create of the instance.

vpcId string

The ID of attaching VPC to instance.

vswitchId string

The ID of attaching vswitch to instance.

zoneId string

The ID of attaching zone to instance.

create_time str

The create time of the instance.

deploy_type float

The deploy type of the instance. 0: sharing instance, 1: vpc instance, 2: vpc instance(support ip mapping), 3: eip instance, 4: eip/vpc instance, 5: vpc instance.

disk_size float

The disk size of the instance.

disk_type float

The disk type of the instance. 0: efficient cloud disk , 1: SSD.

eip_max float

The peak bandwidth of the instance.

id str

ID of the instance.

io_max float

The peak value of io of the instance.

name str

Name of the instance.

str

The paid type of the instance.

serviceStatus float

The current status of the instance. -1: unknown status, 0: wait deploy, 1: initializing, 2: preparing, 3 starting, 5: in service, 7: wait upgrade, 8: upgrading, 10: released, 15: freeze, 101: deploy error, 102: upgrade error.

spec_type str

The spec type of the instance.

topic_quota float

The max num of topic can be create of the instance.

vpc_id str

The ID of attaching VPC to instance.

vswitch_id str

The ID of attaching vswitch to instance.

zone_id str

The ID of attaching zone to instance.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.