UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

408 lines (407 loc) 12.6 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Use this data source to query detailed information of vke nodes * ## Example Usage * * ```typescript * 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), * }); * ``` */ export declare function getNodes(args?: GetNodesArgs, opts?: pulumi.InvokeOptions): Promise<GetNodesResult>; /** * A collection of arguments for invoking getNodes. */ export interface GetNodesArgs { /** * A list of Cluster IDs. */ clusterIds?: string[]; /** * The Create Client Token. */ createClientToken?: string; /** * A list of Node IDs. */ ids?: string[]; /** * The Name of Node. */ name?: string; /** * A Name Regex of Node. */ nameRegex?: string; /** * The Node Pool IDs. */ nodePoolIds?: string[]; /** * File name where to save data source results. */ outputFile?: string; /** * The Status of filter. */ statuses?: inputs.vke.GetNodesStatus[]; /** * The Zone IDs. */ zoneIds?: string[]; } /** * A collection of values returned by getNodes. */ export interface GetNodesResult { readonly clusterIds?: string[]; /** * The create client token of node. */ readonly createClientToken?: string; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly ids?: string[]; /** * The name of Node. */ readonly name?: string; readonly nameRegex?: string; readonly nodePoolIds?: string[]; /** * The collection of Node query. */ readonly nodes: outputs.vke.GetNodesNode[]; readonly outputFile?: string; readonly statuses?: outputs.vke.GetNodesStatus[]; /** * The total count of Node query. */ readonly totalCount: number; readonly zoneIds?: string[]; } /** * Use this data source to query detailed information of vke nodes * ## Example Usage * * ```typescript * 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), * }); * ``` */ export declare function getNodesOutput(args?: GetNodesOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<GetNodesResult>; /** * A collection of arguments for invoking getNodes. */ export interface GetNodesOutputArgs { /** * A list of Cluster IDs. */ clusterIds?: pulumi.Input<pulumi.Input<string>[]>; /** * The Create Client Token. */ createClientToken?: pulumi.Input<string>; /** * A list of Node IDs. */ ids?: pulumi.Input<pulumi.Input<string>[]>; /** * The Name of Node. */ name?: pulumi.Input<string>; /** * A Name Regex of Node. */ nameRegex?: pulumi.Input<string>; /** * The Node Pool IDs. */ nodePoolIds?: pulumi.Input<pulumi.Input<string>[]>; /** * File name where to save data source results. */ outputFile?: pulumi.Input<string>; /** * The Status of filter. */ statuses?: pulumi.Input<pulumi.Input<inputs.vke.GetNodesStatusArgs>[]>; /** * The Zone IDs. */ zoneIds?: pulumi.Input<pulumi.Input<string>[]>; }