2016-07-13 22:03:41 +02:00
|
|
|
---
|
|
|
|
layout: "scaleway"
|
|
|
|
page_title: "Scaleway: volume attachment"
|
|
|
|
sidebar_current: "docs-scaleway-resource-volume attachment"
|
|
|
|
description: |-
|
|
|
|
Manages Scaleway Volume attachments for servers.
|
|
|
|
---
|
|
|
|
|
2016-10-15 14:22:35 +02:00
|
|
|
# scaleway\_volume\_attachment
|
2016-07-13 22:03:41 +02:00
|
|
|
|
|
|
|
This allows volumes to be attached to servers.
|
|
|
|
|
|
|
|
**Warning:** Attaching volumes requires the servers to be powered off. This will lead
|
|
|
|
to downtime if the server is already in use.
|
|
|
|
|
|
|
|
## 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 = "aecaed73-51a5-4439-a127-6d8229847145"
|
2017-02-18 23:48:50 +01:00
|
|
|
type = "C2S"
|
2016-07-13 22:03:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "scaleway_volume" "test" {
|
2017-02-18 23:48:50 +01:00
|
|
|
name = "test"
|
2016-07-13 22:03:41 +02:00
|
|
|
size_in_gb = 20
|
2017-02-18 23:48:50 +01:00
|
|
|
type = "l_ssd"
|
2016-07-13 22:03:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "scaleway_volume_attachment" "test" {
|
|
|
|
server = "${scaleway_server.test.id}"
|
|
|
|
volume = "${scaleway_volume.test.id}"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `server` - (Required) id of the server
|
|
|
|
* `volume` - (Required) id of the volume to be attached
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - id of the new resource
|