Volcengine v0.0.38 published on Friday, Oct 31, 2025 by Volcengine
Volcengine v0.0.38 published on Friday, Oct 31, 2025 by Volcengine
Use this data source to query detailed information of vke nodes
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@pulumi/volcengine";
import * as volcengine from "@volcengine/pulumi";
const fooZones = volcengine.ecs.getZones({});
const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
vpcName: "acc-test-vpc",
cidrBlock: "172.16.0.0/16",
});
const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
subnetName: "acc-test-subnet",
cidrBlock: "172.16.0.0/24",
zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
vpcId: fooVpc.id,
});
const fooSecurityGroup = new volcengine.vpc.SecurityGroup("fooSecurityGroup", {
securityGroupName: "acc-test-security-group",
vpcId: fooVpc.id,
});
const fooImages = volcengine.ecs.getImages({
nameRegex: "veLinux 1.0 CentOS兼容版 64位",
});
const fooCluster = new volcengine.vke.Cluster("fooCluster", {
description: "created by terraform",
deleteProtectionEnabled: false,
clusterConfig: {
subnetIds: [fooSubnet.id],
apiServerPublicAccessEnabled: true,
apiServerPublicAccessConfig: {
publicAccessNetworkConfig: {
billingType: "PostPaidByBandwidth",
bandwidth: 1,
},
},
resourcePublicAccessDefaultEnabled: true,
},
podsConfig: {
podNetworkMode: "VpcCniShared",
vpcCniConfig: {
subnetIds: [fooSubnet.id],
},
},
servicesConfig: {
serviceCidrsv4s: ["172.30.0.0/18"],
},
tags: [{
key: "tf-k1",
value: "tf-v1",
}],
});
const fooNodePool = new volcengine.vke.NodePool("fooNodePool", {
clusterId: fooCluster.id,
autoScaling: {
enabled: false,
},
nodeConfig: {
instanceTypeIds: ["ecs.g1ie.xlarge"],
subnetIds: [fooSubnet.id],
imageId: fooImages.then(fooImages => .filter(image => image.imageName == "veLinux 1.0 CentOS兼容版 64位").map(image => (image.imageId))[0]),
systemVolume: {
type: "ESSD_PL0",
size: 50,
},
dataVolumes: [{
type: "ESSD_PL0",
size: 50,
mountPoint: "/tf",
}],
initializeScript: "ZWNobyBoZWxsbyB0ZXJyYWZvcm0h",
security: {
login: {
password: "UHdkMTIzNDU2",
},
securityStrategies: ["Hids"],
securityGroupIds: [fooSecurityGroup.id],
},
additionalContainerStorageEnabled: true,
instanceChargeType: "PostPaid",
namePrefix: "acc-test",
ecsTags: [{
key: "ecs_k1",
value: "ecs_v1",
}],
},
kubernetesConfig: {
labels: [{
key: "label1",
value: "value1",
}],
taints: [{
key: "taint-key/node-type",
value: "taint-value",
effect: "NoSchedule",
}],
cordon: true,
},
tags: [{
key: "node-pool-k1",
value: "node-pool-v1",
}],
});
const fooInstance: volcengine.ecs.Instance[] = [];
for (const range = {value: 0}; range.value < 2; range.value++) {
fooInstance.push(new volcengine.ecs.Instance(`fooInstance-${range.value}`, {
instanceName: `acc-test-ecs-${range.value}`,
hostName: "tf-acc-test",
imageId: fooImages.then(fooImages => .filter(image => image.imageName == "veLinux 1.0 CentOS兼容版 64位").map(image => (image.imageId))[0]),
instanceType: "ecs.g1ie.xlarge",
password: "93f0cb0614Aab12",
instanceChargeType: "PostPaid",
systemVolumeType: "ESSD_PL0",
systemVolumeSize: 50,
dataVolumes: [{
volumeType: "ESSD_PL0",
size: 50,
deleteWithInstance: true,
}],
subnetId: fooSubnet.id,
securityGroupIds: [fooSecurityGroup.id],
projectName: "default",
tags: [{
key: "k1",
value: "v1",
}],
}));
}
const fooNode: volcengine.vke.Node[] = [];
for (const range = {value: 0}; range.value < 2; range.value++) {
fooNode.push(new volcengine.vke.Node(`fooNode-${range.value}`, {
clusterId: fooCluster.id,
instanceId: fooInstance[range.value].id,
nodePoolId: fooNodePool.id,
}));
}
const fooNodes = volcengine.vke.getNodesOutput({
ids: fooNode.map(__item => __item.id),
});
import pulumi
import pulumi_volcengine as volcengine
foo_zones = volcengine.ecs.get_zones()
foo_vpc = volcengine.vpc.Vpc("fooVpc",
vpc_name="acc-test-vpc",
cidr_block="172.16.0.0/16")
foo_subnet = volcengine.vpc.Subnet("fooSubnet",
subnet_name="acc-test-subnet",
cidr_block="172.16.0.0/24",
zone_id=foo_zones.zones[0].id,
vpc_id=foo_vpc.id)
foo_security_group = volcengine.vpc.SecurityGroup("fooSecurityGroup",
security_group_name="acc-test-security-group",
vpc_id=foo_vpc.id)
foo_images = volcengine.ecs.get_images(name_regex="veLinux 1.0 CentOS兼容版 64位")
foo_cluster = volcengine.vke.Cluster("fooCluster",
description="created by terraform",
delete_protection_enabled=False,
cluster_config=volcengine.vke.ClusterClusterConfigArgs(
subnet_ids=[foo_subnet.id],
api_server_public_access_enabled=True,
api_server_public_access_config=volcengine.vke.ClusterClusterConfigApiServerPublicAccessConfigArgs(
public_access_network_config=volcengine.vke.ClusterClusterConfigApiServerPublicAccessConfigPublicAccessNetworkConfigArgs(
billing_type="PostPaidByBandwidth",
bandwidth=1,
),
),
resource_public_access_default_enabled=True,
),
pods_config=volcengine.vke.ClusterPodsConfigArgs(
pod_network_mode="VpcCniShared",
vpc_cni_config=volcengine.vke.ClusterPodsConfigVpcCniConfigArgs(
subnet_ids=[foo_subnet.id],
),
),
services_config=volcengine.vke.ClusterServicesConfigArgs(
service_cidrsv4s=["172.30.0.0/18"],
),
tags=[volcengine.vke.ClusterTagArgs(
key="tf-k1",
value="tf-v1",
)])
foo_node_pool = volcengine.vke.NodePool("fooNodePool",
cluster_id=foo_cluster.id,
auto_scaling=volcengine.vke.NodePoolAutoScalingArgs(
enabled=False,
),
node_config=volcengine.vke.NodePoolNodeConfigArgs(
instance_type_ids=["ecs.g1ie.xlarge"],
subnet_ids=[foo_subnet.id],
image_id=[image.image_id for image in foo_images.images if image.image_name == "veLinux 1.0 CentOS兼容版 64位"][0],
system_volume=volcengine.vke.NodePoolNodeConfigSystemVolumeArgs(
type="ESSD_PL0",
size=50,
),
data_volumes=[volcengine.vke.NodePoolNodeConfigDataVolumeArgs(
type="ESSD_PL0",
size=50,
mount_point="/tf",
)],
initialize_script="ZWNobyBoZWxsbyB0ZXJyYWZvcm0h",
security=volcengine.vke.NodePoolNodeConfigSecurityArgs(
login=volcengine.vke.NodePoolNodeConfigSecurityLoginArgs(
password="UHdkMTIzNDU2",
),
security_strategies=["Hids"],
security_group_ids=[foo_security_group.id],
),
additional_container_storage_enabled=True,
instance_charge_type="PostPaid",
name_prefix="acc-test",
ecs_tags=[volcengine.vke.NodePoolNodeConfigEcsTagArgs(
key="ecs_k1",
value="ecs_v1",
)],
),
kubernetes_config=volcengine.vke.NodePoolKubernetesConfigArgs(
labels=[volcengine.vke.NodePoolKubernetesConfigLabelArgs(
key="label1",
value="value1",
)],
taints=[volcengine.vke.NodePoolKubernetesConfigTaintArgs(
key="taint-key/node-type",
value="taint-value",
effect="NoSchedule",
)],
cordon=True,
),
tags=[volcengine.vke.NodePoolTagArgs(
key="node-pool-k1",
value="node-pool-v1",
)])
foo_instance = []
for range in [{"value": i} for i in range(0, 2)]:
foo_instance.append(volcengine.ecs.Instance(f"fooInstance-{range['value']}",
instance_name=f"acc-test-ecs-{range['value']}",
host_name="tf-acc-test",
image_id=[image.image_id for image in foo_images.images if image.image_name == "veLinux 1.0 CentOS兼容版 64位"][0],
instance_type="ecs.g1ie.xlarge",
password="93f0cb0614Aab12",
instance_charge_type="PostPaid",
system_volume_type="ESSD_PL0",
system_volume_size=50,
data_volumes=[volcengine.ecs.InstanceDataVolumeArgs(
volume_type="ESSD_PL0",
size=50,
delete_with_instance=True,
)],
subnet_id=foo_subnet.id,
security_group_ids=[foo_security_group.id],
project_name="default",
tags=[volcengine.ecs.InstanceTagArgs(
key="k1",
value="v1",
)]))
foo_node = []
for range in [{"value": i} for i in range(0, 2)]:
foo_node.append(volcengine.vke.Node(f"fooNode-{range['value']}",
cluster_id=foo_cluster.id,
instance_id=foo_instance[range["value"]].id,
node_pool_id=foo_node_pool.id))
foo_nodes = volcengine.vke.get_nodes_output(ids=[__item.id for __item in foo_node])
package main
import (
"fmt"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vke"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooZones, err := ecs.GetZones(ctx, nil, nil);
if err != nil {
return err
}
fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
VpcName: pulumi.String("acc-test-vpc"),
CidrBlock: pulumi.String("172.16.0.0/16"),
})
if err != nil {
return err
}
fooSubnet, err := vpc.NewSubnet(ctx, "fooSubnet", &vpc.SubnetArgs{
SubnetName: pulumi.String("acc-test-subnet"),
CidrBlock: pulumi.String("172.16.0.0/24"),
ZoneId: pulumi.String(fooZones.Zones[0].Id),
VpcId: fooVpc.ID(),
})
if err != nil {
return err
}
fooSecurityGroup, err := vpc.NewSecurityGroup(ctx, "fooSecurityGroup", &vpc.SecurityGroupArgs{
SecurityGroupName: pulumi.String("acc-test-security-group"),
VpcId: fooVpc.ID(),
})
if err != nil {
return err
}
fooImages, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
NameRegex: pulumi.StringRef("veLinux 1.0 CentOS兼容版 64位"),
}, nil);
if err != nil {
return err
}
fooCluster, err := vke.NewCluster(ctx, "fooCluster", &vke.ClusterArgs{
Description: pulumi.String("created by terraform"),
DeleteProtectionEnabled: pulumi.Bool(false),
ClusterConfig: &vke.ClusterClusterConfigArgs{
SubnetIds: pulumi.StringArray{
fooSubnet.ID(),
},
ApiServerPublicAccessEnabled: pulumi.Bool(true),
ApiServerPublicAccessConfig: &vke.ClusterClusterConfigApiServerPublicAccessConfigArgs{
PublicAccessNetworkConfig: &vke.ClusterClusterConfigApiServerPublicAccessConfigPublicAccessNetworkConfigArgs{
BillingType: pulumi.String("PostPaidByBandwidth"),
Bandwidth: pulumi.Int(1),
},
},
ResourcePublicAccessDefaultEnabled: pulumi.Bool(true),
},
PodsConfig: &vke.ClusterPodsConfigArgs{
PodNetworkMode: pulumi.String("VpcCniShared"),
VpcCniConfig: &vke.ClusterPodsConfigVpcCniConfigArgs{
SubnetIds: pulumi.StringArray{
fooSubnet.ID(),
},
},
},
ServicesConfig: &vke.ClusterServicesConfigArgs{
ServiceCidrsv4s: pulumi.StringArray{
pulumi.String("172.30.0.0/18"),
},
},
Tags: vke.ClusterTagArray{
&vke.ClusterTagArgs{
Key: pulumi.String("tf-k1"),
Value: pulumi.String("tf-v1"),
},
},
})
if err != nil {
return err
}
fooNodePool, err := vke.NewNodePool(ctx, "fooNodePool", &vke.NodePoolArgs{
ClusterId: fooCluster.ID(),
AutoScaling: &vke.NodePoolAutoScalingArgs{
Enabled: pulumi.Bool(false),
},
NodeConfig: &vke.NodePoolNodeConfigArgs{
InstanceTypeIds: pulumi.StringArray{
pulumi.String("ecs.g1ie.xlarge"),
},
SubnetIds: pulumi.StringArray{
fooSubnet.ID(),
},
ImageId: "TODO: For expression"[0],
SystemVolume: &vke.NodePoolNodeConfigSystemVolumeArgs{
Type: pulumi.String("ESSD_PL0"),
Size: pulumi.Int(50),
},
DataVolumes: vke.NodePoolNodeConfigDataVolumeArray{
&vke.NodePoolNodeConfigDataVolumeArgs{
Type: pulumi.String("ESSD_PL0"),
Size: pulumi.Int(50),
MountPoint: pulumi.String("/tf"),
},
},
InitializeScript: pulumi.String("ZWNobyBoZWxsbyB0ZXJyYWZvcm0h"),
Security: &vke.NodePoolNodeConfigSecurityArgs{
Login: &vke.NodePoolNodeConfigSecurityLoginArgs{
Password: pulumi.String("UHdkMTIzNDU2"),
},
SecurityStrategies: pulumi.StringArray{
pulumi.String("Hids"),
},
SecurityGroupIds: pulumi.StringArray{
fooSecurityGroup.ID(),
},
},
AdditionalContainerStorageEnabled: pulumi.Bool(true),
InstanceChargeType: pulumi.String("PostPaid"),
NamePrefix: pulumi.String("acc-test"),
EcsTags: vke.NodePoolNodeConfigEcsTagArray{
&vke.NodePoolNodeConfigEcsTagArgs{
Key: pulumi.String("ecs_k1"),
Value: pulumi.String("ecs_v1"),
},
},
},
KubernetesConfig: &vke.NodePoolKubernetesConfigArgs{
Labels: vke.NodePoolKubernetesConfigLabelArray{
&vke.NodePoolKubernetesConfigLabelArgs{
Key: pulumi.String("label1"),
Value: pulumi.String("value1"),
},
},
Taints: vke.NodePoolKubernetesConfigTaintArray{
&vke.NodePoolKubernetesConfigTaintArgs{
Key: pulumi.String("taint-key/node-type"),
Value: pulumi.String("taint-value"),
Effect: pulumi.String("NoSchedule"),
},
},
Cordon: pulumi.Bool(true),
},
Tags: vke.NodePoolTagArray{
&vke.NodePoolTagArgs{
Key: pulumi.String("node-pool-k1"),
Value: pulumi.String("node-pool-v1"),
},
},
})
if err != nil {
return err
}
var fooInstance []*ecs.Instance
for index := 0; index < 2; index++ {
key0 := index
val0 := index
__res, err := ecs.NewInstance(ctx, fmt.Sprintf("fooInstance-%v", key0), &ecs.InstanceArgs{
InstanceName: pulumi.String(fmt.Sprintf("acc-test-ecs-%v", val0)),
HostName: pulumi.String("tf-acc-test"),
ImageId: "TODO: For expression"[0],
InstanceType: pulumi.String("ecs.g1ie.xlarge"),
Password: pulumi.String("93f0cb0614Aab12"),
InstanceChargeType: pulumi.String("PostPaid"),
SystemVolumeType: pulumi.String("ESSD_PL0"),
SystemVolumeSize: pulumi.Int(50),
DataVolumes: ecs.InstanceDataVolumeArray{
&ecs.InstanceDataVolumeArgs{
VolumeType: pulumi.String("ESSD_PL0"),
Size: pulumi.Int(50),
DeleteWithInstance: pulumi.Bool(true),
},
},
SubnetId: fooSubnet.ID(),
SecurityGroupIds: pulumi.StringArray{
fooSecurityGroup.ID(),
},
ProjectName: pulumi.String("default"),
Tags: ecs.InstanceTagArray{
&ecs.InstanceTagArgs{
Key: pulumi.String("k1"),
Value: pulumi.String("v1"),
},
},
})
if err != nil {
return err
}
fooInstance = append(fooInstance, __res)
}
var fooNode []*vke.Node
for index := 0; index < 2; index++ {
key0 := index
val0 := index
__res, err := vke.NewNode(ctx, fmt.Sprintf("fooNode-%v", key0), &vke.NodeArgs{
ClusterId: fooCluster.ID(),
InstanceId: fooInstance[val0].ID(),
NodePoolId: fooNodePool.ID(),
})
if err != nil {
return err
}
fooNode = append(fooNode, __res)
}
_ = vke.GetNodesOutput(ctx, vke.GetNodesOutputArgs{
Ids: %!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ #-functions-volcengine:vke-getNodes:getNodes.pp:134,9-22),
}, nil);
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() =>
{
var fooZones = Volcengine.Ecs.GetZones.Invoke();
var fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
{
VpcName = "acc-test-vpc",
CidrBlock = "172.16.0.0/16",
});
var fooSubnet = new Volcengine.Vpc.Subnet("fooSubnet", new()
{
SubnetName = "acc-test-subnet",
CidrBlock = "172.16.0.0/24",
ZoneId = fooZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
VpcId = fooVpc.Id,
});
var fooSecurityGroup = new Volcengine.Vpc.SecurityGroup("fooSecurityGroup", new()
{
SecurityGroupName = "acc-test-security-group",
VpcId = fooVpc.Id,
});
var fooImages = Volcengine.Ecs.GetImages.Invoke(new()
{
NameRegex = "veLinux 1.0 CentOS兼容版 64位",
});
var fooCluster = new Volcengine.Vke.Cluster("fooCluster", new()
{
Description = "created by terraform",
DeleteProtectionEnabled = false,
ClusterConfig = new Volcengine.Vke.Inputs.ClusterClusterConfigArgs
{
SubnetIds = new[]
{
fooSubnet.Id,
},
ApiServerPublicAccessEnabled = true,
ApiServerPublicAccessConfig = new Volcengine.Vke.Inputs.ClusterClusterConfigApiServerPublicAccessConfigArgs
{
PublicAccessNetworkConfig = new Volcengine.Vke.Inputs.ClusterClusterConfigApiServerPublicAccessConfigPublicAccessNetworkConfigArgs
{
BillingType = "PostPaidByBandwidth",
Bandwidth = 1,
},
},
ResourcePublicAccessDefaultEnabled = true,
},
PodsConfig = new Volcengine.Vke.Inputs.ClusterPodsConfigArgs
{
PodNetworkMode = "VpcCniShared",
VpcCniConfig = new Volcengine.Vke.Inputs.ClusterPodsConfigVpcCniConfigArgs
{
SubnetIds = new[]
{
fooSubnet.Id,
},
},
},
ServicesConfig = new Volcengine.Vke.Inputs.ClusterServicesConfigArgs
{
ServiceCidrsv4s = new[]
{
"172.30.0.0/18",
},
},
Tags = new[]
{
new Volcengine.Vke.Inputs.ClusterTagArgs
{
Key = "tf-k1",
Value = "tf-v1",
},
},
});
var fooNodePool = new Volcengine.Vke.NodePool("fooNodePool", new()
{
ClusterId = fooCluster.Id,
AutoScaling = new Volcengine.Vke.Inputs.NodePoolAutoScalingArgs
{
Enabled = false,
},
NodeConfig = new Volcengine.Vke.Inputs.NodePoolNodeConfigArgs
{
InstanceTypeIds = new[]
{
"ecs.g1ie.xlarge",
},
SubnetIds = new[]
{
fooSubnet.Id,
},
ImageId = .Where(image => image.ImageName == "veLinux 1.0 CentOS兼容版 64位").Select(image =>
{
return image.ImageId;
}).ToList()[0],
SystemVolume = new Volcengine.Vke.Inputs.NodePoolNodeConfigSystemVolumeArgs
{
Type = "ESSD_PL0",
Size = 50,
},
DataVolumes = new[]
{
new Volcengine.Vke.Inputs.NodePoolNodeConfigDataVolumeArgs
{
Type = "ESSD_PL0",
Size = 50,
MountPoint = "/tf",
},
},
InitializeScript = "ZWNobyBoZWxsbyB0ZXJyYWZvcm0h",
Security = new Volcengine.Vke.Inputs.NodePoolNodeConfigSecurityArgs
{
Login = new Volcengine.Vke.Inputs.NodePoolNodeConfigSecurityLoginArgs
{
Password = "UHdkMTIzNDU2",
},
SecurityStrategies = new[]
{
"Hids",
},
SecurityGroupIds = new[]
{
fooSecurityGroup.Id,
},
},
AdditionalContainerStorageEnabled = true,
InstanceChargeType = "PostPaid",
NamePrefix = "acc-test",
EcsTags = new[]
{
new Volcengine.Vke.Inputs.NodePoolNodeConfigEcsTagArgs
{
Key = "ecs_k1",
Value = "ecs_v1",
},
},
},
KubernetesConfig = new Volcengine.Vke.Inputs.NodePoolKubernetesConfigArgs
{
Labels = new[]
{
new Volcengine.Vke.Inputs.NodePoolKubernetesConfigLabelArgs
{
Key = "label1",
Value = "value1",
},
},
Taints = new[]
{
new Volcengine.Vke.Inputs.NodePoolKubernetesConfigTaintArgs
{
Key = "taint-key/node-type",
Value = "taint-value",
Effect = "NoSchedule",
},
},
Cordon = true,
},
Tags = new[]
{
new Volcengine.Vke.Inputs.NodePoolTagArgs
{
Key = "node-pool-k1",
Value = "node-pool-v1",
},
},
});
var fooInstance = new List<Volcengine.Ecs.Instance>();
for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
{
var range = new { Value = rangeIndex };
fooInstance.Add(new Volcengine.Ecs.Instance($"fooInstance-{range.Value}", new()
{
InstanceName = $"acc-test-ecs-{range.Value}",
HostName = "tf-acc-test",
ImageId = .Where(image => image.ImageName == "veLinux 1.0 CentOS兼容版 64位").Select(image =>
{
return image.ImageId;
}).ToList()[0],
InstanceType = "ecs.g1ie.xlarge",
Password = "93f0cb0614Aab12",
InstanceChargeType = "PostPaid",
SystemVolumeType = "ESSD_PL0",
SystemVolumeSize = 50,
DataVolumes = new[]
{
new Volcengine.Ecs.Inputs.InstanceDataVolumeArgs
{
VolumeType = "ESSD_PL0",
Size = 50,
DeleteWithInstance = true,
},
},
SubnetId = fooSubnet.Id,
SecurityGroupIds = new[]
{
fooSecurityGroup.Id,
},
ProjectName = "default",
Tags = new[]
{
new Volcengine.Ecs.Inputs.InstanceTagArgs
{
Key = "k1",
Value = "v1",
},
},
}));
}
var fooNode = new List<Volcengine.Vke.Node>();
for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
{
var range = new { Value = rangeIndex };
fooNode.Add(new Volcengine.Vke.Node($"fooNode-{range.Value}", new()
{
ClusterId = fooCluster.Id,
InstanceId = fooInstance[range.Value].Id,
NodePoolId = fooNodePool.Id,
}));
}
var fooNodes = Volcengine.Vke.GetNodes.Invoke(new()
{
Ids = fooNode.Select(__item => __item.Id).ToList(),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.ecs.EcsFunctions;
import com.pulumi.volcengine.ecs.inputs.GetZonesArgs;
import com.pulumi.volcengine.vpc.Vpc;
import com.pulumi.volcengine.vpc.VpcArgs;
import com.pulumi.volcengine.vpc.Subnet;
import com.pulumi.volcengine.vpc.SubnetArgs;
import com.pulumi.volcengine.vpc.SecurityGroup;
import com.pulumi.volcengine.vpc.SecurityGroupArgs;
import com.pulumi.volcengine.ecs.inputs.GetImagesArgs;
import com.pulumi.volcengine.vke.Cluster;
import com.pulumi.volcengine.vke.ClusterArgs;
import com.pulumi.volcengine.vke.inputs.ClusterClusterConfigArgs;
import com.pulumi.volcengine.vke.inputs.ClusterClusterConfigApiServerPublicAccessConfigArgs;
import com.pulumi.volcengine.vke.inputs.ClusterClusterConfigApiServerPublicAccessConfigPublicAccessNetworkConfigArgs;
import com.pulumi.volcengine.vke.inputs.ClusterPodsConfigArgs;
import com.pulumi.volcengine.vke.inputs.ClusterPodsConfigVpcCniConfigArgs;
import com.pulumi.volcengine.vke.inputs.ClusterServicesConfigArgs;
import com.pulumi.volcengine.vke.inputs.ClusterTagArgs;
import com.pulumi.volcengine.vke.NodePool;
import com.pulumi.volcengine.vke.NodePoolArgs;
import com.pulumi.volcengine.vke.inputs.NodePoolAutoScalingArgs;
import com.pulumi.volcengine.vke.inputs.NodePoolNodeConfigArgs;
import com.pulumi.volcengine.vke.inputs.NodePoolNodeConfigSystemVolumeArgs;
import com.pulumi.volcengine.vke.inputs.NodePoolNodeConfigSecurityArgs;
import com.pulumi.volcengine.vke.inputs.NodePoolNodeConfigSecurityLoginArgs;
import com.pulumi.volcengine.vke.inputs.NodePoolKubernetesConfigArgs;
import com.pulumi.volcengine.vke.inputs.NodePoolTagArgs;
import com.pulumi.volcengine.ecs.Instance;
import com.pulumi.volcengine.ecs.InstanceArgs;
import com.pulumi.volcengine.ecs.inputs.InstanceDataVolumeArgs;
import com.pulumi.volcengine.ecs.inputs.InstanceTagArgs;
import com.pulumi.volcengine.vke.Node;
import com.pulumi.volcengine.vke.NodeArgs;
import com.pulumi.volcengine.vke.VkeFunctions;
import com.pulumi.volcengine.vke.inputs.GetNodesArgs;
import com.pulumi.codegen.internal.KeyedValue;
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 fooZones = EcsFunctions.getZones();
var fooVpc = new Vpc("fooVpc", VpcArgs.builder()
.vpcName("acc-test-vpc")
.cidrBlock("172.16.0.0/16")
.build());
var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()
.subnetName("acc-test-subnet")
.cidrBlock("172.16.0.0/24")
.zoneId(fooZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vpcId(fooVpc.id())
.build());
var fooSecurityGroup = new SecurityGroup("fooSecurityGroup", SecurityGroupArgs.builder()
.securityGroupName("acc-test-security-group")
.vpcId(fooVpc.id())
.build());
final var fooImages = EcsFunctions.getImages(GetImagesArgs.builder()
.nameRegex("veLinux 1.0 CentOS兼容版 64位")
.build());
var fooCluster = new Cluster("fooCluster", ClusterArgs.builder()
.description("created by terraform")
.deleteProtectionEnabled(false)
.clusterConfig(ClusterClusterConfigArgs.builder()
.subnetIds(fooSubnet.id())
.apiServerPublicAccessEnabled(true)
.apiServerPublicAccessConfig(ClusterClusterConfigApiServerPublicAccessConfigArgs.builder()
.publicAccessNetworkConfig(ClusterClusterConfigApiServerPublicAccessConfigPublicAccessNetworkConfigArgs.builder()
.billingType("PostPaidByBandwidth")
.bandwidth(1)
.build())
.build())
.resourcePublicAccessDefaultEnabled(true)
.build())
.podsConfig(ClusterPodsConfigArgs.builder()
.podNetworkMode("VpcCniShared")
.vpcCniConfig(ClusterPodsConfigVpcCniConfigArgs.builder()
.subnetIds(fooSubnet.id())
.build())
.build())
.servicesConfig(ClusterServicesConfigArgs.builder()
.serviceCidrsv4s("172.30.0.0/18")
.build())
.tags(ClusterTagArgs.builder()
.key("tf-k1")
.value("tf-v1")
.build())
.build());
var fooNodePool = new NodePool("fooNodePool", NodePoolArgs.builder()
.clusterId(fooCluster.id())
.autoScaling(NodePoolAutoScalingArgs.builder()
.enabled(false)
.build())
.nodeConfig(NodePoolNodeConfigArgs.builder()
.instanceTypeIds("ecs.g1ie.xlarge")
.subnetIds(fooSubnet.id())
.imageId("TODO: ForExpression"[0])
.systemVolume(NodePoolNodeConfigSystemVolumeArgs.builder()
.type("ESSD_PL0")
.size("50")
.build())
.dataVolumes(NodePoolNodeConfigDataVolumeArgs.builder()
.type("ESSD_PL0")
.size("50")
.mountPoint("/tf")
.build())
.initializeScript("ZWNobyBoZWxsbyB0ZXJyYWZvcm0h")
.security(NodePoolNodeConfigSecurityArgs.builder()
.login(NodePoolNodeConfigSecurityLoginArgs.builder()
.password("UHdkMTIzNDU2")
.build())
.securityStrategies("Hids")
.securityGroupIds(fooSecurityGroup.id())
.build())
.additionalContainerStorageEnabled(true)
.instanceChargeType("PostPaid")
.namePrefix("acc-test")
.ecsTags(NodePoolNodeConfigEcsTagArgs.builder()
.key("ecs_k1")
.value("ecs_v1")
.build())
.build())
.kubernetesConfig(NodePoolKubernetesConfigArgs.builder()
.labels(NodePoolKubernetesConfigLabelArgs.builder()
.key("label1")
.value("value1")
.build())
.taints(NodePoolKubernetesConfigTaintArgs.builder()
.key("taint-key/node-type")
.value("taint-value")
.effect("NoSchedule")
.build())
.cordon(true)
.build())
.tags(NodePoolTagArgs.builder()
.key("node-pool-k1")
.value("node-pool-v1")
.build())
.build());
for (var i = 0; i < 2; i++) {
new Instance("fooInstance-" + i, InstanceArgs.builder()
.instanceName(String.format("acc-test-ecs-%s", range.value()))
.hostName("tf-acc-test")
.imageId("TODO: ForExpression"[0])
.instanceType("ecs.g1ie.xlarge")
.password("93f0cb0614Aab12")
.instanceChargeType("PostPaid")
.systemVolumeType("ESSD_PL0")
.systemVolumeSize(50)
.dataVolumes(InstanceDataVolumeArgs.builder()
.volumeType("ESSD_PL0")
.size(50)
.deleteWithInstance(true)
.build())
.subnetId(fooSubnet.id())
.securityGroupIds(fooSecurityGroup.id())
.projectName("default")
.tags(InstanceTagArgs.builder()
.key("k1")
.value("v1")
.build())
.build());
}
for (var i = 0; i < 2; i++) {
new Node("fooNode-" + i, NodeArgs.builder()
.clusterId(fooCluster.id())
.instanceId(fooInstance[range.value()].id())
.nodePoolId(fooNodePool.id())
.build());
}
final var fooNodes = VkeFunctions.getNodes(GetNodesArgs.builder()
.ids(fooNode.stream().map(element -> element.id()).collect(toList()))
.build());
}
}
Example coming soon!
Using getNodes
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 getNodes(args: GetNodesArgs, opts?: InvokeOptions): Promise<GetNodesResult>
function getNodesOutput(args: GetNodesOutputArgs, opts?: InvokeOptions): Output<GetNodesResult>def get_nodes(cluster_ids: Optional[Sequence[str]] = None,
create_client_token: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name: Optional[str] = None,
name_regex: Optional[str] = None,
node_pool_ids: Optional[Sequence[str]] = None,
output_file: Optional[str] = None,
statuses: Optional[Sequence[GetNodesStatus]] = None,
zone_ids: Optional[Sequence[str]] = None,
opts: Optional[InvokeOptions] = None) -> GetNodesResult
def get_nodes_output(cluster_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
create_client_token: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name: Optional[pulumi.Input[str]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
node_pool_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
output_file: Optional[pulumi.Input[str]] = None,
statuses: Optional[pulumi.Input[Sequence[pulumi.Input[GetNodesStatusArgs]]]] = None,
zone_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNodesResult]func GetNodes(ctx *Context, args *GetNodesArgs, opts ...InvokeOption) (*GetNodesResult, error)
func GetNodesOutput(ctx *Context, args *GetNodesOutputArgs, opts ...InvokeOption) GetNodesResultOutput> Note: This function is named GetNodes in the Go SDK.
public static class GetNodes
{
public static Task<GetNodesResult> InvokeAsync(GetNodesArgs args, InvokeOptions? opts = null)
public static Output<GetNodesResult> Invoke(GetNodesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetNodesResult> getNodes(GetNodesArgs args, InvokeOptions options)
public static Output<GetNodesResult> getNodes(GetNodesArgs args, InvokeOptions options)
fn::invoke:
function: volcengine:vke/getNodes:getNodes
arguments:
# arguments dictionaryThe following arguments are supported:
- Cluster
Ids List<string> - A list of Cluster IDs.
- Create
Client stringToken - The Create Client Token.
- Ids List<string>
- A list of Node IDs.
- Name string
- The Name of Node.
- Name
Regex string - A Name Regex of Node.
- Node
Pool List<string>Ids - The Node Pool IDs.
- Output
File string - File name where to save data source results.
- Statuses
List<Get
Nodes Status> - The Status of filter.
- Zone
Ids List<string> - The Zone IDs.
- Cluster
Ids []string - A list of Cluster IDs.
- Create
Client stringToken - The Create Client Token.
- Ids []string
- A list of Node IDs.
- Name string
- The Name of Node.
- Name
Regex string - A Name Regex of Node.
- Node
Pool []stringIds - The Node Pool IDs.
- Output
File string - File name where to save data source results.
- Statuses
[]Get
Nodes Status - The Status of filter.
- Zone
Ids []string - The Zone IDs.
- cluster
Ids List<String> - A list of Cluster IDs.
- create
Client StringToken - The Create Client Token.
- ids List<String>
- A list of Node IDs.
- name String
- The Name of Node.
- name
Regex String - A Name Regex of Node.
- node
Pool List<String>Ids - The Node Pool IDs.
- output
File String - File name where to save data source results.
- statuses
List<Get
Nodes Status> - The Status of filter.
- zone
Ids List<String> - The Zone IDs.
- cluster
Ids string[] - A list of Cluster IDs.
- create
Client stringToken - The Create Client Token.
- ids string[]
- A list of Node IDs.
- name string
- The Name of Node.
- name
Regex string - A Name Regex of Node.
- node
Pool string[]Ids - The Node Pool IDs.
- output
File string - File name where to save data source results.
- statuses
Get
Nodes Status[] - The Status of filter.
- zone
Ids string[] - The Zone IDs.
- cluster_
ids Sequence[str] - A list of Cluster IDs.
- create_
client_ strtoken - The Create Client Token.
- ids Sequence[str]
- A list of Node IDs.
- name str
- The Name of Node.
- name_
regex str - A Name Regex of Node.
- node_
pool_ Sequence[str]ids - The Node Pool IDs.
- output_
file str - File name where to save data source results.
- statuses
Sequence[Get
Nodes Status] - The Status of filter.
- zone_
ids Sequence[str] - The Zone IDs.
- cluster
Ids List<String> - A list of Cluster IDs.
- create
Client StringToken - The Create Client Token.
- ids List<String>
- A list of Node IDs.
- name String
- The Name of Node.
- name
Regex String - A Name Regex of Node.
- node
Pool List<String>Ids - The Node Pool IDs.
- output
File String - File name where to save data source results.
- statuses List<Property Map>
- The Status of filter.
- zone
Ids List<String> - The Zone IDs.
getNodes Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Nodes
List<Get
Nodes Node> - The collection of Node query.
- Total
Count int - The total count of Node query.
- Cluster
Ids List<string> - Create
Client stringToken - The create client token of node.
- Ids List<string>
- Name string
- The name of Node.
- Name
Regex string - Node
Pool List<string>Ids - Output
File string - Statuses
List<Get
Nodes Status> - Zone
Ids List<string>
- Id string
- The provider-assigned unique ID for this managed resource.
- Nodes
[]Get
Nodes Node - The collection of Node query.
- Total
Count int - The total count of Node query.
- Cluster
Ids []string - Create
Client stringToken - The create client token of node.
- Ids []string
- Name string
- The name of Node.
- Name
Regex string - Node
Pool []stringIds - Output
File string - Statuses
[]Get
Nodes Status - Zone
Ids []string
- id String
- The provider-assigned unique ID for this managed resource.
- nodes
List<Get
Nodes Node> - The collection of Node query.
- total
Count Integer - The total count of Node query.
- cluster
Ids List<String> - create
Client StringToken - The create client token of node.
- ids List<String>
- name String
- The name of Node.
- name
Regex String - node
Pool List<String>Ids - output
File String - statuses
List<Get
Nodes Status> - zone
Ids List<String>
- id string
- The provider-assigned unique ID for this managed resource.
- nodes
Get
Nodes Node[] - The collection of Node query.
- total
Count number - The total count of Node query.
- cluster
Ids string[] - create
Client stringToken - The create client token of node.
- ids string[]
- name string
- The name of Node.
- name
Regex string - node
Pool string[]Ids - output
File string - statuses
Get
Nodes Status[] - zone
Ids string[]
- id str
- The provider-assigned unique ID for this managed resource.
- nodes
Sequence[Get
Nodes Node] - The collection of Node query.
- total_
count int - The total count of Node query.
- cluster_
ids Sequence[str] - create_
client_ strtoken - The create client token of node.
- ids Sequence[str]
- name str
- The name of Node.
- name_
regex str - node_
pool_ Sequence[str]ids - output_
file str - statuses
Sequence[Get
Nodes Status] - zone_
ids Sequence[str]
- id String
- The provider-assigned unique ID for this managed resource.
- nodes List<Property Map>
- The collection of Node query.
- total
Count Number - The total count of Node query.
- cluster
Ids List<String> - create
Client StringToken - The create client token of node.
- ids List<String>
- name String
- The name of Node.
- name
Regex String - node
Pool List<String>Ids - output
File String - statuses List<Property Map>
- zone
Ids List<String>
Supporting Types
GetNodesNode
- Additional
Container boolStorage Enabled - Is Additional Container storage enables.
- Cluster
Id string - The cluster id of node.
- Condition
Types List<string> - The Condition of Node.
- Container
Storage stringPath - The Storage Path.
- Cordon bool
- The Cordon of KubernetesConfig.
- Create
Client stringToken - The Create Client Token.
- Create
Time string - The create time of Node.
- Id string
- The ID of Node.
- Image
Id string - The ImageId of NodeConfig.
- Initialize
Script string - The InitializeScript of NodeConfig.
- Instance
Id string - The instance id of node.
- Is
Virtual bool - Is virtual node.
- Labels
List<Get
Nodes Node Label> - The Label of KubernetesConfig.
- Name string
- The Name of Node.
- Node
Pool stringId - The node pool id.
- Phase string
- The Phase of Node.
- Pre
Script string - The PreScript of NodeConfig.
- Roles List<string>
- The roles of node.
- Taints
List<Get
Nodes Node Taint> - The Taint of KubernetesConfig.
- Update
Time string - The update time of Node.
- Zone
Id string - The zone id.
- Additional
Container boolStorage Enabled - Is Additional Container storage enables.
- Cluster
Id string - The cluster id of node.
- Condition
Types []string - The Condition of Node.
- Container
Storage stringPath - The Storage Path.
- Cordon bool
- The Cordon of KubernetesConfig.
- Create
Client stringToken - The Create Client Token.
- Create
Time string - The create time of Node.
- Id string
- The ID of Node.
- Image
Id string - The ImageId of NodeConfig.
- Initialize
Script string - The InitializeScript of NodeConfig.
- Instance
Id string - The instance id of node.
- Is
Virtual bool - Is virtual node.
- Labels
[]Get
Nodes Node Label - The Label of KubernetesConfig.
- Name string
- The Name of Node.
- Node
Pool stringId - The node pool id.
- Phase string
- The Phase of Node.
- Pre
Script string - The PreScript of NodeConfig.
- Roles []string
- The roles of node.
- Taints
[]Get
Nodes Node Taint - The Taint of KubernetesConfig.
- Update
Time string - The update time of Node.
- Zone
Id string - The zone id.
- additional
Container BooleanStorage Enabled - Is Additional Container storage enables.
- cluster
Id String - The cluster id of node.
- condition
Types List<String> - The Condition of Node.
- container
Storage StringPath - The Storage Path.
- cordon Boolean
- The Cordon of KubernetesConfig.
- create
Client StringToken - The Create Client Token.
- create
Time String - The create time of Node.
- id String
- The ID of Node.
- image
Id String - The ImageId of NodeConfig.
- initialize
Script String - The InitializeScript of NodeConfig.
- instance
Id String - The instance id of node.
- is
Virtual Boolean - Is virtual node.
- labels
List<Get
Nodes Node Label> - The Label of KubernetesConfig.
- name String
- The Name of Node.
- node
Pool StringId - The node pool id.
- phase String
- The Phase of Node.
- pre
Script String - The PreScript of NodeConfig.
- roles List<String>
- The roles of node.
- taints
List<Get
Nodes Node Taint> - The Taint of KubernetesConfig.
- update
Time String - The update time of Node.
- zone
Id String - The zone id.
- additional
Container booleanStorage Enabled - Is Additional Container storage enables.
- cluster
Id string - The cluster id of node.
- condition
Types string[] - The Condition of Node.
- container
Storage stringPath - The Storage Path.
- cordon boolean
- The Cordon of KubernetesConfig.
- create
Client stringToken - The Create Client Token.
- create
Time string - The create time of Node.
- id string
- The ID of Node.
- image
Id string - The ImageId of NodeConfig.
- initialize
Script string - The InitializeScript of NodeConfig.
- instance
Id string - The instance id of node.
- is
Virtual boolean - Is virtual node.
- labels
Get
Nodes Node Label[] - The Label of KubernetesConfig.
- name string
- The Name of Node.
- node
Pool stringId - The node pool id.
- phase string
- The Phase of Node.
- pre
Script string - The PreScript of NodeConfig.
- roles string[]
- The roles of node.
- taints
Get
Nodes Node Taint[] - The Taint of KubernetesConfig.
- update
Time string - The update time of Node.
- zone
Id string - The zone id.
- additional_
container_ boolstorage_ enabled - Is Additional Container storage enables.
- cluster_
id str - The cluster id of node.
- condition_
types Sequence[str] - The Condition of Node.
- container_
storage_ strpath - The Storage Path.
- cordon bool
- The Cordon of KubernetesConfig.
- create_
client_ strtoken - The Create Client Token.
- create_
time str - The create time of Node.
- id str
- The ID of Node.
- image_
id str - The ImageId of NodeConfig.
- initialize_
script str - The InitializeScript of NodeConfig.
- instance_
id str - The instance id of node.
- is_
virtual bool - Is virtual node.
- labels
Sequence[Get
Nodes Node Label] - The Label of KubernetesConfig.
- name str
- The Name of Node.
- node_
pool_ strid - The node pool id.
- phase str
- The Phase of Node.
- pre_
script str - The PreScript of NodeConfig.
- roles Sequence[str]
- The roles of node.
- taints
Sequence[Get
Nodes Node Taint] - The Taint of KubernetesConfig.
- update_
time str - The update time of Node.
- zone_
id str - The zone id.
- additional
Container BooleanStorage Enabled - Is Additional Container storage enables.
- cluster
Id String - The cluster id of node.
- condition
Types List<String> - The Condition of Node.
- container
Storage StringPath - The Storage Path.
- cordon Boolean
- The Cordon of KubernetesConfig.
- create
Client StringToken - The Create Client Token.
- create
Time String - The create time of Node.
- id String
- The ID of Node.
- image
Id String - The ImageId of NodeConfig.
- initialize
Script String - The InitializeScript of NodeConfig.
- instance
Id String - The instance id of node.
- is
Virtual Boolean - Is virtual node.
- labels List<Property Map>
- The Label of KubernetesConfig.
- name String
- The Name of Node.
- node
Pool StringId - The node pool id.
- phase String
- The Phase of Node.
- pre
Script String - The PreScript of NodeConfig.
- roles List<String>
- The roles of node.
- taints List<Property Map>
- The Taint of KubernetesConfig.
- update
Time String - The update time of Node.
- zone
Id String - The zone id.
GetNodesNodeLabel
GetNodesNodeTaint
GetNodesStatus
- Conditions
Type string - The Type of Node Condition, the value is
ProgressingorOkorUnschedulableorInitilizeFailedorUnknownorNotReadyorSecurityorBalanceorResourceCleanupFailed. - Phase string
- The Phase of Node, the value is
CreatingorRunningorUpdatingorDeletingorFailedorStartingorStoppingorStopped.
- Conditions
Type string - The Type of Node Condition, the value is
ProgressingorOkorUnschedulableorInitilizeFailedorUnknownorNotReadyorSecurityorBalanceorResourceCleanupFailed. - Phase string
- The Phase of Node, the value is
CreatingorRunningorUpdatingorDeletingorFailedorStartingorStoppingorStopped.
- conditions
Type String - The Type of Node Condition, the value is
ProgressingorOkorUnschedulableorInitilizeFailedorUnknownorNotReadyorSecurityorBalanceorResourceCleanupFailed. - phase String
- The Phase of Node, the value is
CreatingorRunningorUpdatingorDeletingorFailedorStartingorStoppingorStopped.
- conditions
Type string - The Type of Node Condition, the value is
ProgressingorOkorUnschedulableorInitilizeFailedorUnknownorNotReadyorSecurityorBalanceorResourceCleanupFailed. - phase string
- The Phase of Node, the value is
CreatingorRunningorUpdatingorDeletingorFailedorStartingorStoppingorStopped.
- conditions_
type str - The Type of Node Condition, the value is
ProgressingorOkorUnschedulableorInitilizeFailedorUnknownorNotReadyorSecurityorBalanceorResourceCleanupFailed. - phase str
- The Phase of Node, the value is
CreatingorRunningorUpdatingorDeletingorFailedorStartingorStoppingorStopped.
- conditions
Type String - The Type of Node Condition, the value is
ProgressingorOkorUnschedulableorInitilizeFailedorUnknownorNotReadyorSecurityorBalanceorResourceCleanupFailed. - phase String
- The Phase of Node, the value is
CreatingorRunningorUpdatingorDeletingorFailedorStartingorStoppingorStopped.
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
volcengineTerraform Provider.
Volcengine v0.0.38 published on Friday, Oct 31, 2025 by Volcengine
