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.
- Name
Regex string A regex string to filter results by the instance name.
- Output
File 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.
Ali Cloud. Action Trail. Outputs. Get Instances Instance> A list of instances. Each element contains the following attributes:
- Names List<string>
A list of instance names.
- Name
Regex string - Output
File string
- id str
The provider-assigned unique ID for this managed resource.
- ids List[str]
A list of instance IDs.
- instances
List[Get
Instances Instance] 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.
- Create
Time string The create time of the instance.
- Deploy
Type 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.
- Disk
Size int The disk size of the instance.
- Disk
Type int The disk type of the instance. 0: efficient cloud disk , 1: SSD.
- Eip
Max int The peak bandwidth of the instance.
- Id string
ID of the instance.
- Io
Max int The peak value of io of the instance.
- Name string
Name of the instance.
- Paid
Type string The paid type of the instance.
- Service
Status 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.
- Spec
Type string The spec type of the instance.
- Topic
Quota int The max num of topic can be create of the instance.
- Vpc
Id string The ID of attaching VPC to instance.
- Vswitch
Id string The ID of attaching vswitch to instance.
- Zone
Id string The ID of attaching zone to instance.
- Create
Time string The create time of the instance.
- Deploy
Type 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.
- Disk
Size int The disk size of the instance.
- Disk
Type int The disk type of the instance. 0: efficient cloud disk , 1: SSD.
- Eip
Max int The peak bandwidth of the instance.
- Id string
ID of the instance.
- Io
Max int The peak value of io of the instance.
- Name string
Name of the instance.
- Paid
Type string The paid type of the instance.
- Service
Status 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.
- Spec
Type string The spec type of the instance.
- Topic
Quota int The max num of topic can be create of the instance.
- Vpc
Id string The ID of attaching VPC to instance.
- Vswitch
Id string The ID of attaching vswitch to instance.
- Zone
Id string The ID of attaching zone to instance.
- create
Time string The create time of the instance.
- deploy
Type 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.
- disk
Size number The disk size of the instance.
- disk
Type number The disk type of the instance. 0: efficient cloud disk , 1: SSD.
- eip
Max number The peak bandwidth of the instance.
- id string
ID of the instance.
- io
Max number The peak value of io of the instance.
- name string
Name of the instance.
- paid
Type string The paid type of the instance.
- service
Status 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.
- spec
Type string The spec type of the instance.
- topic
Quota number The max num of topic can be create of the instance.
- vpc
Id string The ID of attaching VPC to instance.
- vswitch
Id string The ID of attaching vswitch to instance.
- zone
Id 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.
- paid_
type str The paid type of the instance.
- service
Status 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
alicloudTerraform Provider.