Skip to content

Commit da23f3e

Browse files
authored
doc: add doc for account_ssh_key data source (scaleway#283)
1 parent 0aeea41 commit da23f3e

15 files changed

+61
-15
lines changed

scaleway/data_source_account_ssh.go renamed to scaleway/data_source_account_ssh_key.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
account "github.com/scaleway/scaleway-sdk-go/api/account/v2alpha1"
88
)
99

10-
func dataSourceScalewayAccountSSH() *schema.Resource {
10+
func dataSourceScalewayAccountSSHKey() *schema.Resource {
1111
return &schema.Resource{
12-
Read: dataSourceScalewayAccountSSHRead,
12+
Read: dataSourceScalewayAccountSSHKeyRead,
1313

1414
Schema: map[string]*schema.Schema{
1515
"name": {
@@ -35,7 +35,7 @@ func dataSourceScalewayAccountSSH() *schema.Resource {
3535
}
3636
}
3737

38-
func dataSourceScalewayAccountSSHRead(d *schema.ResourceData, m interface{}) error {
38+
func dataSourceScalewayAccountSSHKeyRead(d *schema.ResourceData, m interface{}) error {
3939
accountAPI := getAccountAPI(m)
4040

4141
var sshKey *account.SSHKey

scaleway/data_source_account_ssh_test.go renamed to scaleway/data_source_account_ssh_key_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/hashicorp/terraform/helper/resource"
88
)
99

10-
func TestAccScalewayDataSourceAccountSSH_Basic(t *testing.T) {
10+
func TestAccScalewayDataSourceAccountSSHKey_Basic(t *testing.T) {
1111
sshKeyName := acctest.RandString(10)
1212
resource.ParallelTest(t, resource.TestCase{
1313
PreCheck: func() { testAccPreCheck(t) },

scaleway/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func Provider() terraform.ResourceProvider {
215215
"scaleway_image": dataSourceScalewayImage(),
216216
"scaleway_security_group": dataSourceScalewaySecurityGroup(),
217217
"scaleway_volume": dataSourceScalewayVolume(),
218-
"scaleway_account_ssh_key": dataSourceScalewayAccountSSH(),
218+
"scaleway_account_ssh_key": dataSourceScalewayAccountSSHKey(),
219219
},
220220

221221
ConfigureFunc: providerConfigure,
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: "scaleway"
3+
page_title: "Scaleway: scaleway_account_ssh_key"
4+
description: |-
5+
Get information on a Scaleway SSH key.
6+
---
7+
8+
# scaleway_account_ssh_key
9+
10+
Use this data source to get SSH key information based on its ID or name.
11+
12+
## Example Usage
13+
14+
```hcl
15+
// Get info by SSH key name
16+
data "scaleway_account_ssh_key" "my_key" {
17+
name = "my-key-name"
18+
}
19+
20+
// Get info by SSH key id
21+
data "scaleway_account_ssh_key" "my_key" {
22+
ssh_key_id = "11111111-1111-1111-1111-111111111111"
23+
}
24+
```
25+
26+
## Argument Reference
27+
28+
- `name` - The SSH key name. Only one of `name` and `ssh_key_id` should be specified.
29+
- `ssh_key_id` - The SSH key id. Only one of `name` and `ssh_key_id` should be specified.
30+
- `organization_id` - (Defaults to [provider](../index.html#organization_id) `organization_id`) The ID of the organization the server is associated with.
31+
32+
33+
## Attributes Reference
34+
35+
In addition to all above arguments, the following attributes are exported:
36+
37+
- `id` - The ID of the server.
38+
- `public_key` - The SSH public key string

website/docs/r/account_ssh_key.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The following arguments are supported:
2828

2929
## Attributes Reference
3030

31-
In addition to all arguments above, the following attributes are exported:
31+
In addition to all above arguments, the following attributes are exported:
3232

3333
- `id` - The ID of the SSH key.
3434

website/docs/r/baremetal_server_beta.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Use [this endpoint](https://developers.scaleway.com/en/products/baremetal/api/#g
5454

5555
## Attributes Reference
5656

57-
In addition to all arguments above, the following attributes are exported:
57+
In addition to all above arguments, the following attributes are exported:
5858

5959
- `id` - The ID of the server.
6060

website/docs/r/instance_ip.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The following arguments are supported:
2626

2727
## Attributes Reference
2828

29-
In addition to all arguments above, the following attributes are exported:
29+
In addition to all above arguments, the following attributes are exported:
3030

3131
- `id` - The ID of the IP.
3232
- `address` - The IP address.

website/docs/r/instance_placement_group.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The following arguments are supported:
2727

2828
## Attributes Reference
2929

30-
In addition to all arguments above, the following attributes are exported:
30+
In addition to all above arguments, the following attributes are exported:
3131

3232
- `id` - The ID of the placement group.
3333
- `policy_respected` - Is true when the policy is respected.

website/docs/r/instance_security_group.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ The `inbound_rule` and `outbound_rule` block supports:
124124

125125
## Attributes Reference
126126

127-
In addition to all arguments above, the following attributes are exported:
127+
In addition to all above arguments, the following attributes are exported:
128128

129129
- `id` - The ID of the server.
130130

website/docs/r/instance_server.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ attached to the server. Updates to this field will trigger a stop/start of the s
164164

165165
## Attributes Reference
166166

167-
In addition to all arguments above, the following attributes are exported:
167+
In addition to all above arguments, the following attributes are exported:
168168

169169
- `id` - The ID of the server.
170170
- `placement_group_policy_respected` - True when the placement group policy is respected.

website/docs/r/instance_volume.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The following arguments are supported:
3333

3434
## Attributes Reference
3535

36-
In addition to all arguments above, the following attributes are exported:
36+
In addition to all above arguments, the following attributes are exported:
3737

3838
- `id` - The ID of the volume.
3939
- `server_id` - The id of the associated server.

website/docs/r/k8s_cluster_beta.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ The following arguments are supported:
145145

146146
## Attributes Reference
147147

148-
In addition to all arguments above, the following attributes are exported:
148+
In addition to all above arguments, the following attributes are exported:
149149

150150
- `id` - The ID of the cluster.
151151
- `created_at` - The creation date of the cluster.

website/docs/r/k8s_pool_beta.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ The following arguments are supported:
6969

7070
## Attributes Reference
7171

72-
In addition to all arguments above, the following attributes are exported:
72+
In addition to all above arguments, the following attributes are exported:
7373

7474
- `id` - The ID of the pool.
7575
- `created_at` - The creation date of the pool.

website/docs/r/object_bucket.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The following arguments are supported:
2929

3030
## Attributes Reference
3131

32-
In addition to all arguments above, the following attribute is exported:
32+
In addition to all above arguments, the following attribute is exported:
3333

3434
* `id` - The ID of the bucket.
3535

website/scaleway.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222
</ul>
2323
</li>
2424

25+
<li>
26+
<a href="#">Account Data Sources</a>
27+
<ul class="nav nav-visible">
28+
<li>
29+
<a href="/docs/providers/scaleway/d/account_ssh_key.html">account_ssh_key</a>
30+
</li>
31+
</ul>
32+
</li>
2533
<li>
2634
<a href="#">Account Resources</a>
2735
<ul class="nav nav-visible">

0 commit comments

Comments
 (0)