get Node Types
Provides available node types for Compute Engine sole-tenant nodes in a zone for a given project. For more information, see the official documentation and API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const central1b = gcp.compute.getNodeTypes({
zone: "us-central1-b",
});
const tmpl = new gcp.compute.NodeTemplate("tmpl", {
name: "test-tmpl",
region: "us-central1",
nodeType: types.names[0],
});
import pulumi
import pulumi_gcp as gcp
central1b = gcp.compute.get_node_types(zone="us-central1-b")
tmpl = gcp.compute.NodeTemplate("tmpl",
name="test-tmpl",
region="us-central1",
node_type=types["names"][0])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var central1b = Gcp.Compute.GetNodeTypes.Invoke(new()
{
Zone = "us-central1-b",
});
var tmpl = new Gcp.Compute.NodeTemplate("tmpl", new()
{
Name = "test-tmpl",
Region = "us-central1",
NodeType = types.Names[0],
});
});
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-b"),
}, nil)
if err != nil {
return err
}
_, err = compute.NewNodeTemplate(ctx, "tmpl", &compute.NodeTemplateArgs{
Name: pulumi.String("test-tmpl"),
Region: pulumi.String("us-central1"),
NodeType: pulumi.Any(types.Names[0]),
})
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 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 central1b = ComputeFunctions.getNodeTypes(GetNodeTypesArgs.builder()
.zone("us-central1-b")
.build());
var tmpl = new NodeTemplate("tmpl", NodeTemplateArgs.builder()
.name("test-tmpl")
.region("us-central1")
.nodeType(types.names()[0])
.build());
}
}
resources:
tmpl:
type: gcp:compute:NodeTemplate
properties:
name: test-tmpl
region: us-central1
nodeType: ${types.names[0]}
variables:
central1b:
fn::invoke:
function: gcp:compute:getNodeTypes
arguments:
zone: us-central1-b
Return
A collection of values returned by getNodeTypes.
Parameters
A collection of arguments for invoking getNodeTypes.
Return
A collection of values returned by getNodeTypes.
Parameters
ID of the project to list available node types for. Should match the project the nodes of this type will be deployed to. Defaults to the project that the provider is authenticated with.
The zone to list node types for. Should be in zone of intended node groups and region of referencing node template. If zone
is not specified, the provider-level zone must be set and is used instead.
See also
Return
A collection of values returned by getNodeTypes.
Parameters
Builder for com.pulumi.gcp.compute.kotlin.inputs.GetNodeTypesPlainArgs.