UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

396 lines (395 loc) • 13.9 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * "A set of Kubernetes nodes in a cluster with common configuration and specification." * * To get more information about NodePool, see: * * * [API documentation](https://cloud.google.com/distributed-cloud/edge/latest/docs/reference/container/rest/v1/projects.locations.clusters.nodePools) * * How-to Guides * * [Google Distributed Cloud Edge](https://cloud.google.com/distributed-cloud/edge/latest/docs) * * ## Example Usage * * ### Edgecontainer Node Pool * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const cluster = new gcp.edgecontainer.Cluster("cluster", { * name: "default", * location: "us-central1", * authorization: { * adminUsers: { * username: "admin@hashicorptest.com", * }, * }, * networking: { * clusterIpv4CidrBlocks: ["10.0.0.0/16"], * servicesIpv4CidrBlocks: ["10.1.0.0/16"], * }, * fleet: { * project: project.then(project => `projects/${project.number}`), * }, * }); * const _default = new gcp.edgecontainer.NodePool("default", { * name: "nodepool-1", * cluster: cluster.name, * location: "us-central1", * nodeLocation: "us-central1-edge-example-edgesite", * nodeCount: 3, * labels: { * my_key: "my_val", * other_key: "other_val", * }, * }); * ``` * ### Edgecontainer Node Pool With Cmek * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const cluster = new gcp.edgecontainer.Cluster("cluster", { * name: "default", * location: "us-central1", * authorization: { * adminUsers: { * username: "admin@hashicorptest.com", * }, * }, * networking: { * clusterIpv4CidrBlocks: ["10.0.0.0/16"], * servicesIpv4CidrBlocks: ["10.1.0.0/16"], * }, * fleet: { * project: project.then(project => `projects/${project.number}`), * }, * }); * const keyRing = new gcp.kms.KeyRing("key_ring", { * name: "keyring", * location: "us-central1", * }); * const cryptoKeyCryptoKey = new gcp.kms.CryptoKey("crypto_key", { * name: "key", * keyRing: keyRing.id, * }); * const cryptoKey = new gcp.kms.CryptoKeyIAMMember("crypto_key", { * cryptoKeyId: cryptoKeyCryptoKey.id, * role: "roles/cloudkms.cryptoKeyEncrypterDecrypter", * member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-edgecontainer.iam.gserviceaccount.com`), * }); * const _default = new gcp.edgecontainer.NodePool("default", { * name: "nodepool-1", * cluster: cluster.name, * location: "us-central1", * nodeLocation: "us-central1-edge-example-edgesite", * nodeCount: 3, * localDiskEncryption: { * kmsKey: cryptoKeyCryptoKey.id, * }, * }, { * dependsOn: [cryptoKey], * }); * ``` * ### Edgecontainer Local Control Plane Node Pool * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const _default = new gcp.edgecontainer.Cluster("default", { * name: "default", * location: "us-central1", * authorization: { * adminUsers: { * username: "admin@hashicorptest.com", * }, * }, * networking: { * clusterIpv4CidrBlocks: ["10.0.0.0/16"], * servicesIpv4CidrBlocks: ["10.1.0.0/16"], * }, * fleet: { * project: project.then(project => `projects/${project.number}`), * }, * externalLoadBalancerIpv4AddressPools: ["10.100.0.0-10.100.0.10"], * controlPlane: { * local: { * nodeLocation: "us-central1-edge-example-edgesite", * nodeCount: 1, * machineFilter: "machine-name", * sharedDeploymentPolicy: "ALLOWED", * }, * }, * }); * const defaultNodePool = new gcp.edgecontainer.NodePool("default", { * name: "nodepool-1", * cluster: cluster.name, * location: "us-central1", * nodeLocation: "us-central1-edge-example-edgesite", * nodeCount: 3, * }); * ``` * * ## Import * * NodePool can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/nodePools/{{name}}` * * * `{{project}}/{{location}}/{{cluster}}/{{name}}` * * * `{{location}}/{{cluster}}/{{name}}` * * When using the `pulumi import` command, NodePool can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:edgecontainer/nodePool:NodePool default projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/nodePools/{{name}} * ``` * * ```sh * $ pulumi import gcp:edgecontainer/nodePool:NodePool default {{project}}/{{location}}/{{cluster}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:edgecontainer/nodePool:NodePool default {{location}}/{{cluster}}/{{name}} * ``` */ export declare class NodePool extends pulumi.CustomResource { /** * Get an existing NodePool resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: NodePoolState, opts?: pulumi.CustomResourceOptions): NodePool; /** * Returns true if the given object is an instance of NodePool. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is NodePool; /** * The name of the target Distributed Cloud Edge Cluster. */ readonly cluster: pulumi.Output<string>; /** * The time when the node pool was created. */ readonly createTime: pulumi.Output<string>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ readonly effectiveLabels: pulumi.Output<{ [key: string]: string; }>; /** * Labels associated with this resource. * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Local disk encryption options. This field is only used when enabling CMEK support. * Structure is documented below. */ readonly localDiskEncryption: pulumi.Output<outputs.edgecontainer.NodePoolLocalDiskEncryption | undefined>; /** * The location of the resource. */ readonly location: pulumi.Output<string>; /** * Only machines matching this filter will be allowed to join the node pool. * The filtering language accepts strings like "name=<name>", and is * documented in more detail in [AIP-160](https://google.aip.dev/160). */ readonly machineFilter: pulumi.Output<string>; /** * The resource name of the node pool. */ readonly name: pulumi.Output<string>; /** * Configuration for each node in the NodePool * Structure is documented below. */ readonly nodeConfig: pulumi.Output<outputs.edgecontainer.NodePoolNodeConfig>; /** * The number of nodes in the pool. */ readonly nodeCount: pulumi.Output<number>; /** * Name of the Google Distributed Cloud Edge zone where this node pool will be created. For example: `us-central1-edge-customer-a`. */ readonly nodeLocation: pulumi.Output<string>; /** * The lowest release version among all worker nodes. */ readonly nodeVersion: pulumi.Output<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ readonly pulumiLabels: pulumi.Output<{ [key: string]: string; }>; /** * The time when the node pool was last updated. */ readonly updateTime: pulumi.Output<string>; /** * Create a NodePool resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: NodePoolArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering NodePool resources. */ export interface NodePoolState { /** * The name of the target Distributed Cloud Edge Cluster. */ cluster?: pulumi.Input<string>; /** * The time when the node pool was created. */ createTime?: pulumi.Input<string>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ effectiveLabels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Labels associated with this resource. * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Local disk encryption options. This field is only used when enabling CMEK support. * Structure is documented below. */ localDiskEncryption?: pulumi.Input<inputs.edgecontainer.NodePoolLocalDiskEncryption>; /** * The location of the resource. */ location?: pulumi.Input<string>; /** * Only machines matching this filter will be allowed to join the node pool. * The filtering language accepts strings like "name=<name>", and is * documented in more detail in [AIP-160](https://google.aip.dev/160). */ machineFilter?: pulumi.Input<string>; /** * The resource name of the node pool. */ name?: pulumi.Input<string>; /** * Configuration for each node in the NodePool * Structure is documented below. */ nodeConfig?: pulumi.Input<inputs.edgecontainer.NodePoolNodeConfig>; /** * The number of nodes in the pool. */ nodeCount?: pulumi.Input<number>; /** * Name of the Google Distributed Cloud Edge zone where this node pool will be created. For example: `us-central1-edge-customer-a`. */ nodeLocation?: pulumi.Input<string>; /** * The lowest release version among all worker nodes. */ nodeVersion?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The time when the node pool was last updated. */ updateTime?: pulumi.Input<string>; } /** * The set of arguments for constructing a NodePool resource. */ export interface NodePoolArgs { /** * The name of the target Distributed Cloud Edge Cluster. */ cluster: pulumi.Input<string>; /** * Labels associated with this resource. * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Local disk encryption options. This field is only used when enabling CMEK support. * Structure is documented below. */ localDiskEncryption?: pulumi.Input<inputs.edgecontainer.NodePoolLocalDiskEncryption>; /** * The location of the resource. */ location: pulumi.Input<string>; /** * Only machines matching this filter will be allowed to join the node pool. * The filtering language accepts strings like "name=<name>", and is * documented in more detail in [AIP-160](https://google.aip.dev/160). */ machineFilter?: pulumi.Input<string>; /** * The resource name of the node pool. */ name?: pulumi.Input<string>; /** * Configuration for each node in the NodePool * Structure is documented below. */ nodeConfig?: pulumi.Input<inputs.edgecontainer.NodePoolNodeConfig>; /** * The number of nodes in the pool. */ nodeCount: pulumi.Input<number>; /** * Name of the Google Distributed Cloud Edge zone where this node pool will be created. For example: `us-central1-edge-customer-a`. */ nodeLocation: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; }