Hetzner Cloud

v1.10.1 published on Wednesday, Aug 3, 2022 by Pulumi

getServerType

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

Example Usage

using Pulumi;
using HCloud = Pulumi.HCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var ds1 = Output.Create(HCloud.GetServerType.InvokeAsync(new HCloud.GetServerTypeArgs
        {
            Name = "cx11",
        }));
        var ds2 = Output.Create(HCloud.GetServerType.InvokeAsync(new HCloud.GetServerTypeArgs
        {
            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, &GetServerTypeArgs{
			Name: pulumi.StringRef("cx11"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = hcloud.GetServerType(ctx, &GetServerTypeArgs{
			Id: pulumi.IntRef(1),
		}, nil)
		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 ds1 = Output.of(HcloudFunctions.getServerType(GetServerTypeArgs.builder()
            .name("cx11")
            .build()));

        final var ds2 = Output.of(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 = pulumi.output(hcloud.getServerType({
    name: "cx11",
}));
const ds2 = pulumi.output(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
https://github.com/pulumi/pulumi-hcloud
License
Apache-2.0
Notes

This Pulumi package is based on the hcloud Terraform Provider.