hcloud logo
Hetzner Cloud v1.10.3, Mar 8 23

hcloud.getServerType

Provides details about a specific Hetzner Cloud Server Type. Use this resource to get detailed information about specific Server Type.

Example Usage

using System.Collections.Generic;
using Pulumi;
using HCloud = Pulumi.HCloud;

return await Deployment.RunAsync(() => 
{
    var ds1 = HCloud.GetServerType.Invoke(new()
    {
        Name = "cx11",
    });

    var ds2 = HCloud.GetServerType.Invoke(new()
    {
        Id = 1,
    });

});
package main

import (
	"github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := hcloud.GetServerType(ctx, &hcloud.GetServerTypeArgs{
			Name: pulumi.StringRef("cx11"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = hcloud.GetServerType(ctx, &hcloud.GetServerTypeArgs{
			Id: pulumi.IntRef(1),
		}, nil)
		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.hcloud.HcloudFunctions;
import com.pulumi.hcloud.inputs.GetServerTypeArgs;
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 ds1 = HcloudFunctions.getServerType(GetServerTypeArgs.builder()
            .name("cx11")
            .build());

        final var ds2 = HcloudFunctions.getServerType(GetServerTypeArgs.builder()
            .id(1)
            .build());

    }
}
import pulumi
import pulumi_hcloud as hcloud

ds1 = hcloud.get_server_type(name="cx11")
ds2 = hcloud.get_server_type(id=1)
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

const ds1 = hcloud.getServerType({
    name: "cx11",
});
const ds2 = hcloud.getServerType({
    id: 1,
});
variables:
  ds1:
    fn::invoke:
      Function: hcloud:getServerType
      Arguments:
        name: cx11
  ds2:
    fn::invoke:
      Function: hcloud:getServerType
      Arguments:
        id: 1

Using getServerType

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 getServerType(args: GetServerTypeArgs, opts?: InvokeOptions): Promise<GetServerTypeResult>
function getServerTypeOutput(args: GetServerTypeOutputArgs, opts?: InvokeOptions): Output<GetServerTypeResult>
def get_server_type(id: Optional[int] = None,
                    name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetServerTypeResult
def get_server_type_output(id: Optional[pulumi.Input[int]] = None,
                    name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetServerTypeResult]
func GetServerType(ctx *Context, args *GetServerTypeArgs, opts ...InvokeOption) (*GetServerTypeResult, error)
func GetServerTypeOutput(ctx *Context, args *GetServerTypeOutputArgs, opts ...InvokeOption) GetServerTypeResultOutput

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

public static class GetServerType 
{
    public static Task<GetServerTypeResult> InvokeAsync(GetServerTypeArgs args, InvokeOptions? opts = null)
    public static Output<GetServerTypeResult> Invoke(GetServerTypeInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetServerTypeResult> getServerType(GetServerTypeArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: hcloud:index/getServerType:getServerType
  arguments:
    # arguments dictionary

The following arguments are supported:

Id int

ID of the server_type.

Name string

Name of the server_type.

Id int

ID of the server_type.

Name string

Name of the server_type.

id Integer

ID of the server_type.

name String

Name of the server_type.

id number

ID of the server_type.

name string

Name of the server_type.

id int

ID of the server_type.

name str

Name of the server_type.

id Number

ID of the server_type.

name String

Name of the server_type.

getServerType Result

The following output properties are available:

Cores int

(int) Number of cpu cores a Server of this type will have.

CpuType string
Description string

(string) Description of the server_type.

Disk int

(int) Disk size a Server of this type will have in GB.

Id int

(int) Unique ID of the server_type.

Memory int

(int) Memory a Server of this type will have in GB.

Name string

(string) Name of the server_type.

StorageType string
Cores int

(int) Number of cpu cores a Server of this type will have.

CpuType string
Description string

(string) Description of the server_type.

Disk int

(int) Disk size a Server of this type will have in GB.

Id int

(int) Unique ID of the server_type.

Memory int

(int) Memory a Server of this type will have in GB.

Name string

(string) Name of the server_type.

StorageType string
cores Integer

(int) Number of cpu cores a Server of this type will have.

cpuType String
description String

(string) Description of the server_type.

disk Integer

(int) Disk size a Server of this type will have in GB.

id Integer

(int) Unique ID of the server_type.

memory Integer

(int) Memory a Server of this type will have in GB.

name String

(string) Name of the server_type.

storageType String
cores number

(int) Number of cpu cores a Server of this type will have.

cpuType string
description string

(string) Description of the server_type.

disk number

(int) Disk size a Server of this type will have in GB.

id number

(int) Unique ID of the server_type.

memory number

(int) Memory a Server of this type will have in GB.

name string

(string) Name of the server_type.

storageType string
cores int

(int) Number of cpu cores a Server of this type will have.

cpu_type str
description str

(string) Description of the server_type.

disk int

(int) Disk size a Server of this type will have in GB.

id int

(int) Unique ID of the server_type.

memory int

(int) Memory a Server of this type will have in GB.

name str

(string) Name of the server_type.

storage_type str
cores Number

(int) Number of cpu cores a Server of this type will have.

cpuType String
description String

(string) Description of the server_type.

disk Number

(int) Disk size a Server of this type will have in GB.

id Number

(int) Unique ID of the server_type.

memory Number

(int) Memory a Server of this type will have in GB.

name String

(string) Name of the server_type.

storageType String

Package Details

Repository
Hetzner Cloud pulumi/pulumi-hcloud
License
Apache-2.0
Notes

This Pulumi package is based on the hcloud Terraform Provider.