github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/website/source/docs/providers/scaleway/index.html.markdown (about)

     1  ---
     2  layout: "scaleway"
     3  page_title: "Provider: Scaleway"
     4  sidebar_current: "docs-scaleway-index"
     5  description: |-
     6    The Scaleway provider is used to interact with Scaleway ARM cloud provider.
     7  ---
     8  
     9  # Scaleway Provider
    10  
    11  The Scaleway provider is used to manage Scaleway resources.
    12  
    13  Use the navigation to the left to read about the available resources.
    14  
    15  ## Example Usage
    16  
    17  Here is an example that will setup the following:
    18  + An ARM Server.
    19  + An IP Address.
    20  + A security group.
    21  
    22  (create this as sl.tf and run terraform commands from this directory):
    23  
    24  ```hcl
    25  provider "scaleway" {
    26    access_key = ""
    27    organization = ""
    28    region = "par1"
    29  }
    30  
    31  resource "scaleway_ip" "ip" {
    32    server = "${scaleway_server.test.id}"
    33  }
    34  
    35  resource "scaleway_server" "test" {
    36    name = "test"
    37    image = "aecaed73-51a5-4439-a127-6d8229847145"
    38    type = "C2S"
    39  }
    40  
    41  resource "scaleway_volume" "test" {
    42    name = "test"
    43    size_in_gb = 20
    44    type = "l_ssd"
    45  }
    46  
    47  resource "scaleway_volume_attachment" "test" {
    48    server = "${scaleway_server.test.id}"
    49    volume = "${scaleway_volume.test.id}"
    50  }
    51  
    52  resource "scaleway_security_group" "http" {
    53    name = "http"
    54    description = "allow HTTP and HTTPS traffic"
    55  }
    56  
    57  resource "scaleway_security_group_rule" "http_accept" {
    58    security_group = "${scaleway_security_group.http.id}"
    59  
    60    action = "accept"
    61    direction = "inbound"
    62    ip_range = "0.0.0.0/0"
    63    protocol = "TCP"
    64    port = 80
    65  }
    66  
    67  resource "scaleway_security_group_rule" "https_accept" {
    68    security_group = "${scaleway_security_group.http.id}"
    69  
    70    action = "accept"
    71    direction = "inbound"
    72    ip_range = "0.0.0.0/0"
    73    protocol = "TCP"
    74    port = 443
    75  }
    76  
    77  ```
    78  
    79  You'll need to provide your Scaleway organization access key
    80  (available in Scaleway panel in *Credentials > Tokens > access key*)
    81  and token (you can generate it in the same section), so that Terraform can connect.
    82  If you don't want to put credentials in your configuration file,
    83  you can leave them out:
    84  
    85  ```
    86  provider "scaleway" {
    87    organization = ""
    88    access_key = ""
    89    region = "par1"
    90  }
    91  ```
    92  
    93  ...and instead set these environment variables:
    94  
    95  - **SCALEWAY_ORGANIZATION**: Your Scaleway organization `access key`
    96  - **SCALEWAY_ACCESS_KEY**: Your API access `token`
    97  - **SCALEWAY_REGION**: The Scaleway region