GetLocation

Provides details about a specific Hetzner Cloud Location. Use this resource to get detailed information about specific location.

Example Usage

using Pulumi;
using HCloud = Pulumi.HCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var l1 = Output.Create(HCloud.GetLocation.InvokeAsync(new HCloud.GetLocationArgs
        {
            Name = "fsn1",
        }));
        var l2 = Output.Create(HCloud.GetLocation.InvokeAsync(new HCloud.GetLocationArgs
        {
            Id = 1,
        }));
    }

}
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"
        _, err := hcloud.GetLocation(ctx, &hcloud.GetLocationArgs{
            Name: &opt0,
        }, nil)
        if err != nil {
            return err
        }
        opt1 := 1
        _, err = hcloud.GetLocation(ctx, &hcloud.GetLocationArgs{
            Id: &opt1,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_hcloud as hcloud

l1 = hcloud.get_location(name="fsn1")
l2 = hcloud.get_location(id=1)
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

const l1 = pulumi.output(hcloud.getLocation({
    name: "fsn1",
}, { async: true }));
const l2 = pulumi.output(hcloud.getLocation({
    id: 1,
}, { async: true }));

Using GetLocation

function getLocation(args: GetLocationArgs, opts?: InvokeOptions): Promise<GetLocationResult>
function  get_location(id=None, name=None, opts=None)
func GetLocation(ctx *Context, args *GetLocationArgs, opts ...InvokeOption) (*GetLocationResult, error)
public static class GetLocation {
    public static Task<GetLocationResult> InvokeAsync(GetLocationArgs 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

GetLocation Result

The following output properties are available:

City string
Country string
Description string
Id int
Latitude double
Longitude double
Name string
City string
Country string
Description string
Id int
Latitude float64
Longitude float64
Name string
city string
country string
description string
id number
latitude number
longitude number
name string
city str
country str
description str
id float
latitude float
longitude float
name str

Package Details

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