hcloud.Server
Explore with Pulumi AI
Provides an Hetzner Cloud server resource. This can be used to create, modify, and delete servers. Servers also support provisioning.
Primary IPs
When creating a server without linking at least one ´primary_ip´, it automatically creates & assigns two (ipv4 & ipv6). With the public_net block, you can enable or link primary ips. If you don’t define this block, two primary ips (ipv4, ipv6) will be created and assigned to the server automatically.
Examples
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
// Assign existing ipv4 only
const serverTestServer = new hcloud.Server("serverTestServer", {publicNets: [{
ipv4Enabled: true,
ipv4: hcloud_primary_ip.primary_ip_1.id,
ipv6Enabled: false,
}]});
//...
// Link a managed ipv4 but autogenerate ipv6
const serverTestIndex_serverServer = new hcloud.Server("serverTestIndex/serverServer", {publicNets: [{
ipv4Enabled: true,
ipv4: hcloud_primary_ip.primary_ip_1.id,
ipv6Enabled: false,
}]});
//...
// Assign & create auto-generated ipv4 & ipv6
const serverTestHcloudIndex_serverServer = new hcloud.Server("serverTestHcloudIndex/serverServer", {publicNets: [{
ipv4Enabled: true,
ipv6Enabled: true,
}]});
//...
import pulumi
import pulumi_hcloud as hcloud
# Assign existing ipv4 only
server_test_server = hcloud.Server("serverTestServer", public_nets=[hcloud.ServerPublicNetArgs(
ipv4_enabled=True,
ipv4=hcloud_primary_ip["primary_ip_1"]["id"],
ipv6_enabled=False,
)])
#...
# Link a managed ipv4 but autogenerate ipv6
server_test_index_server_server = hcloud.Server("serverTestIndex/serverServer", public_nets=[hcloud.ServerPublicNetArgs(
ipv4_enabled=True,
ipv4=hcloud_primary_ip["primary_ip_1"]["id"],
ipv6_enabled=False,
)])
#...
# Assign & create auto-generated ipv4 & ipv6
server_test_hcloud_index_server_server = hcloud.Server("serverTestHcloudIndex/serverServer", public_nets=[hcloud.ServerPublicNetArgs(
ipv4_enabled=True,
ipv6_enabled=True,
)])
#...
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using HCloud = Pulumi.HCloud;
return await Deployment.RunAsync(() =>
{
// Assign existing ipv4 only
var serverTestServer = new HCloud.Server("serverTestServer", new()
{
PublicNets = new[]
{
new HCloud.Inputs.ServerPublicNetArgs
{
Ipv4Enabled = true,
Ipv4 = hcloud_primary_ip.Primary_ip_1.Id,
Ipv6Enabled = false,
},
},
});
//...
// Link a managed ipv4 but autogenerate ipv6
var serverTestIndex_serverServer = new HCloud.Server("serverTestIndex/serverServer", new()
{
PublicNets = new[]
{
new HCloud.Inputs.ServerPublicNetArgs
{
Ipv4Enabled = true,
Ipv4 = hcloud_primary_ip.Primary_ip_1.Id,
Ipv6Enabled = false,
},
},
});
//...
// Assign & create auto-generated ipv4 & ipv6
var serverTestHcloudIndex_serverServer = new HCloud.Server("serverTestHcloudIndex/serverServer", new()
{
PublicNets = new[]
{
new HCloud.Inputs.ServerPublicNetArgs
{
Ipv4Enabled = true,
Ipv6Enabled = true,
},
},
});
//...
});
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.NewServer(ctx, "serverTestServer", &hcloud.ServerArgs{
PublicNets: hcloud.ServerPublicNetArray{
&hcloud.ServerPublicNetArgs{
Ipv4Enabled: pulumi.Bool(true),
Ipv4: pulumi.Any(hcloud_primary_ip.Primary_ip_1.Id),
Ipv6Enabled: pulumi.Bool(false),
},
},
})
if err != nil {
return err
}
_, err = hcloud.NewServer(ctx, "serverTestIndex/serverServer", &hcloud.ServerArgs{
PublicNets: hcloud.ServerPublicNetArray{
&hcloud.ServerPublicNetArgs{
Ipv4Enabled: pulumi.Bool(true),
Ipv4: pulumi.Any(hcloud_primary_ip.Primary_ip_1.Id),
Ipv6Enabled: pulumi.Bool(false),
},
},
})
if err != nil {
return err
}
_, err = hcloud.NewServer(ctx, "serverTestHcloudIndex/serverServer", &hcloud.ServerArgs{
PublicNets: hcloud.ServerPublicNetArray{
&hcloud.ServerPublicNetArgs{
Ipv4Enabled: pulumi.Bool(true),
Ipv6Enabled: pulumi.Bool(true),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hcloud.Server;
import com.pulumi.hcloud.ServerArgs;
import com.pulumi.hcloud.inputs.ServerPublicNetArgs;
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) {
var serverTestServer = new Server("serverTestServer", ServerArgs.builder()
.publicNets(ServerPublicNetArgs.builder()
.ipv4Enabled(true)
.ipv4(hcloud_primary_ip.primary_ip_1().id())
.ipv6Enabled(false)
.build())
.build());
var serverTestIndex_serverServer = new Server("serverTestIndex/serverServer", ServerArgs.builder()
.publicNets(ServerPublicNetArgs.builder()
.ipv4Enabled(true)
.ipv4(hcloud_primary_ip.primary_ip_1().id())
.ipv6Enabled(false)
.build())
.build());
var serverTestHcloudIndex_serverServer = new Server("serverTestHcloudIndex/serverServer", ServerArgs.builder()
.publicNets(ServerPublicNetArgs.builder()
.ipv4Enabled(true)
.ipv6Enabled(true)
.build())
.build());
}
}
resources:
# Assign existing ipv4 only
serverTestServer:
type: hcloud:Server
properties:
# ...
publicNets:
- ipv4Enabled: true
ipv4: ${hcloud_primary_ip.primary_ip_1.id}
ipv6Enabled: false
# Link a managed ipv4 but autogenerate ipv6
serverTestIndex/serverServer:
type: hcloud:Server
properties:
# ...
publicNets:
- ipv4Enabled: true
ipv4: ${hcloud_primary_ip.primary_ip_1.id}
ipv6Enabled: false
# Assign & create auto-generated ipv4 & ipv6
serverTestHcloudIndex/serverServer:
type: hcloud:Server
properties:
# ...
publicNets:
- ipv4Enabled: true
ipv6Enabled: true
Example Usage
Server creation with network
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using HCloud = Pulumi.HCloud;
return await Deployment.RunAsync(() =>
{
var network = new HCloud.Network("network", new()
{
IpRange = "10.0.0.0/16",
});
var network_subnet = new HCloud.NetworkSubnet("network-subnet", new()
{
Type = "cloud",
NetworkId = network.Id,
NetworkZone = "eu-central",
IpRange = "10.0.1.0/24",
});
var server = new HCloud.Server("server", new()
{
ServerType = "cx11",
Image = "ubuntu-20.04",
Location = "nbg1",
Networks = new[]
{
new HCloud.Inputs.ServerNetworkArgs
{
NetworkId = network.Id,
Ip = "10.0.1.5",
AliasIps = new[]
{
"10.0.1.6",
"10.0.1.7",
},
},
},
}, new CustomResourceOptions
{
DependsOn = new[]
{
network_subnet,
},
});
});
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 {
network, err := hcloud.NewNetwork(ctx, "network", &hcloud.NetworkArgs{
IpRange: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
_, err = hcloud.NewNetworkSubnet(ctx, "network-subnet", &hcloud.NetworkSubnetArgs{
Type: pulumi.String("cloud"),
NetworkId: network.ID(),
NetworkZone: pulumi.String("eu-central"),
IpRange: pulumi.String("10.0.1.0/24"),
})
if err != nil {
return err
}
_, err = hcloud.NewServer(ctx, "server", &hcloud.ServerArgs{
ServerType: pulumi.String("cx11"),
Image: pulumi.String("ubuntu-20.04"),
Location: pulumi.String("nbg1"),
Networks: hcloud.ServerNetworkTypeArray{
&hcloud.ServerNetworkTypeArgs{
NetworkId: network.ID(),
Ip: pulumi.String("10.0.1.5"),
AliasIps: pulumi.StringArray{
pulumi.String("10.0.1.6"),
pulumi.String("10.0.1.7"),
},
},
},
}, pulumi.DependsOn([]pulumi.Resource{
network_subnet,
}))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hcloud.Network;
import com.pulumi.hcloud.NetworkArgs;
import com.pulumi.hcloud.NetworkSubnet;
import com.pulumi.hcloud.NetworkSubnetArgs;
import com.pulumi.hcloud.Server;
import com.pulumi.hcloud.ServerArgs;
import com.pulumi.hcloud.inputs.ServerNetworkArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
var network = new Network("network", NetworkArgs.builder()
.ipRange("10.0.0.0/16")
.build());
var network_subnet = new NetworkSubnet("network-subnet", NetworkSubnetArgs.builder()
.type("cloud")
.networkId(network.id())
.networkZone("eu-central")
.ipRange("10.0.1.0/24")
.build());
var server = new Server("server", ServerArgs.builder()
.serverType("cx11")
.image("ubuntu-20.04")
.location("nbg1")
.networks(ServerNetworkArgs.builder()
.networkId(network.id())
.ip("10.0.1.5")
.aliasIps(
"10.0.1.6",
"10.0.1.7")
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(network_subnet)
.build());
}
}
import pulumi
import pulumi_hcloud as hcloud
network = hcloud.Network("network", ip_range="10.0.0.0/16")
network_subnet = hcloud.NetworkSubnet("network-subnet",
type="cloud",
network_id=network.id,
network_zone="eu-central",
ip_range="10.0.1.0/24")
server = hcloud.Server("server",
server_type="cx11",
image="ubuntu-20.04",
location="nbg1",
networks=[hcloud.ServerNetworkArgs(
network_id=network.id,
ip="10.0.1.5",
alias_ips=[
"10.0.1.6",
"10.0.1.7",
],
)],
opts=pulumi.ResourceOptions(depends_on=[network_subnet]))
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
const network = new hcloud.Network("network", {ipRange: "10.0.0.0/16"});
const network_subnet = new hcloud.NetworkSubnet("network-subnet", {
type: "cloud",
networkId: network.id,
networkZone: "eu-central",
ipRange: "10.0.1.0/24",
});
const server = new hcloud.Server("server", {
serverType: "cx11",
image: "ubuntu-20.04",
location: "nbg1",
networks: [{
networkId: network.id,
ip: "10.0.1.5",
aliasIps: [
"10.0.1.6",
"10.0.1.7",
],
}],
}, {
dependsOn: [network_subnet],
});
resources:
network:
type: hcloud:Network
properties:
ipRange: 10.0.0.0/16
network-subnet:
type: hcloud:NetworkSubnet
properties:
type: cloud
networkId: ${network.id}
networkZone: eu-central
ipRange: 10.0.1.0/24
server:
type: hcloud:Server
properties:
serverType: cx11
image: ubuntu-20.04
location: nbg1
networks:
- networkId: ${network.id}
ip: 10.0.1.5
aliasIps:
- 10.0.1.6
- 10.0.1.7
options:
dependson:
- ${["network-subnet"]}
Server creation from snapshot
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using HCloud = Pulumi.HCloud;
return await Deployment.RunAsync(() =>
{
var packerSnapshot = HCloud.GetImage.Invoke(new()
{
WithSelector = "app=foobar",
MostRecent = true,
});
// Create a new server from the snapshot
var fromSnapshot = new HCloud.Server("fromSnapshot", new()
{
Image = packerSnapshot.Apply(getImageResult => getImageResult.Id),
ServerType = "cx11",
PublicNets = new[]
{
new HCloud.Inputs.ServerPublicNetArgs
{
Ipv4Enabled = true,
Ipv6Enabled = true,
},
},
});
});
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 {
packerSnapshot, err := hcloud.GetImage(ctx, &hcloud.GetImageArgs{
WithSelector: pulumi.StringRef("app=foobar"),
MostRecent: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
_, err = hcloud.NewServer(ctx, "fromSnapshot", &hcloud.ServerArgs{
Image: *pulumi.Int(packerSnapshot.Id),
ServerType: pulumi.String("cx11"),
PublicNets: hcloud.ServerPublicNetArray{
&hcloud.ServerPublicNetArgs{
Ipv4Enabled: pulumi.Bool(true),
Ipv6Enabled: pulumi.Bool(true),
},
},
})
if err != nil {
return err
}
return nil
})
}
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.GetImageArgs;
import com.pulumi.hcloud.Server;
import com.pulumi.hcloud.ServerArgs;
import com.pulumi.hcloud.inputs.ServerPublicNetArgs;
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 packerSnapshot = HcloudFunctions.getImage(GetImageArgs.builder()
.withSelector("app=foobar")
.mostRecent(true)
.build());
var fromSnapshot = new Server("fromSnapshot", ServerArgs.builder()
.image(packerSnapshot.applyValue(getImageResult -> getImageResult.id()))
.serverType("cx11")
.publicNets(ServerPublicNetArgs.builder()
.ipv4Enabled(true)
.ipv6Enabled(true)
.build())
.build());
}
}
import pulumi
import pulumi_hcloud as hcloud
packer_snapshot = hcloud.get_image(with_selector="app=foobar",
most_recent=True)
# Create a new server from the snapshot
from_snapshot = hcloud.Server("fromSnapshot",
image=packer_snapshot.id,
server_type="cx11",
public_nets=[hcloud.ServerPublicNetArgs(
ipv4_enabled=True,
ipv6_enabled=True,
)])
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
const packerSnapshot = hcloud.getImage({
withSelector: "app=foobar",
mostRecent: true,
});
// Create a new server from the snapshot
const fromSnapshot = new hcloud.Server("fromSnapshot", {
image: packerSnapshot.then(packerSnapshot => packerSnapshot.id),
serverType: "cx11",
publicNets: [{
ipv4Enabled: true,
ipv6Enabled: true,
}],
});
resources:
# Create a new server from the snapshot
fromSnapshot:
type: hcloud:Server
properties:
image: ${packerSnapshot.id}
serverType: cx11
publicNets:
- ipv4Enabled: true
ipv6Enabled: true
variables:
packerSnapshot:
fn::invoke:
Function: hcloud:getImage
Arguments:
withSelector: app=foobar
mostRecent: true
Examples
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using HCloud = Pulumi.HCloud;
return await Deployment.RunAsync(() =>
{
// Assign existing ipv4 only
var serverTestServer = new HCloud.Server("serverTestServer", new()
{
PublicNets = new[]
{
new HCloud.Inputs.ServerPublicNetArgs
{
Ipv4Enabled = true,
Ipv4 = hcloud_primary_ip.Primary_ip_1.Id,
Ipv6Enabled = false,
},
},
});
//...
// Link a managed ipv4 but autogenerate ipv6
var serverTestIndex_serverServer = new HCloud.Server("serverTestIndex/serverServer", new()
{
PublicNets = new[]
{
new HCloud.Inputs.ServerPublicNetArgs
{
Ipv4Enabled = true,
Ipv4 = hcloud_primary_ip.Primary_ip_1.Id,
Ipv6Enabled = false,
},
},
});
//...
// Assign & create auto-generated ipv4 & ipv6
var serverTestHcloudIndex_serverServer = new HCloud.Server("serverTestHcloudIndex/serverServer", new()
{
PublicNets = new[]
{
new HCloud.Inputs.ServerPublicNetArgs
{
Ipv4Enabled = true,
Ipv6Enabled = true,
},
},
});
//...
});
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.NewServer(ctx, "serverTestServer", &hcloud.ServerArgs{
PublicNets: hcloud.ServerPublicNetArray{
&hcloud.ServerPublicNetArgs{
Ipv4Enabled: pulumi.Bool(true),
Ipv4: pulumi.Any(hcloud_primary_ip.Primary_ip_1.Id),
Ipv6Enabled: pulumi.Bool(false),
},
},
})
if err != nil {
return err
}
_, err = hcloud.NewServer(ctx, "serverTestIndex/serverServer", &hcloud.ServerArgs{
PublicNets: hcloud.ServerPublicNetArray{
&hcloud.ServerPublicNetArgs{
Ipv4Enabled: pulumi.Bool(true),
Ipv4: pulumi.Any(hcloud_primary_ip.Primary_ip_1.Id),
Ipv6Enabled: pulumi.Bool(false),
},
},
})
if err != nil {
return err
}
_, err = hcloud.NewServer(ctx, "serverTestHcloudIndex/serverServer", &hcloud.ServerArgs{
PublicNets: hcloud.ServerPublicNetArray{
&hcloud.ServerPublicNetArgs{
Ipv4Enabled: pulumi.Bool(true),
Ipv6Enabled: pulumi.Bool(true),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hcloud.Server;
import com.pulumi.hcloud.ServerArgs;
import com.pulumi.hcloud.inputs.ServerPublicNetArgs;
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) {
var serverTestServer = new Server("serverTestServer", ServerArgs.builder()
.publicNets(ServerPublicNetArgs.builder()
.ipv4Enabled(true)
.ipv4(hcloud_primary_ip.primary_ip_1().id())
.ipv6Enabled(false)
.build())
.build());
var serverTestIndex_serverServer = new Server("serverTestIndex/serverServer", ServerArgs.builder()
.publicNets(ServerPublicNetArgs.builder()
.ipv4Enabled(true)
.ipv4(hcloud_primary_ip.primary_ip_1().id())
.ipv6Enabled(false)
.build())
.build());
var serverTestHcloudIndex_serverServer = new Server("serverTestHcloudIndex/serverServer", ServerArgs.builder()
.publicNets(ServerPublicNetArgs.builder()
.ipv4Enabled(true)
.ipv6Enabled(true)
.build())
.build());
}
}
import pulumi
import pulumi_hcloud as hcloud
# Assign existing ipv4 only
server_test_server = hcloud.Server("serverTestServer", public_nets=[hcloud.ServerPublicNetArgs(
ipv4_enabled=True,
ipv4=hcloud_primary_ip["primary_ip_1"]["id"],
ipv6_enabled=False,
)])
#...
# Link a managed ipv4 but autogenerate ipv6
server_test_index_server_server = hcloud.Server("serverTestIndex/serverServer", public_nets=[hcloud.ServerPublicNetArgs(
ipv4_enabled=True,
ipv4=hcloud_primary_ip["primary_ip_1"]["id"],
ipv6_enabled=False,
)])
#...
# Assign & create auto-generated ipv4 & ipv6
server_test_hcloud_index_server_server = hcloud.Server("serverTestHcloudIndex/serverServer", public_nets=[hcloud.ServerPublicNetArgs(
ipv4_enabled=True,
ipv6_enabled=True,
)])
#...
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
// Assign existing ipv4 only
const serverTestServer = new hcloud.Server("serverTestServer", {publicNets: [{
ipv4Enabled: true,
ipv4: hcloud_primary_ip.primary_ip_1.id,
ipv6Enabled: false,
}]});
//...
// Link a managed ipv4 but autogenerate ipv6
const serverTestIndex_serverServer = new hcloud.Server("serverTestIndex/serverServer", {publicNets: [{
ipv4Enabled: true,
ipv4: hcloud_primary_ip.primary_ip_1.id,
ipv6Enabled: false,
}]});
//...
// Assign & create auto-generated ipv4 & ipv6
const serverTestHcloudIndex_serverServer = new hcloud.Server("serverTestHcloudIndex/serverServer", {publicNets: [{
ipv4Enabled: true,
ipv6Enabled: true,
}]});
//...
resources:
# Assign existing ipv4 only
serverTestServer:
type: hcloud:Server
properties:
# ...
publicNets:
- ipv4Enabled: true
ipv4: ${hcloud_primary_ip.primary_ip_1.id}
ipv6Enabled: false
# Link a managed ipv4 but autogenerate ipv6
serverTestIndex/serverServer:
type: hcloud:Server
properties:
# ...
publicNets:
- ipv4Enabled: true
ipv4: ${hcloud_primary_ip.primary_ip_1.id}
ipv6Enabled: false
# Assign & create auto-generated ipv4 & ipv6
serverTestHcloudIndex/serverServer:
type: hcloud:Server
properties:
# ...
publicNets:
- ipv4Enabled: true
ipv6Enabled: true
Create Server Resource
new Server(name: string, args: ServerArgs, opts?: CustomResourceOptions);
@overload
def Server(resource_name: str,
opts: Optional[ResourceOptions] = None,
allow_deprecated_images: Optional[bool] = None,
backups: Optional[bool] = None,
datacenter: Optional[str] = None,
delete_protection: Optional[bool] = None,
firewall_ids: Optional[Sequence[int]] = None,
ignore_remote_firewall_ids: Optional[bool] = None,
image: Optional[str] = None,
iso: Optional[str] = None,
keep_disk: Optional[bool] = None,
labels: Optional[Mapping[str, Any]] = None,
location: Optional[str] = None,
name: Optional[str] = None,
networks: Optional[Sequence[ServerNetworkArgs]] = None,
placement_group_id: Optional[int] = None,
public_nets: Optional[Sequence[ServerPublicNetArgs]] = None,
rebuild_protection: Optional[bool] = None,
rescue: Optional[str] = None,
server_type: Optional[str] = None,
ssh_keys: Optional[Sequence[str]] = None,
user_data: Optional[str] = None)
@overload
def Server(resource_name: str,
args: ServerArgs,
opts: Optional[ResourceOptions] = None)
func NewServer(ctx *Context, name string, args ServerArgs, opts ...ResourceOption) (*Server, error)
public Server(string name, ServerArgs args, CustomResourceOptions? opts = null)
public Server(String name, ServerArgs args)
public Server(String name, ServerArgs args, CustomResourceOptions options)
type: hcloud:Server
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ServerArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ServerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServerArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Server Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Server resource accepts the following input properties:
- Server
Type string Name of the server type this server should be created with.
- Allow
Deprecated boolImages Enable the use of deprecated images (default: false). Note Deprecated images will be removed after three months. Using them is then no longer possible.
- Backups bool
Enable or disable backups.
- Datacenter string
The datacenter name to create the server in.
nbg1-dc3
,fsn1-dc14
,hel1-dc2
,ash-dc1
orhil-dc1
- Delete
Protection bool Enable or disable delete protection (Needs to be the same as
rebuild_protection
).- Firewall
Ids List<int> Firewall IDs the server should be attached to on creation.
- Ignore
Remote boolFirewall Ids Ignores any updates to the
firewall_ids
argument which were received from the server. This should not be used in normal cases. See the documentation of thehcloud.FirewallAttachment
resource for a reason to use this argument.- Image string
(string) Name or ID of the image the server was created from.
- Iso string
ID or Name of an ISO image to mount.
- Keep
Disk bool If true, do not upgrade the disk. This allows downgrading the server type later.
- Labels Dictionary<string, object>
User-defined labels (key-value pairs) should be created with.
- Location string
The location name to create the server in.
nbg1
,fsn1
,hel1
,ash
orhil
- Name string
Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
- Networks
List<Pulumi.
HCloud. Inputs. Server Network> Network the server should be attached to on creation. (Can be specified multiple times)
- Placement
Group intId Placement Group ID the server added to on creation.
- Public
Nets List<Pulumi.HCloud. Inputs. Server Public Net> In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples). If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
- Rebuild
Protection bool Enable or disable rebuild protection (Needs to be the same as
delete_protection
).- Rescue string
Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems.
linux64
orlinux32
- Ssh
Keys List<string> SSH key IDs or names which should be injected into the server at creation time
- User
Data string Cloud-Init user data to use during server creation
- Server
Type string Name of the server type this server should be created with.
- Allow
Deprecated boolImages Enable the use of deprecated images (default: false). Note Deprecated images will be removed after three months. Using them is then no longer possible.
- Backups bool
Enable or disable backups.
- Datacenter string
The datacenter name to create the server in.
nbg1-dc3
,fsn1-dc14
,hel1-dc2
,ash-dc1
orhil-dc1
- Delete
Protection bool Enable or disable delete protection (Needs to be the same as
rebuild_protection
).- Firewall
Ids []int Firewall IDs the server should be attached to on creation.
- Ignore
Remote boolFirewall Ids Ignores any updates to the
firewall_ids
argument which were received from the server. This should not be used in normal cases. See the documentation of thehcloud.FirewallAttachment
resource for a reason to use this argument.- Image string
(string) Name or ID of the image the server was created from.
- Iso string
ID or Name of an ISO image to mount.
- Keep
Disk bool If true, do not upgrade the disk. This allows downgrading the server type later.
- Labels map[string]interface{}
User-defined labels (key-value pairs) should be created with.
- Location string
The location name to create the server in.
nbg1
,fsn1
,hel1
,ash
orhil
- Name string
Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
- Networks
[]Server
Network Type Args Network the server should be attached to on creation. (Can be specified multiple times)
- Placement
Group intId Placement Group ID the server added to on creation.
- Public
Nets []ServerPublic Net Args In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples). If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
- Rebuild
Protection bool Enable or disable rebuild protection (Needs to be the same as
delete_protection
).- Rescue string
Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems.
linux64
orlinux32
- Ssh
Keys []string SSH key IDs or names which should be injected into the server at creation time
- User
Data string Cloud-Init user data to use during server creation
- server
Type String Name of the server type this server should be created with.
- allow
Deprecated BooleanImages Enable the use of deprecated images (default: false). Note Deprecated images will be removed after three months. Using them is then no longer possible.
- backups Boolean
Enable or disable backups.
- datacenter String
The datacenter name to create the server in.
nbg1-dc3
,fsn1-dc14
,hel1-dc2
,ash-dc1
orhil-dc1
- delete
Protection Boolean Enable or disable delete protection (Needs to be the same as
rebuild_protection
).- firewall
Ids List<Integer> Firewall IDs the server should be attached to on creation.
- ignore
Remote BooleanFirewall Ids Ignores any updates to the
firewall_ids
argument which were received from the server. This should not be used in normal cases. See the documentation of thehcloud.FirewallAttachment
resource for a reason to use this argument.- image String
(string) Name or ID of the image the server was created from.
- iso String
ID or Name of an ISO image to mount.
- keep
Disk Boolean If true, do not upgrade the disk. This allows downgrading the server type later.
- labels Map<String,Object>
User-defined labels (key-value pairs) should be created with.
- location String
The location name to create the server in.
nbg1
,fsn1
,hel1
,ash
orhil
- name String
Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
- networks
List<Server
Network> Network the server should be attached to on creation. (Can be specified multiple times)
- placement
Group IntegerId Placement Group ID the server added to on creation.
- public
Nets List<ServerPublic Net> In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples). If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
- rebuild
Protection Boolean Enable or disable rebuild protection (Needs to be the same as
delete_protection
).- rescue String
Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems.
linux64
orlinux32
- ssh
Keys List<String> SSH key IDs or names which should be injected into the server at creation time
- user
Data String Cloud-Init user data to use during server creation
- server
Type string Name of the server type this server should be created with.
- allow
Deprecated booleanImages Enable the use of deprecated images (default: false). Note Deprecated images will be removed after three months. Using them is then no longer possible.
- backups boolean
Enable or disable backups.
- datacenter string
The datacenter name to create the server in.
nbg1-dc3
,fsn1-dc14
,hel1-dc2
,ash-dc1
orhil-dc1
- delete
Protection boolean Enable or disable delete protection (Needs to be the same as
rebuild_protection
).- firewall
Ids number[] Firewall IDs the server should be attached to on creation.
- ignore
Remote booleanFirewall Ids Ignores any updates to the
firewall_ids
argument which were received from the server. This should not be used in normal cases. See the documentation of thehcloud.FirewallAttachment
resource for a reason to use this argument.- image string
(string) Name or ID of the image the server was created from.
- iso string
ID or Name of an ISO image to mount.
- keep
Disk boolean If true, do not upgrade the disk. This allows downgrading the server type later.
- labels {[key: string]: any}
User-defined labels (key-value pairs) should be created with.
- location string
The location name to create the server in.
nbg1
,fsn1
,hel1
,ash
orhil
- name string
Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
- networks
Server
Network[] Network the server should be attached to on creation. (Can be specified multiple times)
- placement
Group numberId Placement Group ID the server added to on creation.
- public
Nets ServerPublic Net[] In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples). If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
- rebuild
Protection boolean Enable or disable rebuild protection (Needs to be the same as
delete_protection
).- rescue string
Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems.
linux64
orlinux32
- ssh
Keys string[] SSH key IDs or names which should be injected into the server at creation time
- user
Data string Cloud-Init user data to use during server creation
- server_
type str Name of the server type this server should be created with.
- allow_
deprecated_ boolimages Enable the use of deprecated images (default: false). Note Deprecated images will be removed after three months. Using them is then no longer possible.
- backups bool
Enable or disable backups.
- datacenter str
The datacenter name to create the server in.
nbg1-dc3
,fsn1-dc14
,hel1-dc2
,ash-dc1
orhil-dc1
- delete_
protection bool Enable or disable delete protection (Needs to be the same as
rebuild_protection
).- firewall_
ids Sequence[int] Firewall IDs the server should be attached to on creation.
- ignore_
remote_ boolfirewall_ ids Ignores any updates to the
firewall_ids
argument which were received from the server. This should not be used in normal cases. See the documentation of thehcloud.FirewallAttachment
resource for a reason to use this argument.- image str
(string) Name or ID of the image the server was created from.
- iso str
ID or Name of an ISO image to mount.
- keep_
disk bool If true, do not upgrade the disk. This allows downgrading the server type later.
- labels Mapping[str, Any]
User-defined labels (key-value pairs) should be created with.
- location str
The location name to create the server in.
nbg1
,fsn1
,hel1
,ash
orhil
- name str
Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
- networks
Sequence[Server
Network Args] Network the server should be attached to on creation. (Can be specified multiple times)
- placement_
group_ intid Placement Group ID the server added to on creation.
- public_
nets Sequence[ServerPublic Net Args] In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples). If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
- rebuild_
protection bool Enable or disable rebuild protection (Needs to be the same as
delete_protection
).- rescue str
Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems.
linux64
orlinux32
- ssh_
keys Sequence[str] SSH key IDs or names which should be injected into the server at creation time
- user_
data str Cloud-Init user data to use during server creation
- server
Type String Name of the server type this server should be created with.
- allow
Deprecated BooleanImages Enable the use of deprecated images (default: false). Note Deprecated images will be removed after three months. Using them is then no longer possible.
- backups Boolean
Enable or disable backups.
- datacenter String
The datacenter name to create the server in.
nbg1-dc3
,fsn1-dc14
,hel1-dc2
,ash-dc1
orhil-dc1
- delete
Protection Boolean Enable or disable delete protection (Needs to be the same as
rebuild_protection
).- firewall
Ids List<Number> Firewall IDs the server should be attached to on creation.
- ignore
Remote BooleanFirewall Ids Ignores any updates to the
firewall_ids
argument which were received from the server. This should not be used in normal cases. See the documentation of thehcloud.FirewallAttachment
resource for a reason to use this argument.- image String
(string) Name or ID of the image the server was created from.
- iso String
ID or Name of an ISO image to mount.
- keep
Disk Boolean If true, do not upgrade the disk. This allows downgrading the server type later.
- labels Map<Any>
User-defined labels (key-value pairs) should be created with.
- location String
The location name to create the server in.
nbg1
,fsn1
,hel1
,ash
orhil
- name String
Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
- networks List<Property Map>
Network the server should be attached to on creation. (Can be specified multiple times)
- placement
Group NumberId Placement Group ID the server added to on creation.
- public
Nets List<Property Map> In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples). If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
- rebuild
Protection Boolean Enable or disable rebuild protection (Needs to be the same as
delete_protection
).- rescue String
Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems.
linux64
orlinux32
- ssh
Keys List<String> SSH key IDs or names which should be injected into the server at creation time
- user
Data String Cloud-Init user data to use during server creation
Outputs
All input properties are implicitly available as output properties. Additionally, the Server resource produces the following output properties:
- Backup
Window string (string) The backup window of the server, if enabled.
You should remove this property from your terraform configuration.
- Id string
The provider-assigned unique ID for this managed resource.
- Ipv4Address string
(string) The IPv4 address.
- Ipv6Address string
(string) The first IPv6 address of the assigned network.
- Ipv6Network string
(string) The IPv6 network.
- Status string
(string) The status of the server.
- Backup
Window string (string) The backup window of the server, if enabled.
You should remove this property from your terraform configuration.
- Id string
The provider-assigned unique ID for this managed resource.
- Ipv4Address string
(string) The IPv4 address.
- Ipv6Address string
(string) The first IPv6 address of the assigned network.
- Ipv6Network string
(string) The IPv6 network.
- Status string
(string) The status of the server.
- backup
Window String (string) The backup window of the server, if enabled.
You should remove this property from your terraform configuration.
- id String
The provider-assigned unique ID for this managed resource.
- ipv4Address String
(string) The IPv4 address.
- ipv6Address String
(string) The first IPv6 address of the assigned network.
- ipv6Network String
(string) The IPv6 network.
- status String
(string) The status of the server.
- backup
Window string (string) The backup window of the server, if enabled.
You should remove this property from your terraform configuration.
- id string
The provider-assigned unique ID for this managed resource.
- ipv4Address string
(string) The IPv4 address.
- ipv6Address string
(string) The first IPv6 address of the assigned network.
- ipv6Network string
(string) The IPv6 network.
- status string
(string) The status of the server.
- backup_
window str (string) The backup window of the server, if enabled.
You should remove this property from your terraform configuration.
- id str
The provider-assigned unique ID for this managed resource.
- ipv4_
address str (string) The IPv4 address.
- ipv6_
address str (string) The first IPv6 address of the assigned network.
- ipv6_
network str (string) The IPv6 network.
- status str
(string) The status of the server.
- backup
Window String (string) The backup window of the server, if enabled.
You should remove this property from your terraform configuration.
- id String
The provider-assigned unique ID for this managed resource.
- ipv4Address String
(string) The IPv4 address.
- ipv6Address String
(string) The first IPv6 address of the assigned network.
- ipv6Network String
(string) The IPv6 network.
- status String
(string) The status of the server.
Look up Existing Server Resource
Get an existing Server resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ServerState, opts?: CustomResourceOptions): Server
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
allow_deprecated_images: Optional[bool] = None,
backup_window: Optional[str] = None,
backups: Optional[bool] = None,
datacenter: Optional[str] = None,
delete_protection: Optional[bool] = None,
firewall_ids: Optional[Sequence[int]] = None,
ignore_remote_firewall_ids: Optional[bool] = None,
image: Optional[str] = None,
ipv4_address: Optional[str] = None,
ipv6_address: Optional[str] = None,
ipv6_network: Optional[str] = None,
iso: Optional[str] = None,
keep_disk: Optional[bool] = None,
labels: Optional[Mapping[str, Any]] = None,
location: Optional[str] = None,
name: Optional[str] = None,
networks: Optional[Sequence[ServerNetworkArgs]] = None,
placement_group_id: Optional[int] = None,
public_nets: Optional[Sequence[ServerPublicNetArgs]] = None,
rebuild_protection: Optional[bool] = None,
rescue: Optional[str] = None,
server_type: Optional[str] = None,
ssh_keys: Optional[Sequence[str]] = None,
status: Optional[str] = None,
user_data: Optional[str] = None) -> Server
func GetServer(ctx *Context, name string, id IDInput, state *ServerState, opts ...ResourceOption) (*Server, error)
public static Server Get(string name, Input<string> id, ServerState? state, CustomResourceOptions? opts = null)
public static Server get(String name, Output<String> id, ServerState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Allow
Deprecated boolImages Enable the use of deprecated images (default: false). Note Deprecated images will be removed after three months. Using them is then no longer possible.
- Backup
Window string (string) The backup window of the server, if enabled.
You should remove this property from your terraform configuration.
- Backups bool
Enable or disable backups.
- Datacenter string
The datacenter name to create the server in.
nbg1-dc3
,fsn1-dc14
,hel1-dc2
,ash-dc1
orhil-dc1
- Delete
Protection bool Enable or disable delete protection (Needs to be the same as
rebuild_protection
).- Firewall
Ids List<int> Firewall IDs the server should be attached to on creation.
- Ignore
Remote boolFirewall Ids Ignores any updates to the
firewall_ids
argument which were received from the server. This should not be used in normal cases. See the documentation of thehcloud.FirewallAttachment
resource for a reason to use this argument.- Image string
(string) Name or ID of the image the server was created from.
- Ipv4Address string
(string) The IPv4 address.
- Ipv6Address string
(string) The first IPv6 address of the assigned network.
- Ipv6Network string
(string) The IPv6 network.
- Iso string
ID or Name of an ISO image to mount.
- Keep
Disk bool If true, do not upgrade the disk. This allows downgrading the server type later.
- Labels Dictionary<string, object>
User-defined labels (key-value pairs) should be created with.
- Location string
The location name to create the server in.
nbg1
,fsn1
,hel1
,ash
orhil
- Name string
Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
- Networks
List<Pulumi.
HCloud. Inputs. Server Network> Network the server should be attached to on creation. (Can be specified multiple times)
- Placement
Group intId Placement Group ID the server added to on creation.
- Public
Nets List<Pulumi.HCloud. Inputs. Server Public Net> In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples). If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
- Rebuild
Protection bool Enable or disable rebuild protection (Needs to be the same as
delete_protection
).- Rescue string
Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems.
linux64
orlinux32
- Server
Type string Name of the server type this server should be created with.
- Ssh
Keys List<string> SSH key IDs or names which should be injected into the server at creation time
- Status string
(string) The status of the server.
- User
Data string Cloud-Init user data to use during server creation
- Allow
Deprecated boolImages Enable the use of deprecated images (default: false). Note Deprecated images will be removed after three months. Using them is then no longer possible.
- Backup
Window string (string) The backup window of the server, if enabled.
You should remove this property from your terraform configuration.
- Backups bool
Enable or disable backups.
- Datacenter string
The datacenter name to create the server in.
nbg1-dc3
,fsn1-dc14
,hel1-dc2
,ash-dc1
orhil-dc1
- Delete
Protection bool Enable or disable delete protection (Needs to be the same as
rebuild_protection
).- Firewall
Ids []int Firewall IDs the server should be attached to on creation.
- Ignore
Remote boolFirewall Ids Ignores any updates to the
firewall_ids
argument which were received from the server. This should not be used in normal cases. See the documentation of thehcloud.FirewallAttachment
resource for a reason to use this argument.- Image string
(string) Name or ID of the image the server was created from.
- Ipv4Address string
(string) The IPv4 address.
- Ipv6Address string
(string) The first IPv6 address of the assigned network.
- Ipv6Network string
(string) The IPv6 network.
- Iso string
ID or Name of an ISO image to mount.
- Keep
Disk bool If true, do not upgrade the disk. This allows downgrading the server type later.
- Labels map[string]interface{}
User-defined labels (key-value pairs) should be created with.
- Location string
The location name to create the server in.
nbg1
,fsn1
,hel1
,ash
orhil
- Name string
Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
- Networks
[]Server
Network Type Args Network the server should be attached to on creation. (Can be specified multiple times)
- Placement
Group intId Placement Group ID the server added to on creation.
- Public
Nets []ServerPublic Net Args In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples). If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
- Rebuild
Protection bool Enable or disable rebuild protection (Needs to be the same as
delete_protection
).- Rescue string
Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems.
linux64
orlinux32
- Server
Type string Name of the server type this server should be created with.
- Ssh
Keys []string SSH key IDs or names which should be injected into the server at creation time
- Status string
(string) The status of the server.
- User
Data string Cloud-Init user data to use during server creation
- allow
Deprecated BooleanImages Enable the use of deprecated images (default: false). Note Deprecated images will be removed after three months. Using them is then no longer possible.
- backup
Window String (string) The backup window of the server, if enabled.
You should remove this property from your terraform configuration.
- backups Boolean
Enable or disable backups.
- datacenter String
The datacenter name to create the server in.
nbg1-dc3
,fsn1-dc14
,hel1-dc2
,ash-dc1
orhil-dc1
- delete
Protection Boolean Enable or disable delete protection (Needs to be the same as
rebuild_protection
).- firewall
Ids List<Integer> Firewall IDs the server should be attached to on creation.
- ignore
Remote BooleanFirewall Ids Ignores any updates to the
firewall_ids
argument which were received from the server. This should not be used in normal cases. See the documentation of thehcloud.FirewallAttachment
resource for a reason to use this argument.- image String
(string) Name or ID of the image the server was created from.
- ipv4Address String
(string) The IPv4 address.
- ipv6Address String
(string) The first IPv6 address of the assigned network.
- ipv6Network String
(string) The IPv6 network.
- iso String
ID or Name of an ISO image to mount.
- keep
Disk Boolean If true, do not upgrade the disk. This allows downgrading the server type later.
- labels Map<String,Object>
User-defined labels (key-value pairs) should be created with.
- location String
The location name to create the server in.
nbg1
,fsn1
,hel1
,ash
orhil
- name String
Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
- networks
List<Server
Network> Network the server should be attached to on creation. (Can be specified multiple times)
- placement
Group IntegerId Placement Group ID the server added to on creation.
- public
Nets List<ServerPublic Net> In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples). If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
- rebuild
Protection Boolean Enable or disable rebuild protection (Needs to be the same as
delete_protection
).- rescue String
Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems.
linux64
orlinux32
- server
Type String Name of the server type this server should be created with.
- ssh
Keys List<String> SSH key IDs or names which should be injected into the server at creation time
- status String
(string) The status of the server.
- user
Data String Cloud-Init user data to use during server creation
- allow
Deprecated booleanImages Enable the use of deprecated images (default: false). Note Deprecated images will be removed after three months. Using them is then no longer possible.
- backup
Window string (string) The backup window of the server, if enabled.
You should remove this property from your terraform configuration.
- backups boolean
Enable or disable backups.
- datacenter string
The datacenter name to create the server in.
nbg1-dc3
,fsn1-dc14
,hel1-dc2
,ash-dc1
orhil-dc1
- delete
Protection boolean Enable or disable delete protection (Needs to be the same as
rebuild_protection
).- firewall
Ids number[] Firewall IDs the server should be attached to on creation.
- ignore
Remote booleanFirewall Ids Ignores any updates to the
firewall_ids
argument which were received from the server. This should not be used in normal cases. See the documentation of thehcloud.FirewallAttachment
resource for a reason to use this argument.- image string
(string) Name or ID of the image the server was created from.
- ipv4Address string
(string) The IPv4 address.
- ipv6Address string
(string) The first IPv6 address of the assigned network.
- ipv6Network string
(string) The IPv6 network.
- iso string
ID or Name of an ISO image to mount.
- keep
Disk boolean If true, do not upgrade the disk. This allows downgrading the server type later.
- labels {[key: string]: any}
User-defined labels (key-value pairs) should be created with.
- location string
The location name to create the server in.
nbg1
,fsn1
,hel1
,ash
orhil
- name string
Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
- networks
Server
Network[] Network the server should be attached to on creation. (Can be specified multiple times)
- placement
Group numberId Placement Group ID the server added to on creation.
- public
Nets ServerPublic Net[] In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples). If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
- rebuild
Protection boolean Enable or disable rebuild protection (Needs to be the same as
delete_protection
).- rescue string
Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems.
linux64
orlinux32
- server
Type string Name of the server type this server should be created with.
- ssh
Keys string[] SSH key IDs or names which should be injected into the server at creation time
- status string
(string) The status of the server.
- user
Data string Cloud-Init user data to use during server creation
- allow_
deprecated_ boolimages Enable the use of deprecated images (default: false). Note Deprecated images will be removed after three months. Using them is then no longer possible.
- backup_
window str (string) The backup window of the server, if enabled.
You should remove this property from your terraform configuration.
- backups bool
Enable or disable backups.
- datacenter str
The datacenter name to create the server in.
nbg1-dc3
,fsn1-dc14
,hel1-dc2
,ash-dc1
orhil-dc1
- delete_
protection bool Enable or disable delete protection (Needs to be the same as
rebuild_protection
).- firewall_
ids Sequence[int] Firewall IDs the server should be attached to on creation.
- ignore_
remote_ boolfirewall_ ids Ignores any updates to the
firewall_ids
argument which were received from the server. This should not be used in normal cases. See the documentation of thehcloud.FirewallAttachment
resource for a reason to use this argument.- image str
(string) Name or ID of the image the server was created from.
- ipv4_
address str (string) The IPv4 address.
- ipv6_
address str (string) The first IPv6 address of the assigned network.
- ipv6_
network str (string) The IPv6 network.
- iso str
ID or Name of an ISO image to mount.
- keep_
disk bool If true, do not upgrade the disk. This allows downgrading the server type later.
- labels Mapping[str, Any]
User-defined labels (key-value pairs) should be created with.
- location str
The location name to create the server in.
nbg1
,fsn1
,hel1
,ash
orhil
- name str
Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
- networks
Sequence[Server
Network Args] Network the server should be attached to on creation. (Can be specified multiple times)
- placement_
group_ intid Placement Group ID the server added to on creation.
- public_
nets Sequence[ServerPublic Net Args] In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples). If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
- rebuild_
protection bool Enable or disable rebuild protection (Needs to be the same as
delete_protection
).- rescue str
Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems.
linux64
orlinux32
- server_
type str Name of the server type this server should be created with.
- ssh_
keys Sequence[str] SSH key IDs or names which should be injected into the server at creation time
- status str
(string) The status of the server.
- user_
data str Cloud-Init user data to use during server creation
- allow
Deprecated BooleanImages Enable the use of deprecated images (default: false). Note Deprecated images will be removed after three months. Using them is then no longer possible.
- backup
Window String (string) The backup window of the server, if enabled.
You should remove this property from your terraform configuration.
- backups Boolean
Enable or disable backups.
- datacenter String
The datacenter name to create the server in.
nbg1-dc3
,fsn1-dc14
,hel1-dc2
,ash-dc1
orhil-dc1
- delete
Protection Boolean Enable or disable delete protection (Needs to be the same as
rebuild_protection
).- firewall
Ids List<Number> Firewall IDs the server should be attached to on creation.
- ignore
Remote BooleanFirewall Ids Ignores any updates to the
firewall_ids
argument which were received from the server. This should not be used in normal cases. See the documentation of thehcloud.FirewallAttachment
resource for a reason to use this argument.- image String
(string) Name or ID of the image the server was created from.
- ipv4Address String
(string) The IPv4 address.
- ipv6Address String
(string) The first IPv6 address of the assigned network.
- ipv6Network String
(string) The IPv6 network.
- iso String
ID or Name of an ISO image to mount.
- keep
Disk Boolean If true, do not upgrade the disk. This allows downgrading the server type later.
- labels Map<Any>
User-defined labels (key-value pairs) should be created with.
- location String
The location name to create the server in.
nbg1
,fsn1
,hel1
,ash
orhil
- name String
Name of the server to create (must be unique per project and a valid hostname as per RFC 1123).
- networks List<Property Map>
Network the server should be attached to on creation. (Can be specified multiple times)
- placement
Group NumberId Placement Group ID the server added to on creation.
- public
Nets List<Property Map> In this block you can either enable / disable ipv4 and ipv6 or link existing primary IPs (checkout the examples). If this block is not defined, two primary (ipv4 & ipv6) ips getting auto generated.
- rebuild
Protection Boolean Enable or disable rebuild protection (Needs to be the same as
delete_protection
).- rescue String
Enable and boot in to the specified rescue system. This enables simple installation of custom operating systems.
linux64
orlinux32
- server
Type String Name of the server type this server should be created with.
- ssh
Keys List<String> SSH key IDs or names which should be injected into the server at creation time
- status String
(string) The status of the server.
- user
Data String Cloud-Init user data to use during server creation
Supporting Types
ServerNetwork, ServerNetworkArgs
- Network
Id int ID of the network
- Alias
Ips List<string> Alias IPs the server should have in the Network.
- Ip string
Specify the IP the server should get in the network
- Mac
Address string (Optional, string) The MAC address the private interface of the server has
- Network
Id int ID of the network
- Alias
Ips []string Alias IPs the server should have in the Network.
- Ip string
Specify the IP the server should get in the network
- Mac
Address string (Optional, string) The MAC address the private interface of the server has
- network
Id Integer ID of the network
- alias
Ips List<String> Alias IPs the server should have in the Network.
- ip String
Specify the IP the server should get in the network
- mac
Address String (Optional, string) The MAC address the private interface of the server has
- network
Id number ID of the network
- alias
Ips string[] Alias IPs the server should have in the Network.
- ip string
Specify the IP the server should get in the network
- mac
Address string (Optional, string) The MAC address the private interface of the server has
- network_
id int ID of the network
- alias_
ips Sequence[str] Alias IPs the server should have in the Network.
- ip str
Specify the IP the server should get in the network
- mac_
address str (Optional, string) The MAC address the private interface of the server has
- network
Id Number ID of the network
- alias
Ips List<String> Alias IPs the server should have in the Network.
- ip String
Specify the IP the server should get in the network
- mac
Address String (Optional, string) The MAC address the private interface of the server has
ServerPublicNet, ServerPublicNetArgs
- Ipv4 int
- Ipv4Enabled bool
- Ipv6 int
- Ipv6Enabled bool
- Ipv4 int
- Ipv4Enabled bool
- Ipv6 int
- Ipv6Enabled bool
- ipv4 Integer
- ipv4Enabled Boolean
- ipv6 Integer
- ipv6Enabled Boolean
- ipv4 number
- ipv4Enabled boolean
- ipv6 number
- ipv6Enabled boolean
- ipv4 int
- ipv4_
enabled bool - ipv6 int
- ipv6_
enabled bool
- ipv4 Number
- ipv4Enabled Boolean
- ipv6 Number
- ipv6Enabled Boolean
Import
Servers can be imported using the server id
$ pulumi import hcloud:index/server:Server myserver id
Package Details
- Repository
- Hetzner Cloud pulumi/pulumi-hcloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
hcloud
Terraform Provider.