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>
function  get_datacenter(id=None, name=None, opts=None)
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
Name string
Id int
Name string
id number
name string
id float
name str

GetDatacenter Result

The following output properties are available:

AvailableServerTypeIds List<int>
Description string
Id int
Location Dictionary<string, object>
Name string
SupportedServerTypeIds List<int>
AvailableServerTypeIds []int
Description string
Id int
Location map[string]interface{}
Name string
SupportedServerTypeIds []int
availableServerTypeIds number[]
description string
id number
location {[key: string]: any}
name string
supportedServerTypeIds number[]
available_server_type_ids List[Integer]
description str
id float
location Dict[str, Any]
name str
supported_server_type_ids List[Integer]

Package Details

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