Google Cloud (GCP) Classic

Pulumi Official
Package maintained by Pulumi
v6.32.0 published on Wednesday, Jul 20, 2022 by Pulumi

getNodeTypes

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

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
    public MyStack()
    {
        var central1b = Output.Create(Gcp.Compute.GetNodeTypes.InvokeAsync(new Gcp.Compute.GetNodeTypesArgs
        {
            Zone = "us-central1-b",
        }));
        var tmpl = new Gcp.Compute.NodeTemplate("tmpl", new Gcp.Compute.NodeTemplateArgs
        {
            Region = "us-central1",
            NodeType = data.Google_compute_node_types.Types.Names[0],
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/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{
			Region:   pulumi.String("us-central1"),
			NodeType: pulumi.Any(data.Google_compute_node_types.Types.Names[0]),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var central1b = Output.of(ComputeFunctions.getNodeTypes(GetNodeTypesArgs.builder()
            .zone("us-central1-b")
            .build()));

        var tmpl = new NodeTemplate("tmpl", NodeTemplateArgs.builder()        
            .region("us-central1")
            .nodeType(data.google_compute_node_types().types().names()[0])
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

central1b = gcp.compute.get_node_types(zone="us-central1-b")
tmpl = gcp.compute.NodeTemplate("tmpl",
    region="us-central1",
    node_type=data["google_compute_node_types"]["types"]["names"])
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", {
    region: "us-central1",
    nodeType: data.google_compute_node_types.types.names[0],
});
resources:
  tmpl:
    type: gcp:compute:NodeTemplate
    properties:
      region: us-central1
      nodeType: ${data.google_compute_node_types.types.names[0]}
variables:
  central1b:
    Fn::Invoke:
      Function: gcp:compute:getNodeTypes
      Arguments:
        zone: us-central1-b

Using getNodeTypes

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getNodeTypes(args: GetNodeTypesArgs, opts?: InvokeOptions): Promise<GetNodeTypesResult>
function getNodeTypesOutput(args: GetNodeTypesOutputArgs, opts?: InvokeOptions): Output<GetNodeTypesResult>
def get_node_types(project: Optional[str] = None,
                   zone: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetNodeTypesResult
def get_node_types_output(project: Optional[pulumi.Input[str]] = None,
                   zone: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetNodeTypesResult]
func GetNodeTypes(ctx *Context, args *GetNodeTypesArgs, opts ...InvokeOption) (*GetNodeTypesResult, error)
func GetNodeTypesOutput(ctx *Context, args *GetNodeTypesOutputArgs, opts ...InvokeOption) GetNodeTypesResultOutput

> Note: This function is named GetNodeTypes in the Go SDK.

public static class GetNodeTypes 
{
    public static Task<GetNodeTypesResult> InvokeAsync(GetNodeTypesArgs args, InvokeOptions? opts = null)
    public static Output<GetNodeTypesResult> Invoke(GetNodeTypesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNodeTypesResult> getNodeTypes(GetNodeTypesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: gcp:compute/getNodeTypes:getNodeTypes
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Project string

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.

Zone string

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.

Project string

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.

Zone string

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.

project String

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.

zone String

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.

project string

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.

zone string

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.

project str

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.

zone str

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.

project String

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.

zone String

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.

getNodeTypes Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Names List<string>

A list of node types available in the given zone and project.

Project string
Zone string
Id string

The provider-assigned unique ID for this managed resource.

Names []string

A list of node types available in the given zone and project.

Project string
Zone string
id String

The provider-assigned unique ID for this managed resource.

names List<String>

A list of node types available in the given zone and project.

project String
zone String
id string

The provider-assigned unique ID for this managed resource.

names string[]

A list of node types available in the given zone and project.

project string
zone string
id str

The provider-assigned unique ID for this managed resource.

names Sequence[str]

A list of node types available in the given zone and project.

project str
zone str
id String

The provider-assigned unique ID for this managed resource.

names List<String>

A list of node types available in the given zone and project.

project String
zone String

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.