Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

GetDatacenter

Provides details about a specific Hetzner Cloud Datacenter. Use this resource to get detailed information about specific datacenter.

Example Usage

using Pulumi;
using HCloud = Pulumi.HCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var ds1 = Output.Create(HCloud.GetDatacenter.InvokeAsync(new HCloud.GetDatacenterArgs
        {
            Name = "fsn1-dc8",
        }));
        var ds2 = Output.Create(HCloud.GetDatacenter.InvokeAsync(new HCloud.GetDatacenterArgs
        {
            Id = 4,
        }));
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := "fsn1-dc8"
        _, err := hcloud.GetDatacenter(ctx, &hcloud.GetDatacenterArgs{
            Name: &opt0,
        }, nil)
        if err != nil {
            return err
        }
        opt1 := 4
        _, err = hcloud.GetDatacenter(ctx, &hcloud.GetDatacenterArgs{
            Id: &opt1,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_hcloud as hcloud

ds1 = hcloud.get_datacenter(name="fsn1-dc8")
ds2 = hcloud.get_datacenter(id=4)
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

const ds1 = pulumi.output(hcloud.getDatacenter({
    name: "fsn1-dc8",
}, { async: true }));
const ds2 = pulumi.output(hcloud.getDatacenter({
    id: 4,
}, { async: true }));

Using GetDatacenter

function getDatacenter(args: GetDatacenterArgs, opts?: InvokeOptions): Promise<GetDatacenterResult>
def get_datacenter(id: Optional[int] = None, name: Optional[str] = None, opts: Optional[InvokeOptions] = None) -> GetDatacenterResult
func GetDatacenter(ctx *Context, args *GetDatacenterArgs, opts ...InvokeOption) (*GetDatacenterResult, error)
public static class GetDatacenter {
    public static Task<GetDatacenterResult> InvokeAsync(GetDatacenterArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Id int

ID of the datacenter.

Name string

Name of the datacenter.

Id int

ID of the datacenter.

Name string

Name of the datacenter.

id number

ID of the datacenter.

name string

Name of the datacenter.

id int

ID of the datacenter.

name str

Name of the datacenter.

GetDatacenter Result

The following output properties are available:

AvailableServerTypeIds List<int>

(list) List of available server types.

Description string

(string) Description of the datacenter.

Id int

(int) Unique ID of the datacenter.

Location Dictionary<string, object>

(map) Physical datacenter location.

Name string

(string) Name of the datacenter.

SupportedServerTypeIds List<int>

(list) List of server types supported by the datacenter.

AvailableServerTypeIds []int

(list) List of available server types.

Description string

(string) Description of the datacenter.

Id int

(int) Unique ID of the datacenter.

Location map[string]interface{}

(map) Physical datacenter location.

Name string

(string) Name of the datacenter.

SupportedServerTypeIds []int

(list) List of server types supported by the datacenter.

availableServerTypeIds number[]

(list) List of available server types.

description string

(string) Description of the datacenter.

id number

(int) Unique ID of the datacenter.

location {[key: string]: any}

(map) Physical datacenter location.

name string

(string) Name of the datacenter.

supportedServerTypeIds number[]

(list) List of server types supported by the datacenter.

available_server_type_ids Sequence[int]

(list) List of available server types.

description str

(string) Description of the datacenter.

id int

(int) Unique ID of the datacenter.

location Mapping[str, Any]

(map) Physical datacenter location.

name str

(string) Name of the datacenter.

supported_server_type_ids Sequence[int]

(list) List of server types supported by the datacenter.

Package Details

Repository
https://github.com/pulumi/pulumi-hcloud
License
Apache-2.0
Notes
This Pulumi package is based on the hcloud Terraform Provider.