UNPKG

@pulumi/gcp

Version:

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

357 lines (356 loc) • 12.1 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Represents a NodeTemplate resource. Node templates specify properties * for creating sole-tenant nodes, such as node type, vCPU and memory * requirements, node affinity labels, and region. * * To get more information about NodeTemplate, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/nodeTemplates) * * How-to Guides * * [Sole-Tenant Nodes](https://cloud.google.com/compute/docs/nodes/) * * ## Example Usage * * ### Node Template Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const template = new gcp.compute.NodeTemplate("template", { * name: "soletenant-tmpl", * region: "us-central1", * nodeType: "n1-node-96-624", * }); * ``` * ### Node Template Server Binding * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const central1a = gcp.compute.getNodeTypes({ * zone: "us-central1-a", * }); * const template = new gcp.compute.NodeTemplate("template", { * name: "soletenant-with-licenses", * region: "us-central1", * nodeType: "n1-node-96-624", * nodeAffinityLabels: { * foo: "baz", * }, * serverBinding: { * type: "RESTART_NODE_ON_MINIMAL_SERVERS", * }, * }); * ``` * ### Node Template Accelerators * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const central1a = gcp.compute.getNodeTypes({ * zone: "us-central1-a", * }); * const template = new gcp.compute.NodeTemplate("template", { * name: "soletenant-with-accelerators", * region: "us-central1", * nodeType: "n1-node-96-624", * accelerators: [{ * acceleratorType: "nvidia-tesla-t4", * acceleratorCount: 4, * }], * }); * ``` * ### Node Template Disks * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const central1a = gcp.compute.getNodeTypes({ * zone: "us-central1-a", * }); * const template = new gcp.compute.NodeTemplate("template", { * name: "soletenant-with-disks", * region: "us-central1", * nodeType: "n2-node-80-640", * disks: [{ * diskCount: 16, * diskSizeGb: 375, * diskType: "local-ssd", * }], * }); * ``` * * ## Import * * NodeTemplate can be imported using any of these accepted formats: * * * `projects/{{project}}/regions/{{region}}/nodeTemplates/{{name}}` * * * `{{project}}/{{region}}/{{name}}` * * * `{{region}}/{{name}}` * * * `{{name}}` * * When using the `pulumi import` command, NodeTemplate can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/nodeTemplate:NodeTemplate default projects/{{project}}/regions/{{region}}/nodeTemplates/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/nodeTemplate:NodeTemplate default {{project}}/{{region}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/nodeTemplate:NodeTemplate default {{region}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/nodeTemplate:NodeTemplate default {{name}} * ``` */ export declare class NodeTemplate extends pulumi.CustomResource { /** * Get an existing NodeTemplate 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?: NodeTemplateState, opts?: pulumi.CustomResourceOptions): NodeTemplate; /** * Returns true if the given object is an instance of NodeTemplate. 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 NodeTemplate; /** * List of the type and count of accelerator cards attached to the * node template * Structure is documented below. */ readonly accelerators: pulumi.Output<outputs.compute.NodeTemplateAccelerator[] | undefined>; /** * CPU overcommit. * Default value is `NONE`. * Possible values are: `ENABLED`, `NONE`. */ readonly cpuOvercommitType: pulumi.Output<string | undefined>; /** * Creation timestamp in RFC3339 text format. */ readonly creationTimestamp: pulumi.Output<string>; /** * An optional textual description of the resource. */ readonly description: pulumi.Output<string | undefined>; /** * List of the type, size and count of disks attached to the * node template * Structure is documented below. */ readonly disks: pulumi.Output<outputs.compute.NodeTemplateDisk[] | undefined>; /** * Name of the resource. */ readonly name: pulumi.Output<string>; /** * Labels to use for node affinity, which will be used in * instance scheduling. */ readonly nodeAffinityLabels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Node type to use for nodes group that are created from this template. * Only one of nodeTypeFlexibility and nodeType can be specified. */ readonly nodeType: pulumi.Output<string | undefined>; /** * Flexible properties for the desired node type. Node groups that * use this node template will create nodes of a type that matches * these properties. Only one of nodeTypeFlexibility and nodeType can * be specified. * Structure is documented below. */ readonly nodeTypeFlexibility: pulumi.Output<outputs.compute.NodeTemplateNodeTypeFlexibility | undefined>; /** * 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>; /** * Region where nodes using the node template will be created. * If it is not provided, the provider region is used. */ readonly region: pulumi.Output<string>; /** * The URI of the created resource. */ readonly selfLink: pulumi.Output<string>; /** * The server binding policy for nodes using this template. Determines * where the nodes should restart following a maintenance event. * Structure is documented below. */ readonly serverBinding: pulumi.Output<outputs.compute.NodeTemplateServerBinding>; /** * Create a NodeTemplate 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?: NodeTemplateArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering NodeTemplate resources. */ export interface NodeTemplateState { /** * List of the type and count of accelerator cards attached to the * node template * Structure is documented below. */ accelerators?: pulumi.Input<pulumi.Input<inputs.compute.NodeTemplateAccelerator>[]>; /** * CPU overcommit. * Default value is `NONE`. * Possible values are: `ENABLED`, `NONE`. */ cpuOvercommitType?: pulumi.Input<string>; /** * Creation timestamp in RFC3339 text format. */ creationTimestamp?: pulumi.Input<string>; /** * An optional textual description of the resource. */ description?: pulumi.Input<string>; /** * List of the type, size and count of disks attached to the * node template * Structure is documented below. */ disks?: pulumi.Input<pulumi.Input<inputs.compute.NodeTemplateDisk>[]>; /** * Name of the resource. */ name?: pulumi.Input<string>; /** * Labels to use for node affinity, which will be used in * instance scheduling. */ nodeAffinityLabels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Node type to use for nodes group that are created from this template. * Only one of nodeTypeFlexibility and nodeType can be specified. */ nodeType?: pulumi.Input<string>; /** * Flexible properties for the desired node type. Node groups that * use this node template will create nodes of a type that matches * these properties. Only one of nodeTypeFlexibility and nodeType can * be specified. * Structure is documented below. */ nodeTypeFlexibility?: pulumi.Input<inputs.compute.NodeTemplateNodeTypeFlexibility>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * Region where nodes using the node template will be created. * If it is not provided, the provider region is used. */ region?: pulumi.Input<string>; /** * The URI of the created resource. */ selfLink?: pulumi.Input<string>; /** * The server binding policy for nodes using this template. Determines * where the nodes should restart following a maintenance event. * Structure is documented below. */ serverBinding?: pulumi.Input<inputs.compute.NodeTemplateServerBinding>; } /** * The set of arguments for constructing a NodeTemplate resource. */ export interface NodeTemplateArgs { /** * List of the type and count of accelerator cards attached to the * node template * Structure is documented below. */ accelerators?: pulumi.Input<pulumi.Input<inputs.compute.NodeTemplateAccelerator>[]>; /** * CPU overcommit. * Default value is `NONE`. * Possible values are: `ENABLED`, `NONE`. */ cpuOvercommitType?: pulumi.Input<string>; /** * An optional textual description of the resource. */ description?: pulumi.Input<string>; /** * List of the type, size and count of disks attached to the * node template * Structure is documented below. */ disks?: pulumi.Input<pulumi.Input<inputs.compute.NodeTemplateDisk>[]>; /** * Name of the resource. */ name?: pulumi.Input<string>; /** * Labels to use for node affinity, which will be used in * instance scheduling. */ nodeAffinityLabels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Node type to use for nodes group that are created from this template. * Only one of nodeTypeFlexibility and nodeType can be specified. */ nodeType?: pulumi.Input<string>; /** * Flexible properties for the desired node type. Node groups that * use this node template will create nodes of a type that matches * these properties. Only one of nodeTypeFlexibility and nodeType can * be specified. * Structure is documented below. */ nodeTypeFlexibility?: pulumi.Input<inputs.compute.NodeTemplateNodeTypeFlexibility>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * Region where nodes using the node template will be created. * If it is not provided, the provider region is used. */ region?: pulumi.Input<string>; /** * The server binding policy for nodes using this template. Determines * where the nodes should restart following a maintenance event. * Structure is documented below. */ serverBinding?: pulumi.Input<inputs.compute.NodeTemplateServerBinding>; }