Hetzner Cloud v1.21.1 published on Friday, Nov 22, 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 a specific Datacenter.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
const byId = hcloud.getDatacenter({
id: 4,
});
const byName = hcloud.getDatacenter({
name: "fsn1-dc14",
});
import pulumi
import pulumi_hcloud as hcloud
by_id = hcloud.get_datacenter(id=4)
by_name = hcloud.get_datacenter(name="fsn1-dc14")
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{
Id: pulumi.IntRef(4),
}, nil)
if err != nil {
return err
}
_, err = hcloud.GetDatacenter(ctx, &hcloud.GetDatacenterArgs{
Name: pulumi.StringRef("fsn1-dc14"),
}, 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 byId = HCloud.GetDatacenter.Invoke(new()
{
Id = 4,
});
var byName = HCloud.GetDatacenter.Invoke(new()
{
Name = "fsn1-dc14",
});
});
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 byId = HcloudFunctions.getDatacenter(GetDatacenterArgs.builder()
.id(4)
.build());
final var byName = HcloudFunctions.getDatacenter(GetDatacenterArgs.builder()
.name("fsn1-dc14")
.build());
}
}
variables:
byId:
fn::invoke:
Function: hcloud:getDatacenter
Arguments:
id: 4
byName:
fn::invoke:
Function: hcloud:getDatacenter
Arguments:
name: fsn1-dc14
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:
getDatacenter Result
The following output properties are available:
- Available
Server List<int>Type Ids - List of currently available Server Types in the Datacenter.
- Description string
- Description of the Datacenter.
- Location Dictionary<string, string>
- Location of the Datacenter. See the Hetzner Docs for more details about locations.
- Supported
Server List<int>Type Ids - List of supported Server Types in the Datacenter.
- Id int
- ID of the Datacenter.
- Name string
- Name of the Datacenter.
- Available
Server []intType Ids - List of currently available Server Types in the Datacenter.
- Description string
- Description of the Datacenter.
- Location map[string]string
- Location of the Datacenter. See the Hetzner Docs for more details about locations.
- Supported
Server []intType Ids - List of supported Server Types in the Datacenter.
- Id int
- ID of the Datacenter.
- Name string
- Name of the Datacenter.
- available
Server List<Integer>Type Ids - List of currently available Server Types in the Datacenter.
- description String
- Description of the Datacenter.
- location Map<String,String>
- Location of the Datacenter. See the Hetzner Docs for more details about locations.
- supported
Server List<Integer>Type Ids - List of supported Server Types in the Datacenter.
- id Integer
- ID of the Datacenter.
- name String
- Name of the Datacenter.
- available
Server number[]Type Ids - List of currently available Server Types in the Datacenter.
- description string
- Description of the Datacenter.
- location {[key: string]: string}
- Location of the Datacenter. See the Hetzner Docs for more details about locations.
- supported
Server number[]Type Ids - List of supported Server Types in the Datacenter.
- id number
- ID of the Datacenter.
- name string
- Name of the Datacenter.
- available_
server_ Sequence[int]type_ ids - List of currently available Server Types in the Datacenter.
- description str
- Description of the Datacenter.
- location Mapping[str, str]
- Location of the Datacenter. See the Hetzner Docs for more details about locations.
- supported_
server_ Sequence[int]type_ ids - List of supported Server Types in the Datacenter.
- id int
- ID of the Datacenter.
- name str
- Name of the Datacenter.
- available
Server List<Number>Type Ids - List of currently available Server Types in the Datacenter.
- description String
- Description of the Datacenter.
- location Map<String>
- Location of the Datacenter. See the Hetzner Docs for more details about locations.
- supported
Server List<Number>Type Ids - List of supported Server Types in the Datacenter.
- id Number
- ID of the Datacenter.
- name String
- Name of the Datacenter.
Package Details
- Repository
- Hetzner Cloud pulumi/pulumi-hcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
hcloud
Terraform Provider.