@puls-dev/hcloud
v1.0.1
Published
Hetzner Cloud (HCloud) Provider for Puls IaC
Downloads
460
Maintainers
Readme
@puls-dev/hcloud
Hetzner Cloud (HCloud) Provider for Puls IaC. Declare servers, networks, firewalls, and SSH keys in strongly-typed TypeScript.
What is @puls-dev/hcloud?
This package is the official Hetzner Cloud provider plug-in for Puls. It manages HCloud resources securely by resolving live states directly through the Hetzner Cloud REST APIs.
Available Builders
HCloud.Server: Provision cloud servers (analogous to Droplets) with support for SSH keys, server types, locations, and our signature Ansible playbook provisioning.HCloud.SSHKey: Register SSH public keys on your Hetzner Cloud account.HCloud.Network: Create private networks (VPCs) with custom IP ranges.HCloud.Firewall: Define inbound/outbound firewall rules.
Installation
npm install @puls-dev/core @puls-dev/hcloudQuick Example
import { Stack, Deploy } from "@puls-dev/core";
import { HCloud, SERVER_TYPE, LOCATION, OS_IMAGE } from "@puls-dev/hcloud";
@Deploy()
class MyStack extends Stack {
key = HCloud.SSHKey("my-key")
.publicKey("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL...");
net = HCloud.Network("private-net")
.ipRange("10.0.0.0/16");
web = HCloud.Server("web-server")
.serverType(SERVER_TYPE.CX22)
.image(OS_IMAGE.UBUNTU_24_04)
.location(LOCATION.NBG1)
.sshKeys([this.key])
.networks([this.net])
.provision(["playbooks/web.yml"]);
}Authentication
Declare your Hetzner Cloud API token in your `.env` file:
HCLOUD_TOKEN=your-hetzner-cloud-api-tokenLearn more at pulsdev.io/providers/hcloud.
