com.pulumi.gcp.compute.kotlin.NodeTemplateArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.compute.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.NodeTemplateArgs.builder
import com.pulumi.gcp.compute.kotlin.inputs.NodeTemplateNodeTypeFlexibilityArgs
import com.pulumi.gcp.compute.kotlin.inputs.NodeTemplateNodeTypeFlexibilityArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.NodeTemplateServerBindingArgs
import com.pulumi.gcp.compute.kotlin.inputs.NodeTemplateServerBindingArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* 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",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* template = gcp.compute.NodeTemplate("template",
* name="soletenant-tmpl",
* region="us-central1",
* node_type="n1-node-96-624")
* ```
* ```csharp
* 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",
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```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()
* .name("soletenant-tmpl")
* .region("us-central1")
* .nodeType("n1-node-96-624")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* template:
* type: gcp:compute:NodeTemplate
* properties:
* 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",
* },
* });
* ```
* ```python
* 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=gcp.compute.NodeTemplateServerBindingArgs(
* type="RESTART_NODE_ON_MINIMAL_SERVERS",
* ))
* ```
* ```csharp
* 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",
* },
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```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()
* .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());
* }
* }
* ```
* ```yaml
* 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:
* ```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}}
* ```
* @property cpuOvercommitType CPU overcommit.
* Default value is `NONE`.
* Possible values are: `ENABLED`, `NONE`.
* @property description An optional textual description of the resource.
* @property name Name of the resource.
* @property nodeAffinityLabels Labels to use for node affinity, which will be used in
* instance scheduling.
* @property nodeType Node type to use for nodes group that are created from this template.
* Only one of nodeTypeFlexibility and nodeType can be specified.
* @property nodeTypeFlexibility 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.
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @property region Region where nodes using the node template will be created.
* If it is not provided, the provider region is used.
* @property serverBinding The server binding policy for nodes using this template. Determines
* where the nodes should restart following a maintenance event.
* Structure is documented below.
*/
public data class NodeTemplateArgs(
public val cpuOvercommitType: Output? = null,
public val description: Output? = null,
public val name: Output? = null,
public val nodeAffinityLabels: Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy