2016-07-13 22:03:41 +02:00
|
|
|
---
|
|
|
|
layout: "scaleway"
|
|
|
|
page_title: "Scaleway: server"
|
|
|
|
sidebar_current: "docs-scaleway-resource-server"
|
|
|
|
description: |-
|
|
|
|
Manages Scaleway servers.
|
|
|
|
---
|
|
|
|
|
2016-10-15 14:22:35 +02:00
|
|
|
# scaleway\_server
|
2016-07-13 22:03:41 +02:00
|
|
|
|
2017-01-17 13:02:55 +01:00
|
|
|
Provides servers. This allows servers to be created, updated and deleted.
|
2016-07-13 22:03:41 +02:00
|
|
|
For additional details please refer to [API documentation](https://developer.scaleway.com/#servers).
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
2017-04-17 12:17:54 +02:00
|
|
|
```hcl
|
2016-07-13 22:03:41 +02:00
|
|
|
resource "scaleway_server" "test" {
|
2017-02-18 23:48:50 +01:00
|
|
|
name = "test"
|
2016-07-13 22:03:41 +02:00
|
|
|
image = "5faef9cd-ea9b-4a63-9171-9e26bec03dbc"
|
2017-02-18 23:48:50 +01:00
|
|
|
type = "VC1M"
|
2016-10-29 13:07:35 +02:00
|
|
|
|
|
|
|
volume {
|
|
|
|
size_in_gb = 20
|
2017-02-18 23:48:50 +01:00
|
|
|
type = "l_ssd"
|
2016-10-29 13:07:35 +02:00
|
|
|
}
|
2016-07-13 22:03:41 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
2017-01-17 13:02:55 +01:00
|
|
|
* `name` - (Required) name of server
|
|
|
|
* `image` - (Required) base image of server
|
|
|
|
* `type` - (Required) type of server
|
2016-07-25 13:49:09 +02:00
|
|
|
* `bootscript` - (Optional) server bootscript
|
|
|
|
* `tags` - (Optional) list of tags for server
|
|
|
|
* `enable_ipv6` - (Optional) enable ipv6
|
|
|
|
* `dynamic_ip_required` - (Optional) make server publicly available
|
|
|
|
* `security_group` - (Optional) assign security group to server
|
2016-07-13 22:03:41 +02:00
|
|
|
|
2016-07-25 13:49:09 +02:00
|
|
|
Field `name`, `type`, `tags`, `dynamic_ip_required`, `security_group` are editable.
|
2016-07-13 22:03:41 +02:00
|
|
|
|
2016-10-29 13:07:35 +02:00
|
|
|
## Volume
|
|
|
|
|
|
|
|
You can attach additional volumes to your instance, which will share the lifetime
|
|
|
|
of your `scaleway_server` resource.
|
|
|
|
|
|
|
|
The `volume` mapping supports the following:
|
|
|
|
|
|
|
|
* `type` - (Required) The type of volume. Can be `"l_ssd"`
|
|
|
|
* `size_in_gb` - (Required) The size of the volume in gigabytes.
|
|
|
|
|
2016-07-13 22:03:41 +02:00
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - id of the new resource
|
2016-07-25 13:49:09 +02:00
|
|
|
* `private_ip` - private ip of the new resource
|
|
|
|
* `public_ip` - public ip of the new resource
|
2016-10-15 23:49:14 +02:00
|
|
|
|
|
|
|
## Import
|
|
|
|
|
|
|
|
Instances can be imported using the `id`, e.g.
|
|
|
|
|
|
|
|
```
|
|
|
|
$ terraform import scaleway_server.web 5faef9cd-ea9b-4a63-9171-9e26bec03dbc
|
|
|
|
```
|