2017-01-18 15:43:09 +01:00
|
|
|
---
|
|
|
|
layout: "profitbricks"
|
|
|
|
page_title: "ProfitBricks: profitbricks_server"
|
2017-01-26 18:28:01 +01:00
|
|
|
sidebar_current: "docs-profitbricks-resource-server"
|
2017-01-18 15:43:09 +01:00
|
|
|
description: |-
|
|
|
|
Creates and manages ProfitBricks Server objects.
|
|
|
|
---
|
|
|
|
|
|
|
|
# profitbricks\_server
|
|
|
|
|
|
|
|
Manages a Servers on ProfitBricks
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
This resource will create an operational server. After this section completes, the provisioner can be called.
|
|
|
|
|
|
|
|
```
|
|
|
|
resource "profitbricks_server" "example" {
|
2017-02-18 23:48:50 +01:00
|
|
|
name = "server"
|
|
|
|
datacenter_id = "${profitbricks_datacenter.example.id}"
|
|
|
|
cores = 1
|
|
|
|
ram = 1024
|
|
|
|
availability_zone = "ZONE_1"
|
|
|
|
cpu_family = "AMD_OPTERON"
|
|
|
|
|
|
|
|
volume {
|
|
|
|
name = "new"
|
|
|
|
image_name = "${var.ubuntu}"
|
|
|
|
size = 5
|
|
|
|
disk_type = "SSD"
|
|
|
|
ssh_key_path = "${var.private_key_path}"
|
|
|
|
image_password = "test1234"
|
|
|
|
}
|
|
|
|
|
|
|
|
nic {
|
|
|
|
lan = "${profitbricks_lan.example.id}"
|
|
|
|
dhcp = true
|
|
|
|
ip = "${profitbricks_ipblock.example.ip}"
|
|
|
|
firewall_active = true
|
|
|
|
|
|
|
|
firewall {
|
|
|
|
protocol = "TCP"
|
|
|
|
name = "SSH"
|
|
|
|
port_range_start = 22
|
|
|
|
port_range_end = 22
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-01-18 15:43:09 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
##Argument reference
|
|
|
|
|
|
|
|
* `name` - (Required) [string] The name of the server.
|
2017-02-18 23:48:50 +01:00
|
|
|
* `datacenter_id` - (Required)[string]
|
2017-01-18 15:43:09 +01:00
|
|
|
* `cores` - (Required)[integer] Number of server cores.
|
|
|
|
* `ram` - (Required)[integer] The amount of memory for the server in MB.
|
|
|
|
* `availability_zone` - (Optional)[string] The availability zone in which the server should exist.
|
|
|
|
* `licence_type` - (Optional)[string] Sets the OS type of the server.
|
|
|
|
* `cpuFamily` - (Optional)[string] Sets the CPU type. "AMD_OPTERON" or "INTEL_XEON". Defaults to "AMD_OPTERON".
|
|
|
|
* `volume` - (Required) See Volume section.
|
|
|
|
* `nic` - (Required) See NIC section.
|
|
|
|
* `firewall` - (Optional) See Firewall Rule section.
|