1. Packages
  2. Hcloud Provider
Hetzner Cloud v1.21.1 published on Friday, Nov 22, 2024 by Pulumi

Hcloud Provider

hcloud logo
Hetzner Cloud v1.21.1 published on Friday, Nov 22, 2024 by Pulumi

    Installation

    The hcloud provider is available as a package in all Pulumi languages:

    Overview

    The Hetzner Cloud (hcloud) provider is used to interact with the resources supported by Hetzner Cloud. The provider needs to be configured with the proper credentials before it can be used.

    Use the navigation to the left to read about the available resources.

    Example Usage

    # Pulumi.yaml provider configuration file
    name: configuration-example
    runtime: nodejs
    config:
        hcloud:token:
            value: 'TODO: var.hcloud_token'
    
    import * as pulumi from "@pulumi/pulumi";
    
    const config = new pulumi.Config();
    const hcloudToken = config.requireObject("hcloudToken");
    
    # Pulumi.yaml provider configuration file
    name: configuration-example
    runtime: python
    config:
        hcloud:token:
            value: 'TODO: var.hcloud_token'
    
    import pulumi
    
    config = pulumi.Config()
    hcloud_token = config.require_object("hcloudToken")
    
    # Pulumi.yaml provider configuration file
    name: configuration-example
    runtime: dotnet
    config:
        hcloud:token:
            value: 'TODO: var.hcloud_token'
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    
    return await Deployment.RunAsync(() =>
    {
        var config = new Config();
        var hcloudToken = config.RequireObject<dynamic>("hcloudToken");
    });
    
    # Pulumi.yaml provider configuration file
    name: configuration-example
    runtime: go
    config:
        hcloud:token:
            value: 'TODO: var.hcloud_token'
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		hcloudToken := cfg.RequireObject("hcloudToken")
    		return nil
    	})
    }
    
    # Pulumi.yaml provider configuration file
    name: configuration-example
    runtime: yaml
    config:
        hcloud:token:
            value: 'TODO: var.hcloud_token'
    
    configuration:
      # Set the variable value in *.tfvars file
      # or using the -var="hcloud_token=..." CLI option
      hcloudToken:
        type: dynamic
    
    # Pulumi.yaml provider configuration file
    name: configuration-example
    runtime: java
    config:
        hcloud:token:
            value: 'TODO: var.hcloud_token'
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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 config = ctx.config();
            final var hcloudToken = config.get("hcloudToken");
        }
    }
    

    Configuration Reference

    The following configuration inputs are supported:

    • token - (Required, string) This is the Hetzner Cloud API Token, can also be specified with the HCLOUD_TOKEN environment variable.
    • endpoint - (Optional, string) Hetzner Cloud API endpoint, can be used to override the default API Endpoint https://api.hetzner.cloud/v1.
    • pollInterval - (Optional, string) Configures the interval in which actions are polled by the client. Default 500ms. Increase this interval if you run into rate limiting errors.
    • pollFunction - (Optional, string) Configures the type of function to be used during the polling. Valid values are constant and exponential. Default exponential.
    hcloud logo
    Hetzner Cloud v1.21.1 published on Friday, Nov 22, 2024 by Pulumi