Hetzner Cloud v1.19.1 published on Friday, May 10, 2024 by Pulumi
hcloud.getDatacenter
Explore with Pulumi AI
Provides details about a specific Hetzner Cloud Datacenter. Use this resource to get detailed information about specific datacenter.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
const ds1 = hcloud.getDatacenter({
    name: "fsn1-dc8",
});
const ds2 = hcloud.getDatacenter({
    id: 4,
});
import pulumi
import pulumi_hcloud as hcloud
ds1 = hcloud.get_datacenter(name="fsn1-dc8")
ds2 = hcloud.get_datacenter(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, &hcloud.GetDatacenterArgs{
			Name: pulumi.StringRef("fsn1-dc8"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = hcloud.GetDatacenter(ctx, &hcloud.GetDatacenterArgs{
			Id: pulumi.IntRef(4),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using HCloud = Pulumi.HCloud;
return await Deployment.RunAsync(() => 
{
    var ds1 = HCloud.GetDatacenter.Invoke(new()
    {
        Name = "fsn1-dc8",
    });
    var ds2 = HCloud.GetDatacenter.Invoke(new()
    {
        Id = 4,
    });
});
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.GetDatacenterArgs;
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.getDatacenter(GetDatacenterArgs.builder()
            .name("fsn1-dc8")
            .build());
        final var ds2 = HcloudFunctions.getDatacenter(GetDatacenterArgs.builder()
            .id(4)
            .build());
    }
}
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 dictionaryThe following arguments are supported:
getDatacenter Result
The following output properties are available:
- Available
Server List<int>Type Ids  - (list) List of available server types.
 - Description string
 - (string) Description of the datacenter.
 - Id int
 - (int) Unique ID of the datacenter.
 - Location Dictionary<string, string>
 - (map) Physical datacenter location.
 - Name string
 - (string) Name of the datacenter.
 - Supported
Server List<int>Type Ids  - (list) List of server types supported by the datacenter.
 
- Available
Server []intType Ids  - (list) List of available server types.
 - Description string
 - (string) Description of the datacenter.
 - Id int
 - (int) Unique ID of the datacenter.
 - Location map[string]string
 - (map) Physical datacenter location.
 - Name string
 - (string) Name of the datacenter.
 - Supported
Server []intType Ids  - (list) List of server types supported by the datacenter.
 
- available
Server List<Integer>Type Ids  - (list) List of available server types.
 - description String
 - (string) Description of the datacenter.
 - id Integer
 - (int) Unique ID of the datacenter.
 - location Map<String,String>
 - (map) Physical datacenter location.
 - name String
 - (string) Name of the datacenter.
 - supported
Server List<Integer>Type Ids  - (list) List of server types supported by the datacenter.
 
- available
Server number[]Type Ids  - (list) List of available server types.
 - description string
 - (string) Description of the datacenter.
 - id number
 - (int) Unique ID of the datacenter.
 - location {[key: string]: string}
 - (map) Physical datacenter location.
 - name string
 - (string) Name of the datacenter.
 - supported
Server number[]Type Ids  - (list) List of server types supported by the datacenter.
 
- available_
server_ Sequence[int]type_ ids  - (list) List of available server types.
 - description str
 - (string) Description of the datacenter.
 - id int
 - (int) Unique ID of the datacenter.
 - location Mapping[str, str]
 - (map) Physical datacenter location.
 - name str
 - (string) Name of the datacenter.
 - supported_
server_ Sequence[int]type_ ids  - (list) List of server types supported by the datacenter.
 
- available
Server List<Number>Type Ids  - (list) List of available server types.
 - description String
 - (string) Description of the datacenter.
 - id Number
 - (int) Unique ID of the datacenter.
 - location Map<String>
 - (map) Physical datacenter location.
 - name String
 - (string) Name of the datacenter.
 - supported
Server List<Number>Type Ids  - (list) List of server types supported by the datacenter.
 
Package Details
- Repository
 - Hetzner Cloud pulumi/pulumi-hcloud
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
hcloudTerraform Provider.