Hetzner Cloud

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

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/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := hcloud.GetDatacenter(ctx, &GetDatacenterArgs{
			Name: pulumi.StringRef("fsn1-dc8"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = hcloud.GetDatacenter(ctx, &GetDatacenterArgs{
			Id: pulumi.IntRef(4),
		}, 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.getDatacenter(GetDatacenterArgs.builder()
            .name("fsn1-dc8")
            .build()));

        final var ds2 = Output.of(HcloudFunctions.getDatacenter(GetDatacenterArgs.builder()
            .id(4)
            .build()));

    }
}
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",
}));
const ds2 = pulumi.output(hcloud.getDatacenter({
    id: 4,
}));
variables:
  ds1:
    Fn::Invoke:
      Function: hcloud:getDatacenter
      Arguments:
        name: fsn1-dc8
  ds2:
    Fn::Invoke:
      Function: hcloud:getDatacenter
      Arguments:
        id: 4

Using getDatacenter

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 getDatacenter(args: GetDatacenterArgs, opts?: InvokeOptions): Promise<GetDatacenterResult>
function getDatacenterOutput(args: GetDatacenterOutputArgs, opts?: InvokeOptions): Output<GetDatacenterResult>
def get_datacenter(id: Optional[int] = None,
                   name: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetDatacenterResult
def get_datacenter_output(id: Optional[pulumi.Input[int]] = None,
                   name: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetDatacenterResult]
func GetDatacenter(ctx *Context, args *GetDatacenterArgs, opts ...InvokeOption) (*GetDatacenterResult, error)
func GetDatacenterOutput(ctx *Context, args *GetDatacenterOutputArgs, opts ...InvokeOption) GetDatacenterResultOutput

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

public static class GetDatacenter 
{
    public static Task<GetDatacenterResult> InvokeAsync(GetDatacenterArgs args, InvokeOptions? opts = null)
    public static Output<GetDatacenterResult> Invoke(GetDatacenterInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDatacenterResult> getDatacenter(GetDatacenterArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: hcloud:index/getDatacenter:getDatacenter
  Arguments:
    # Arguments dictionary

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 Integer

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.

id Number

ID of the datacenter.

name String

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 List<Integer>

(list) List of available server types.

description String

(string) Description of the datacenter.

id Integer

(int) Unique ID of the datacenter.

location Map<String,Object>

(map) Physical datacenter location.

name String

(string) Name of the datacenter.

supportedServerTypeIds List<Integer>

(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.

availableServerTypeIds List<Number>

(list) List of available server types.

description String

(string) Description of the datacenter.

id Number

(int) Unique ID of the datacenter.

location Map<Any>

(map) Physical datacenter location.

name String

(string) Name of the datacenter.

supportedServerTypeIds List<Number>

(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.