You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
4
-
5
-
## Example Usage
6
-
7
-
```
8
-
# Set the variable value in *.tfvars file
9
-
# or using -var="hcloud_token=..." CLI option
10
-
variable "hcloud_token" {}
11
-
12
-
# Configure the Hetzner Cloud Provider
13
-
provider "hcloud" {
14
-
token = "${var.hcloud_token}"
15
-
}
16
-
17
-
# Create a web server
18
-
resource "hcloud_server" "web" {
19
-
# ...
20
-
}
21
-
```
22
-
23
-
## Argument Reference
24
-
25
-
The following arguments are supported:
26
-
27
-
-`token` - (Required) This is the Hetzner Cloud API Token. This can also be specified with the `HCLOUD_TOKEN` environment variable.
The Hetzner Cloud (hcloud) provider is used to interact with the resources supported by Hetzner Cloud.
7
+
---
8
+
9
+
# Hetzner Cloud Provider
10
+
11
+
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.
12
+
13
+
Use the navigation to the left to read about the available resources.
14
+
15
+
## Example Usage
16
+
17
+
```hcl
18
+
# Set the variable value in *.tfvars file
19
+
# or using -var="hcloud_token=..." CLI option
20
+
variable "hcloud_token" {}
21
+
22
+
# Configure the Hetzner Cloud Provider
23
+
provider "hcloud" {
24
+
token = "${var.hcloud_token}"
25
+
}
26
+
27
+
# Create a server
28
+
resource "hcloud_server" "web" {
29
+
# ...
30
+
}
31
+
```
32
+
33
+
## Argument Reference
34
+
35
+
The following arguments are supported:
36
+
37
+
-`token` - (Required) This is the Hetzner Cloud API Token. This can also be specified with the `HCLOUD_TOKEN` environment variable.
Copy file name to clipboardexpand all lines: website/docs/r/server.html.md
+18-3
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,18 @@
1
+
---
2
+
layout: "hcloud"
3
+
page_title: "Hetzner Cloud: hcloud_server"
4
+
sidebar_current: "docs-hcloud-resource-server"
5
+
description: |-
6
+
Provides an Hetzner Cloud server resource. This can be used to create, modify, and delete Servers. Servers also support provisioning.
7
+
---
8
+
1
9
# hcloud_server
2
10
3
11
Provides an Hetzner Cloud server resource. This can be used to create, modify, and delete Servers. Servers also support [provisioning](https://www.terraform.io/docs/provisioners/index.html).
4
12
5
13
## Example Usage
6
14
7
-
```
15
+
```hcl
8
16
# Create a new server running debian
9
17
resource "hcloud_server" "node1" {
10
18
name = "node1"
@@ -22,8 +30,7 @@ The following arguments are supported:
22
30
-`image` - (Required) Name or ID of the image the server is created from.
23
31
-`location` - (Optional) The location name to create the server in.
24
32
-`datacenter` - (Optional) The datacenter name to create the server in.
25
-
-`user_data` - (Optional)
26
-
Cloud-Init user data to use during server creation
33
+
-`user_data` - (Optional) Cloud-Init user data to use during server creation
27
34
-`ssh_keys` - (Optional) SSH key IDs or names which should be injected into the server at creation time
28
35
-`keep_disk` - (Optional) If true, do not upgrade the disk. This allows downgrading the server type later.
29
36
-`backup_window` - (Optional) Enable and configure backups for a server. Time window (UTC) in which the backup will run, choices: `22-02``02-06``06-10``10-14``14-18``18-22`
@@ -46,3 +53,11 @@ The following attributes are exported:
0 commit comments