gcp.compute.NodeTemplate
Explore with Pulumi AI
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
- How-to Guides
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")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/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
})
}
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 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",
})
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/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
})
}
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 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
Node Template Accelerators
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,
}],
});
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-accelerators",
region="us-central1",
node_type="n1-node-96-624",
accelerators=[{
"accelerator_type": "nvidia-tesla-t4",
"accelerator_count": 4,
}])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/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-accelerators"),
Region: pulumi.String("us-central1"),
NodeType: pulumi.String("n1-node-96-624"),
Accelerators: compute.NodeTemplateAcceleratorArray{
&compute.NodeTemplateAcceleratorArgs{
AcceleratorType: pulumi.String("nvidia-tesla-t4"),
AcceleratorCount: pulumi.Int(4),
},
},
})
if err != nil {
return err
}
return nil
})
}
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-accelerators",
Region = "us-central1",
NodeType = "n1-node-96-624",
Accelerators = new[]
{
new Gcp.Compute.Inputs.NodeTemplateAcceleratorArgs
{
AcceleratorType = "nvidia-tesla-t4",
AcceleratorCount = 4,
},
},
});
});
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.NodeTemplateAcceleratorArgs;
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-accelerators")
.region("us-central1")
.nodeType("n1-node-96-624")
.accelerators(NodeTemplateAcceleratorArgs.builder()
.acceleratorType("nvidia-tesla-t4")
.acceleratorCount(4)
.build())
.build());
}
}
resources:
template:
type: gcp:compute:NodeTemplate
properties:
name: soletenant-with-accelerators
region: us-central1
nodeType: n1-node-96-624
accelerators:
- acceleratorType: nvidia-tesla-t4
acceleratorCount: 4
variables:
central1a:
fn::invoke:
Function: gcp:compute:getNodeTypes
Arguments:
zone: us-central1-a
Create NodeTemplate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new NodeTemplate(name: string, args?: NodeTemplateArgs, opts?: CustomResourceOptions);
@overload
def NodeTemplate(resource_name: str,
args: Optional[NodeTemplateArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def NodeTemplate(resource_name: str,
opts: Optional[ResourceOptions] = None,
accelerators: Optional[Sequence[NodeTemplateAcceleratorArgs]] = None,
cpu_overcommit_type: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
node_affinity_labels: Optional[Mapping[str, str]] = None,
node_type: Optional[str] = None,
node_type_flexibility: Optional[NodeTemplateNodeTypeFlexibilityArgs] = None,
project: Optional[str] = None,
region: Optional[str] = None,
server_binding: Optional[NodeTemplateServerBindingArgs] = None)
func NewNodeTemplate(ctx *Context, name string, args *NodeTemplateArgs, opts ...ResourceOption) (*NodeTemplate, error)
public NodeTemplate(string name, NodeTemplateArgs? args = null, CustomResourceOptions? opts = null)
public NodeTemplate(String name, NodeTemplateArgs args)
public NodeTemplate(String name, NodeTemplateArgs args, CustomResourceOptions options)
type: gcp:compute:NodeTemplate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args NodeTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args NodeTemplateArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args NodeTemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NodeTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NodeTemplateArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var nodeTemplateResource = new Gcp.Compute.NodeTemplate("nodeTemplateResource", new()
{
Accelerators = new[]
{
new Gcp.Compute.Inputs.NodeTemplateAcceleratorArgs
{
AcceleratorCount = 0,
AcceleratorType = "string",
},
},
CpuOvercommitType = "string",
Description = "string",
Name = "string",
NodeAffinityLabels =
{
{ "string", "string" },
},
NodeType = "string",
NodeTypeFlexibility = new Gcp.Compute.Inputs.NodeTemplateNodeTypeFlexibilityArgs
{
Cpus = "string",
LocalSsd = "string",
Memory = "string",
},
Project = "string",
Region = "string",
ServerBinding = new Gcp.Compute.Inputs.NodeTemplateServerBindingArgs
{
Type = "string",
},
});
example, err := compute.NewNodeTemplate(ctx, "nodeTemplateResource", &compute.NodeTemplateArgs{
Accelerators: compute.NodeTemplateAcceleratorArray{
&compute.NodeTemplateAcceleratorArgs{
AcceleratorCount: pulumi.Int(0),
AcceleratorType: pulumi.String("string"),
},
},
CpuOvercommitType: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
NodeAffinityLabels: pulumi.StringMap{
"string": pulumi.String("string"),
},
NodeType: pulumi.String("string"),
NodeTypeFlexibility: &compute.NodeTemplateNodeTypeFlexibilityArgs{
Cpus: pulumi.String("string"),
LocalSsd: pulumi.String("string"),
Memory: pulumi.String("string"),
},
Project: pulumi.String("string"),
Region: pulumi.String("string"),
ServerBinding: &compute.NodeTemplateServerBindingArgs{
Type: pulumi.String("string"),
},
})
var nodeTemplateResource = new NodeTemplate("nodeTemplateResource", NodeTemplateArgs.builder()
.accelerators(NodeTemplateAcceleratorArgs.builder()
.acceleratorCount(0)
.acceleratorType("string")
.build())
.cpuOvercommitType("string")
.description("string")
.name("string")
.nodeAffinityLabels(Map.of("string", "string"))
.nodeType("string")
.nodeTypeFlexibility(NodeTemplateNodeTypeFlexibilityArgs.builder()
.cpus("string")
.localSsd("string")
.memory("string")
.build())
.project("string")
.region("string")
.serverBinding(NodeTemplateServerBindingArgs.builder()
.type("string")
.build())
.build());
node_template_resource = gcp.compute.NodeTemplate("nodeTemplateResource",
accelerators=[{
"accelerator_count": 0,
"accelerator_type": "string",
}],
cpu_overcommit_type="string",
description="string",
name="string",
node_affinity_labels={
"string": "string",
},
node_type="string",
node_type_flexibility={
"cpus": "string",
"local_ssd": "string",
"memory": "string",
},
project="string",
region="string",
server_binding={
"type": "string",
})
const nodeTemplateResource = new gcp.compute.NodeTemplate("nodeTemplateResource", {
accelerators: [{
acceleratorCount: 0,
acceleratorType: "string",
}],
cpuOvercommitType: "string",
description: "string",
name: "string",
nodeAffinityLabels: {
string: "string",
},
nodeType: "string",
nodeTypeFlexibility: {
cpus: "string",
localSsd: "string",
memory: "string",
},
project: "string",
region: "string",
serverBinding: {
type: "string",
},
});
type: gcp:compute:NodeTemplate
properties:
accelerators:
- acceleratorCount: 0
acceleratorType: string
cpuOvercommitType: string
description: string
name: string
nodeAffinityLabels:
string: string
nodeType: string
nodeTypeFlexibility:
cpus: string
localSsd: string
memory: string
project: string
region: string
serverBinding:
type: string
NodeTemplate Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The NodeTemplate resource accepts the following input properties:
- Accelerators
List<Node
Template Accelerator> - List of the type and count of accelerator cards attached to the node template Structure is documented below.
- Cpu
Overcommit stringType - CPU overcommit.
Default value is
NONE
. Possible values are:ENABLED
,NONE
. - Description string
- An optional textual description of the resource.
- Name string
- Name of the resource.
- Node
Affinity Dictionary<string, string>Labels - Labels to use for node affinity, which will be used in instance scheduling.
- Node
Type string - Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.
- Node
Type NodeFlexibility Template Node Type Flexibility - 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.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
- Region where nodes using the node template will be created. If it is not provided, the provider region is used.
- Server
Binding NodeTemplate Server Binding - The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.
- Accelerators
[]Node
Template Accelerator Args - List of the type and count of accelerator cards attached to the node template Structure is documented below.
- Cpu
Overcommit stringType - CPU overcommit.
Default value is
NONE
. Possible values are:ENABLED
,NONE
. - Description string
- An optional textual description of the resource.
- Name string
- Name of the resource.
- Node
Affinity map[string]stringLabels - Labels to use for node affinity, which will be used in instance scheduling.
- Node
Type string - Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.
- Node
Type NodeFlexibility Template Node Type Flexibility Args - 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.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
- Region where nodes using the node template will be created. If it is not provided, the provider region is used.
- Server
Binding NodeTemplate Server Binding Args - The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.
- accelerators
List<Node
Template Accelerator> - List of the type and count of accelerator cards attached to the node template Structure is documented below.
- cpu
Overcommit StringType - CPU overcommit.
Default value is
NONE
. Possible values are:ENABLED
,NONE
. - description String
- An optional textual description of the resource.
- name String
- Name of the resource.
- node
Affinity Map<String,String>Labels - Labels to use for node affinity, which will be used in instance scheduling.
- node
Type String - Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.
- node
Type NodeFlexibility Template Node Type Flexibility - 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.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
- Region where nodes using the node template will be created. If it is not provided, the provider region is used.
- server
Binding NodeTemplate Server Binding - The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.
- accelerators
Node
Template Accelerator[] - List of the type and count of accelerator cards attached to the node template Structure is documented below.
- cpu
Overcommit stringType - CPU overcommit.
Default value is
NONE
. Possible values are:ENABLED
,NONE
. - description string
- An optional textual description of the resource.
- name string
- Name of the resource.
- node
Affinity {[key: string]: string}Labels - Labels to use for node affinity, which will be used in instance scheduling.
- node
Type string - Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.
- node
Type NodeFlexibility Template Node Type Flexibility - 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.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region string
- Region where nodes using the node template will be created. If it is not provided, the provider region is used.
- server
Binding NodeTemplate Server Binding - The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.
- accelerators
Sequence[Node
Template Accelerator Args] - List of the type and count of accelerator cards attached to the node template Structure is documented below.
- cpu_
overcommit_ strtype - CPU overcommit.
Default value is
NONE
. Possible values are:ENABLED
,NONE
. - description str
- An optional textual description of the resource.
- name str
- Name of the resource.
- node_
affinity_ Mapping[str, str]labels - Labels to use for node affinity, which will be used in instance scheduling.
- node_
type str - Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.
- node_
type_ Nodeflexibility Template Node Type Flexibility Args - 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.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region str
- Region where nodes using the node template will be created. If it is not provided, the provider region is used.
- server_
binding NodeTemplate Server Binding Args - The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.
- accelerators List<Property Map>
- List of the type and count of accelerator cards attached to the node template Structure is documented below.
- cpu
Overcommit StringType - CPU overcommit.
Default value is
NONE
. Possible values are:ENABLED
,NONE
. - description String
- An optional textual description of the resource.
- name String
- Name of the resource.
- node
Affinity Map<String>Labels - Labels to use for node affinity, which will be used in instance scheduling.
- node
Type String - Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.
- node
Type Property MapFlexibility - 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.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
- Region where nodes using the node template will be created. If it is not provided, the provider region is used.
- server
Binding Property Map - The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.
Outputs
All input properties are implicitly available as output properties. Additionally, the NodeTemplate resource produces the following output properties:
- Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Self
Link string - The URI of the created resource.
- Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Self
Link string - The URI of the created resource.
- creation
Timestamp String - Creation timestamp in RFC3339 text format.
- id String
- The provider-assigned unique ID for this managed resource.
- self
Link String - The URI of the created resource.
- creation
Timestamp string - Creation timestamp in RFC3339 text format.
- id string
- The provider-assigned unique ID for this managed resource.
- self
Link string - The URI of the created resource.
- creation_
timestamp str - Creation timestamp in RFC3339 text format.
- id str
- The provider-assigned unique ID for this managed resource.
- self_
link str - The URI of the created resource.
- creation
Timestamp String - Creation timestamp in RFC3339 text format.
- id String
- The provider-assigned unique ID for this managed resource.
- self
Link String - The URI of the created resource.
Look up Existing NodeTemplate Resource
Get an existing NodeTemplate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: NodeTemplateState, opts?: CustomResourceOptions): NodeTemplate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
accelerators: Optional[Sequence[NodeTemplateAcceleratorArgs]] = None,
cpu_overcommit_type: Optional[str] = None,
creation_timestamp: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
node_affinity_labels: Optional[Mapping[str, str]] = None,
node_type: Optional[str] = None,
node_type_flexibility: Optional[NodeTemplateNodeTypeFlexibilityArgs] = None,
project: Optional[str] = None,
region: Optional[str] = None,
self_link: Optional[str] = None,
server_binding: Optional[NodeTemplateServerBindingArgs] = None) -> NodeTemplate
func GetNodeTemplate(ctx *Context, name string, id IDInput, state *NodeTemplateState, opts ...ResourceOption) (*NodeTemplate, error)
public static NodeTemplate Get(string name, Input<string> id, NodeTemplateState? state, CustomResourceOptions? opts = null)
public static NodeTemplate get(String name, Output<String> id, NodeTemplateState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Accelerators
List<Node
Template Accelerator> - List of the type and count of accelerator cards attached to the node template Structure is documented below.
- Cpu
Overcommit stringType - CPU overcommit.
Default value is
NONE
. Possible values are:ENABLED
,NONE
. - Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Description string
- An optional textual description of the resource.
- Name string
- Name of the resource.
- Node
Affinity Dictionary<string, string>Labels - Labels to use for node affinity, which will be used in instance scheduling.
- Node
Type string - Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.
- Node
Type NodeFlexibility Template Node Type Flexibility - 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.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
- Region where nodes using the node template will be created. If it is not provided, the provider region is used.
- Self
Link string - The URI of the created resource.
- Server
Binding NodeTemplate Server Binding - The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.
- Accelerators
[]Node
Template Accelerator Args - List of the type and count of accelerator cards attached to the node template Structure is documented below.
- Cpu
Overcommit stringType - CPU overcommit.
Default value is
NONE
. Possible values are:ENABLED
,NONE
. - Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Description string
- An optional textual description of the resource.
- Name string
- Name of the resource.
- Node
Affinity map[string]stringLabels - Labels to use for node affinity, which will be used in instance scheduling.
- Node
Type string - Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.
- Node
Type NodeFlexibility Template Node Type Flexibility Args - 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.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
- Region where nodes using the node template will be created. If it is not provided, the provider region is used.
- Self
Link string - The URI of the created resource.
- Server
Binding NodeTemplate Server Binding Args - The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.
- accelerators
List<Node
Template Accelerator> - List of the type and count of accelerator cards attached to the node template Structure is documented below.
- cpu
Overcommit StringType - CPU overcommit.
Default value is
NONE
. Possible values are:ENABLED
,NONE
. - creation
Timestamp String - Creation timestamp in RFC3339 text format.
- description String
- An optional textual description of the resource.
- name String
- Name of the resource.
- node
Affinity Map<String,String>Labels - Labels to use for node affinity, which will be used in instance scheduling.
- node
Type String - Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.
- node
Type NodeFlexibility Template Node Type Flexibility - 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.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
- Region where nodes using the node template will be created. If it is not provided, the provider region is used.
- self
Link String - The URI of the created resource.
- server
Binding NodeTemplate Server Binding - The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.
- accelerators
Node
Template Accelerator[] - List of the type and count of accelerator cards attached to the node template Structure is documented below.
- cpu
Overcommit stringType - CPU overcommit.
Default value is
NONE
. Possible values are:ENABLED
,NONE
. - creation
Timestamp string - Creation timestamp in RFC3339 text format.
- description string
- An optional textual description of the resource.
- name string
- Name of the resource.
- node
Affinity {[key: string]: string}Labels - Labels to use for node affinity, which will be used in instance scheduling.
- node
Type string - Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.
- node
Type NodeFlexibility Template Node Type Flexibility - 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.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region string
- Region where nodes using the node template will be created. If it is not provided, the provider region is used.
- self
Link string - The URI of the created resource.
- server
Binding NodeTemplate Server Binding - The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.
- accelerators
Sequence[Node
Template Accelerator Args] - List of the type and count of accelerator cards attached to the node template Structure is documented below.
- cpu_
overcommit_ strtype - CPU overcommit.
Default value is
NONE
. Possible values are:ENABLED
,NONE
. - creation_
timestamp str - Creation timestamp in RFC3339 text format.
- description str
- An optional textual description of the resource.
- name str
- Name of the resource.
- node_
affinity_ Mapping[str, str]labels - Labels to use for node affinity, which will be used in instance scheduling.
- node_
type str - Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.
- node_
type_ Nodeflexibility Template Node Type Flexibility Args - 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.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region str
- Region where nodes using the node template will be created. If it is not provided, the provider region is used.
- self_
link str - The URI of the created resource.
- server_
binding NodeTemplate Server Binding Args - The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.
- accelerators List<Property Map>
- List of the type and count of accelerator cards attached to the node template Structure is documented below.
- cpu
Overcommit StringType - CPU overcommit.
Default value is
NONE
. Possible values are:ENABLED
,NONE
. - creation
Timestamp String - Creation timestamp in RFC3339 text format.
- description String
- An optional textual description of the resource.
- name String
- Name of the resource.
- node
Affinity Map<String>Labels - Labels to use for node affinity, which will be used in instance scheduling.
- node
Type String - Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.
- node
Type Property MapFlexibility - 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.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
- Region where nodes using the node template will be created. If it is not provided, the provider region is used.
- self
Link String - The URI of the created resource.
- server
Binding Property Map - The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.
Supporting Types
NodeTemplateAccelerator, NodeTemplateAcceleratorArgs
- Accelerator
Count int - The number of the guest accelerator cards exposed to this node template.
- Accelerator
Type string - Full or partial URL of the accelerator type resource to expose to this node template.
- Accelerator
Count int - The number of the guest accelerator cards exposed to this node template.
- Accelerator
Type string - Full or partial URL of the accelerator type resource to expose to this node template.
- accelerator
Count Integer - The number of the guest accelerator cards exposed to this node template.
- accelerator
Type String - Full or partial URL of the accelerator type resource to expose to this node template.
- accelerator
Count number - The number of the guest accelerator cards exposed to this node template.
- accelerator
Type string - Full or partial URL of the accelerator type resource to expose to this node template.
- accelerator_
count int - The number of the guest accelerator cards exposed to this node template.
- accelerator_
type str - Full or partial URL of the accelerator type resource to expose to this node template.
- accelerator
Count Number - The number of the guest accelerator cards exposed to this node template.
- accelerator
Type String - Full or partial URL of the accelerator type resource to expose to this node template.
NodeTemplateNodeTypeFlexibility, NodeTemplateNodeTypeFlexibilityArgs
NodeTemplateServerBinding, NodeTemplateServerBindingArgs
- Type string
- Type of server binding policy. If
RESTART_NODE_ON_ANY_SERVER
, nodes using this template will restart on any physical server following a maintenance event. IfRESTART_NODE_ON_MINIMAL_SERVER
, nodes using this template will restart on the same physical server following a maintenance event, instead of being live migrated to or restarted on a new physical server. This option may be useful if you are using software licenses tied to the underlying server characteristics such as physical sockets or cores, to avoid the need for additional licenses when maintenance occurs. However, VMs on such nodes will experience outages while maintenance is applied. Possible values are:RESTART_NODE_ON_ANY_SERVER
,RESTART_NODE_ON_MINIMAL_SERVERS
.
- Type string
- Type of server binding policy. If
RESTART_NODE_ON_ANY_SERVER
, nodes using this template will restart on any physical server following a maintenance event. IfRESTART_NODE_ON_MINIMAL_SERVER
, nodes using this template will restart on the same physical server following a maintenance event, instead of being live migrated to or restarted on a new physical server. This option may be useful if you are using software licenses tied to the underlying server characteristics such as physical sockets or cores, to avoid the need for additional licenses when maintenance occurs. However, VMs on such nodes will experience outages while maintenance is applied. Possible values are:RESTART_NODE_ON_ANY_SERVER
,RESTART_NODE_ON_MINIMAL_SERVERS
.
- type String
- Type of server binding policy. If
RESTART_NODE_ON_ANY_SERVER
, nodes using this template will restart on any physical server following a maintenance event. IfRESTART_NODE_ON_MINIMAL_SERVER
, nodes using this template will restart on the same physical server following a maintenance event, instead of being live migrated to or restarted on a new physical server. This option may be useful if you are using software licenses tied to the underlying server characteristics such as physical sockets or cores, to avoid the need for additional licenses when maintenance occurs. However, VMs on such nodes will experience outages while maintenance is applied. Possible values are:RESTART_NODE_ON_ANY_SERVER
,RESTART_NODE_ON_MINIMAL_SERVERS
.
- type string
- Type of server binding policy. If
RESTART_NODE_ON_ANY_SERVER
, nodes using this template will restart on any physical server following a maintenance event. IfRESTART_NODE_ON_MINIMAL_SERVER
, nodes using this template will restart on the same physical server following a maintenance event, instead of being live migrated to or restarted on a new physical server. This option may be useful if you are using software licenses tied to the underlying server characteristics such as physical sockets or cores, to avoid the need for additional licenses when maintenance occurs. However, VMs on such nodes will experience outages while maintenance is applied. Possible values are:RESTART_NODE_ON_ANY_SERVER
,RESTART_NODE_ON_MINIMAL_SERVERS
.
- type str
- Type of server binding policy. If
RESTART_NODE_ON_ANY_SERVER
, nodes using this template will restart on any physical server following a maintenance event. IfRESTART_NODE_ON_MINIMAL_SERVER
, nodes using this template will restart on the same physical server following a maintenance event, instead of being live migrated to or restarted on a new physical server. This option may be useful if you are using software licenses tied to the underlying server characteristics such as physical sockets or cores, to avoid the need for additional licenses when maintenance occurs. However, VMs on such nodes will experience outages while maintenance is applied. Possible values are:RESTART_NODE_ON_ANY_SERVER
,RESTART_NODE_ON_MINIMAL_SERVERS
.
- type String
- Type of server binding policy. If
RESTART_NODE_ON_ANY_SERVER
, nodes using this template will restart on any physical server following a maintenance event. IfRESTART_NODE_ON_MINIMAL_SERVER
, nodes using this template will restart on the same physical server following a maintenance event, instead of being live migrated to or restarted on a new physical server. This option may be useful if you are using software licenses tied to the underlying server characteristics such as physical sockets or cores, to avoid the need for additional licenses when maintenance occurs. However, VMs on such nodes will experience outages while maintenance is applied. Possible values are:RESTART_NODE_ON_ANY_SERVER
,RESTART_NODE_ON_MINIMAL_SERVERS
.
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}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.