Skip to content

Commit ed2b959

Browse files
OJFordstack72
authored andcommitted
Fix contradiction in terms with provider documentation (hashicorp#10815) (hashicorp#10874)
* Remove contradiction with Scaleway documentation The parameters previously termed by Terraform: 1. Organization 2. Access key Are referred to, respectively, by Scaleway [0] as: 1. Access key 2. Token which is a confusing contradiction for a user. Since Scaleway terms (1) both 'access key' [0] and 'organization ID' [1], @nicolai86 suggested keeping the latter as already used, but changing (2) for 'token'; removing the contradiction. This commit thus changes the parameters to: 1. Organization 2. Token Closes hashicorp#10815. [0] - https://cloud.scaleway.com/#/credentials [1] - https://www.scaleway.com/docs/retrieve-my-organization-id-throught-the-api * Update docs to reflect Scaleway offering x86 Scaleway now provides x86 servers [0] as well as ARM. This commit removes 'ARM' from various references suggesting that might be the only option. [0] - https://blog.online.net/2016/03/08/c2-insanely-affordable-x64-servers/
1 parent 2a022f7 commit ed2b959

6 files changed

Lines changed: 32 additions & 15 deletions

File tree

builtin/providers/scaleway/provider.go

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,21 @@ func Provider() terraform.ResourceProvider {
1414
Type: schema.TypeString,
1515
Required: true,
1616
DefaultFunc: schema.EnvDefaultFunc("SCALEWAY_ACCESS_KEY", nil),
17+
Deprecated: "Use `token` instead.",
18+
Description: "The API key for Scaleway API operations.",
19+
},
20+
21+
"token": &schema.Schema{
22+
Type: schema.TypeString,
23+
Required: true,
24+
DefaultFunc: schema.EnvDefaultFunc("SCALEWAY_TOKEN", nil),
1725
Description: "The API key for Scaleway API operations.",
1826
},
1927
"organization": &schema.Schema{
2028
Type: schema.TypeString,
2129
Required: true,
2230
DefaultFunc: schema.EnvDefaultFunc("SCALEWAY_ORGANIZATION", nil),
23-
Description: "The Organization ID for Scaleway API operations.",
31+
Description: "The Organization ID (a.k.a. 'access key') for Scaleway API operations.",
2432
},
2533
"region": &schema.Schema{
2634
Type: schema.TypeString,
@@ -51,9 +59,18 @@ func Provider() terraform.ResourceProvider {
5159
var scalewayMutexKV = mutexkv.NewMutexKV()
5260

5361
func providerConfigure(d *schema.ResourceData) (interface{}, error) {
62+
apiKey := ""
63+
if v, ok := d.Get("token").(string); ok {
64+
apiKey = v
65+
} else {
66+
if v, ok := d.Get("access_key").(string); ok {
67+
apiKey = v
68+
}
69+
}
70+
5471
config := Config{
5572
Organization: d.Get("organization").(string),
56-
APIKey: d.Get("access_key").(string),
73+
APIKey: apiKey,
5774
Region: d.Get("region").(string),
5875
}
5976

builtin/providers/scaleway/provider_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func testAccPreCheck(t *testing.T) {
3232
if v := os.Getenv("SCALEWAY_ORGANIZATION"); v == "" {
3333
t.Fatal("SCALEWAY_ORGANIZATION must be set for acceptance tests")
3434
}
35-
if v := os.Getenv("SCALEWAY_ACCESS_KEY"); v == "" {
36-
t.Fatal("SCALEWAY_ACCESS_KEY must be set for acceptance tests")
35+
if v := os.Getenv("SCALEWAY_TOKEN"); v == "" {
36+
t.Fatal("SCALEWAY_TOKEN must be set for acceptance tests")
3737
}
3838
}

website/source/docs/providers/scaleway/index.html.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: "scaleway"
33
page_title: "Provider: Scaleway"
44
sidebar_current: "docs-scaleway-index"
55
description: |-
6-
The Scaleway provider is used to interact with Scaleway ARM cloud provider.
6+
The Scaleway provider is used to interact with Scaleway bare metal & VPS provider.
77
---
88

99
# Scaleway Provider
@@ -85,13 +85,13 @@ you can leave them out:
8585
```
8686
provider "scaleway" {
8787
organization = ""
88-
access_key = ""
88+
token = ""
8989
region = "par1"
9090
}
9191
```
9292

9393
...and instead set these environment variables:
9494

95-
- **SCALEWAY_ORGANIZATION**: Your Scaleway organization `access key`
96-
- **SCALEWAY_ACCESS_KEY**: Your API access `token`
95+
- **SCALEWAY_ORGANIZATION**: Your Scaleway `organization` access key
96+
- **SCALEWAY_TOKEN**: Your API access `token`
9797
- **SCALEWAY_REGION**: The Scaleway region

website/source/docs/providers/scaleway/r/ip.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: |-
88

99
# scaleway\_ip
1010

11-
Provides IPs for ARM servers. This allows IPs to be created, updated and deleted.
11+
Provides IPs for servers. This allows IPs to be created, updated and deleted.
1212
For additional details please refer to [API documentation](https://developer.scaleway.com/#ips).
1313

1414
## Example Usage
@@ -22,7 +22,7 @@ resource "scaleway_ip" "test_ip" {
2222

2323
The following arguments are supported:
2424

25-
* `server` - (Optional) ID of ARM server to associate IP with
25+
* `server` - (Optional) ID of server to associate IP with
2626

2727
Field `server` is editable.
2828

website/source/docs/providers/scaleway/r/server.html.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: |-
88

99
# scaleway\_server
1010

11-
Provides ARM servers. This allows servers to be created, updated and deleted.
11+
Provides servers. This allows servers to be created, updated and deleted.
1212
For additional details please refer to [API documentation](https://developer.scaleway.com/#servers).
1313

1414
## Example Usage
@@ -30,9 +30,9 @@ resource "scaleway_server" "test" {
3030

3131
The following arguments are supported:
3232

33-
* `name` - (Required) name of ARM server
34-
* `image` - (Required) base image of ARM server
35-
* `type` - (Required) type of ARM server
33+
* `name` - (Required) name of server
34+
* `image` - (Required) base image of server
35+
* `type` - (Required) type of server
3636
* `bootscript` - (Optional) server bootscript
3737
* `tags` - (Optional) list of tags for server
3838
* `enable_ipv6` - (Optional) enable ipv6

website/source/docs/providers/scaleway/r/volume.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: |-
88

99
# scaleway\_volume
1010

11-
Provides ARM volumes. This allows volumes to be created, updated and deleted.
11+
Provides volumes. This allows volumes to be created, updated and deleted.
1212
For additional details please refer to [API documentation](https://developer.scaleway.com/#volumes).
1313

1414
## Example Usage

0 commit comments

Comments
 (0)