Package com.pulumi.gcp.compute
Class NodeTemplate
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.gcp.compute.NodeTemplate
-
public class NodeTemplate extends com.pulumi.resources.CustomResource
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 ```java 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() .nodeType("n1-node-96-624") .region("us-central1") .build()); } } ``` ### Node Template Server Binding ```java 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() .nodeAffinityLabels(Map.of("foo", "baz")) .nodeType("n1-node-96-624") .region("us-central1") .serverBinding(NodeTemplateServerBindingArgs.builder() .type("RESTART_NODE_ON_MINIMAL_SERVERS") .build()) .build()); } } ``` ## Import NodeTemplate can be imported using any of these accepted formats ```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}} ```
-
-
Constructor Summary
Constructors Constructor Description NodeTemplate(java.lang.String name)
NodeTemplate(java.lang.String name, NodeTemplateArgs args)
NodeTemplate(java.lang.String name, NodeTemplateArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.util.Optional<java.lang.String>>
cpuOvercommitType()
com.pulumi.core.Output<java.lang.String>
creationTimestamp()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
description()
static NodeTemplate
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, NodeTemplateState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>
name()
com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>
nodeAffinityLabels()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
nodeType()
com.pulumi.core.Output<java.util.Optional<NodeTemplateNodeTypeFlexibility>>
nodeTypeFlexibility()
com.pulumi.core.Output<java.lang.String>
project()
com.pulumi.core.Output<java.lang.String>
region()
com.pulumi.core.Output<java.lang.String>
selfLink()
com.pulumi.core.Output<NodeTemplateServerBinding>
serverBinding()
-
-
-
Constructor Detail
-
NodeTemplate
public NodeTemplate(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
NodeTemplate
public NodeTemplate(java.lang.String name, @Nullable NodeTemplateArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
NodeTemplate
public NodeTemplate(java.lang.String name, @Nullable NodeTemplateArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
cpuOvercommitType
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> cpuOvercommitType()
- Returns:
- CPU overcommit. Default value is `NONE`. Possible values are: `ENABLED`, `NONE`.
-
creationTimestamp
public com.pulumi.core.Output<java.lang.String> creationTimestamp()
- Returns:
- Creation timestamp in RFC3339 text format.
-
description
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
- Returns:
- An optional textual description of the resource.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Name of the resource.
-
nodeAffinityLabels
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> nodeAffinityLabels()
- Returns:
- Labels to use for node affinity, which will be used in instance scheduling.
-
nodeType
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> nodeType()
- Returns:
- Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified.
-
nodeTypeFlexibility
public com.pulumi.core.Output<java.util.Optional<NodeTemplateNodeTypeFlexibility>> nodeTypeFlexibility()
- Returns:
- 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
public com.pulumi.core.Output<java.lang.String> project()
- Returns:
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where nodes using the node template will be created. If it is not provided, the provider region is used.
-
selfLink
public com.pulumi.core.Output<java.lang.String> selfLink()
- Returns:
- The URI of the created resource.
-
serverBinding
public com.pulumi.core.Output<NodeTemplateServerBinding> serverBinding()
- Returns:
- The server binding policy for nodes using this template. Determines where the nodes should restart following a maintenance event. Structure is documented below.
-
get
public static NodeTemplate get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable NodeTemplateState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-