2016-07-13 22:03:41 +02:00
|
|
|
---
|
|
|
|
layout: "scaleway"
|
|
|
|
page_title: "Provider: Scaleway"
|
|
|
|
sidebar_current: "docs-scaleway-index"
|
|
|
|
description: |-
|
|
|
|
The Scaleway provider is used to interact with Scaleway ARM cloud provider.
|
|
|
|
---
|
|
|
|
|
|
|
|
# Scaleway Provider
|
|
|
|
|
|
|
|
The Scaleway provider is used to manage Scaleway resources.
|
|
|
|
|
|
|
|
Use the navigation to the left to read about the available resources.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
Here is an example that will setup the following:
|
|
|
|
+ An ARM Server.
|
|
|
|
+ An IP Address.
|
|
|
|
+ A security group.
|
|
|
|
|
|
|
|
(create this as sl.tf and run terraform commands from this directory):
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
provider "scaleway" {
|
|
|
|
access_key = ""
|
|
|
|
organization = ""
|
2016-10-10 20:05:16 +02:00
|
|
|
region = "par1"
|
2016-07-13 22:03:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "scaleway_ip" "ip" {
|
|
|
|
server = "${scaleway_server.test.id}"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "scaleway_server" "test" {
|
|
|
|
name = "test"
|
|
|
|
image = "aecaed73-51a5-4439-a127-6d8229847145"
|
|
|
|
type = "C2S"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "scaleway_volume" "test" {
|
|
|
|
name = "test"
|
|
|
|
size_in_gb = 20
|
|
|
|
type = "l_ssd"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "scaleway_volume_attachment" "test" {
|
|
|
|
server = "${scaleway_server.test.id}"
|
|
|
|
volume = "${scaleway_volume.test.id}"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "scaleway_security_group" "http" {
|
|
|
|
name = "http"
|
|
|
|
description = "allow HTTP and HTTPS traffic"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "scaleway_security_group_rule" "http_accept" {
|
|
|
|
security_group = "${scaleway_security_group.http.id}"
|
|
|
|
|
|
|
|
action = "accept"
|
|
|
|
direction = "inbound"
|
|
|
|
ip_range = "0.0.0.0/0"
|
|
|
|
protocol = "TCP"
|
2016-09-02 18:10:52 +02:00
|
|
|
port = 80
|
2016-07-13 22:03:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "scaleway_security_group_rule" "https_accept" {
|
|
|
|
security_group = "${scaleway_security_group.http.id}"
|
|
|
|
|
|
|
|
action = "accept"
|
|
|
|
direction = "inbound"
|
|
|
|
ip_range = "0.0.0.0/0"
|
|
|
|
protocol = "TCP"
|
2016-09-02 18:10:52 +02:00
|
|
|
port = 443
|
2016-07-13 22:03:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
You'll need to provide your Scaleway organization and access key,
|
|
|
|
so that Terraform can connect. If you don't want to put
|
|
|
|
credentials in your configuration file, you can leave them
|
|
|
|
out:
|
|
|
|
|
|
|
|
```
|
2016-10-10 20:05:16 +02:00
|
|
|
provider "scaleway" {
|
|
|
|
organization = ""
|
|
|
|
access_key = ""
|
|
|
|
region = "par1"
|
|
|
|
}
|
2016-07-13 22:03:41 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
...and instead set these environment variables:
|
|
|
|
|
2016-10-11 11:25:54 +02:00
|
|
|
- **SCALEWAY_ORGANIZATION**: Your Scaleway organization ID
|
2016-07-13 22:03:41 +02:00
|
|
|
- **SCALEWAY_ACCESS_KEY**: Your API Access key
|
2016-10-10 20:05:16 +02:00
|
|
|
- **SCALEWAY_REGION**: The Scaleway region
|