NodeTemplateArgs

data class NodeTemplateArgs(val cpuOvercommitType: Output<String>? = null, val description: Output<String>? = null, val name: Output<String>? = null, val nodeAffinityLabels: Output<Map<String, String>>? = null, val nodeType: Output<String>? = null, val nodeTypeFlexibility: Output<NodeTemplateNodeTypeFlexibilityArgs>? = null, val project: Output<String>? = null, val region: Output<String>? = null, val serverBinding: Output<NodeTemplateServerBindingArgs>? = null) : ConvertibleToJava<NodeTemplateArgs>

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:

Example Usage

Node Template Basic

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",
});
import pulumi
import pulumi_gcp as gcp
template = gcp.compute.NodeTemplate("template",
name="soletenant-tmpl",
region="us-central1",
node_type="n1-node-96-624")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var template = new Gcp.Compute.NodeTemplate("template", new()
{
Name = "soletenant-tmpl",
Region = "us-central1",
NodeType = "n1-node-96-624",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewNodeTemplate(ctx, "template", &compute.NodeTemplateArgs{
Name: pulumi.String("soletenant-tmpl"),
Region: pulumi.String("us-central1"),
NodeType: pulumi.String("n1-node-96-624"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.NodeTemplate;
import com.pulumi.gcp.compute.NodeTemplateArgs;
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) {
var template = new NodeTemplate("template", NodeTemplateArgs.builder()
.name("soletenant-tmpl")
.region("us-central1")
.nodeType("n1-node-96-624")
.build());
}
}
resources:
template:
type: gcp:compute:NodeTemplate
properties:
name: soletenant-tmpl
region: us-central1
nodeType: n1-node-96-624

Node Template Server Binding

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",
},
});
import pulumi
import pulumi_gcp as gcp
central1a = gcp.compute.get_node_types(zone="us-central1-a")
template = gcp.compute.NodeTemplate("template",
name="soletenant-with-licenses",
region="us-central1",
node_type="n1-node-96-624",
node_affinity_labels={
"foo": "baz",
},
server_binding={
"type": "RESTART_NODE_ON_MINIMAL_SERVERS",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var central1a = Gcp.Compute.GetNodeTypes.Invoke(new()
{
Zone = "us-central1-a",
});
var template = new Gcp.Compute.NodeTemplate("template", new()
{
Name = "soletenant-with-licenses",
Region = "us-central1",
NodeType = "n1-node-96-624",
NodeAffinityLabels =
{
{ "foo", "baz" },
},
ServerBinding = new Gcp.Compute.Inputs.NodeTemplateServerBindingArgs
{
Type = "RESTART_NODE_ON_MINIMAL_SERVERS",
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.GetNodeTypes(ctx, &compute.GetNodeTypesArgs{
Zone: pulumi.StringRef("us-central1-a"),
}, nil)
if err != nil {
return err
}
_, err = compute.NewNodeTemplate(ctx, "template", &compute.NodeTemplateArgs{
Name: pulumi.String("soletenant-with-licenses"),
Region: pulumi.String("us-central1"),
NodeType: pulumi.String("n1-node-96-624"),
NodeAffinityLabels: pulumi.StringMap{
"foo": pulumi.String("baz"),
},
ServerBinding: &compute.NodeTemplateServerBindingArgs{
Type: pulumi.String("RESTART_NODE_ON_MINIMAL_SERVERS"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetNodeTypesArgs;
import com.pulumi.gcp.compute.NodeTemplate;
import com.pulumi.gcp.compute.NodeTemplateArgs;
import com.pulumi.gcp.compute.inputs.NodeTemplateServerBindingArgs;
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 central1a = ComputeFunctions.getNodeTypes(GetNodeTypesArgs.builder()
.zone("us-central1-a")
.build());
var template = new NodeTemplate("template", NodeTemplateArgs.builder()
.name("soletenant-with-licenses")
.region("us-central1")
.nodeType("n1-node-96-624")
.nodeAffinityLabels(Map.of("foo", "baz"))
.serverBinding(NodeTemplateServerBindingArgs.builder()
.type("RESTART_NODE_ON_MINIMAL_SERVERS")
.build())
.build());
}
}
resources:
template:
type: gcp:compute:NodeTemplate
properties:
name: soletenant-with-licenses
region: us-central1
nodeType: n1-node-96-624
nodeAffinityLabels:
foo: baz
serverBinding:
type: RESTART_NODE_ON_MINIMAL_SERVERS
variables:
central1a:
fn::invoke:
Function: gcp:compute:getNodeTypes
Arguments:
zone: us-central1-a

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:

$ pulumi import gcp:compute/nodeTemplate:NodeTemplate default projects/{{project}}/regions/{{region}}/nodeTemplates/{{name}}
$ pulumi import gcp:compute/nodeTemplate:NodeTemplate default {{project}}/{{region}}/{{name}}
$ pulumi import gcp:compute/nodeTemplate:NodeTemplate default {{region}}/{{name}}
$ pulumi import gcp:compute/nodeTemplate:NodeTemplate default {{name}}

Constructors

Link copied to clipboard
constructor(cpuOvercommitType: Output<String>? = null, description: Output<String>? = null, name: Output<String>? = null, nodeAffinityLabels: Output<Map<String, String>>? = null, nodeType: Output<String>? = null, nodeTypeFlexibility: Output<NodeTemplateNodeTypeFlexibilityArgs>? = null, project: Output<String>? = null, region: Output<String>? = null, serverBinding: Output<NodeTemplateServerBindingArgs>? = null)

Properties

Link copied to clipboard
val cpuOvercommitType: Output<String>? = null

CPU overcommit. Default value is NONE. Possible values are: ENABLED, NONE.

Link copied to clipboard
val description: Output<String>? = null

An optional textual description of the resource.

Link copied to clipboard
val name: Output<String>? = null

Name of the resource.

Link copied to clipboard
val nodeAffinityLabels: Output<Map<String, String>>? = null

Labels to use for node affinity, which will be used in instance scheduling.

Link copied to clipboard
val nodeType: Output<String>? = null

Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.

Link copied to clipboard

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.

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard
val region: Output<String>? = null

Region where nodes using the node template will be created. If it is not provided, the provider region is used.

Link copied to clipboard

The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.

Functions

Link copied to clipboard
open override fun toJava(): NodeTemplateArgs