Skip to content

Commit

Permalink
doc: add doc for account_ssh_key data source (scaleway#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerome-quere authored Oct 17, 2019
1 parent 0aeea41 commit da23f3e
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
account "github.com/scaleway/scaleway-sdk-go/api/account/v2alpha1"
)

func dataSourceScalewayAccountSSH() *schema.Resource {
func dataSourceScalewayAccountSSHKey() *schema.Resource {
return &schema.Resource{
Read: dataSourceScalewayAccountSSHRead,
Read: dataSourceScalewayAccountSSHKeyRead,

Schema: map[string]*schema.Schema{
"name": {
Expand All @@ -35,7 +35,7 @@ func dataSourceScalewayAccountSSH() *schema.Resource {
}
}

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

var sshKey *account.SSHKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccScalewayDataSourceAccountSSH_Basic(t *testing.T) {
func TestAccScalewayDataSourceAccountSSHKey_Basic(t *testing.T) {
sshKeyName := acctest.RandString(10)
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down
2 changes: 1 addition & 1 deletion scaleway/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func Provider() terraform.ResourceProvider {
"scaleway_image": dataSourceScalewayImage(),
"scaleway_security_group": dataSourceScalewaySecurityGroup(),
"scaleway_volume": dataSourceScalewayVolume(),
"scaleway_account_ssh_key": dataSourceScalewayAccountSSH(),
"scaleway_account_ssh_key": dataSourceScalewayAccountSSHKey(),
},

ConfigureFunc: providerConfigure,
Expand Down
38 changes: 38 additions & 0 deletions website/docs/d/account_ssh_key.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_account_ssh_key"
description: |-
Get information on a Scaleway SSH key.
---

# scaleway_account_ssh_key

Use this data source to get SSH key information based on its ID or name.

## Example Usage

```hcl
// Get info by SSH key name
data "scaleway_account_ssh_key" "my_key" {
name = "my-key-name"
}
// Get info by SSH key id
data "scaleway_account_ssh_key" "my_key" {
ssh_key_id = "11111111-1111-1111-1111-111111111111"
}
```

## Argument Reference

- `name` - The SSH key name. Only one of `name` and `ssh_key_id` should be specified.
- `ssh_key_id` - The SSH key id. Only one of `name` and `ssh_key_id` should be specified.
- `organization_id` - (Defaults to [provider](../index.html#organization_id) `organization_id`) The ID of the organization the server is associated with.


## Attributes Reference

In addition to all above arguments, the following attributes are exported:

- `id` - The ID of the server.
- `public_key` - The SSH public key string
2 changes: 1 addition & 1 deletion website/docs/r/account_ssh_key.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The following arguments are supported:

## Attributes Reference

In addition to all arguments above, the following attributes are exported:
In addition to all above arguments, the following attributes are exported:

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

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/baremetal_server_beta.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Use [this endpoint](https://developers.scaleway.com/en/products/baremetal/api/#g

## Attributes Reference

In addition to all arguments above, the following attributes are exported:
In addition to all above arguments, the following attributes are exported:

- `id` - The ID of the server.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/instance_ip.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The following arguments are supported:

## Attributes Reference

In addition to all arguments above, the following attributes are exported:
In addition to all above arguments, the following attributes are exported:

- `id` - The ID of the IP.
- `address` - The IP address.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/instance_placement_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The following arguments are supported:

## Attributes Reference

In addition to all arguments above, the following attributes are exported:
In addition to all above arguments, the following attributes are exported:

- `id` - The ID of the placement group.
- `policy_respected` - Is true when the policy is respected.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/instance_security_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ The `inbound_rule` and `outbound_rule` block supports:

## Attributes Reference

In addition to all arguments above, the following attributes are exported:
In addition to all above arguments, the following attributes are exported:

- `id` - The ID of the server.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/instance_server.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ attached to the server. Updates to this field will trigger a stop/start of the s

## Attributes Reference

In addition to all arguments above, the following attributes are exported:
In addition to all above arguments, the following attributes are exported:

- `id` - The ID of the server.
- `placement_group_policy_respected` - True when the placement group policy is respected.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/instance_volume.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The following arguments are supported:

## Attributes Reference

In addition to all arguments above, the following attributes are exported:
In addition to all above arguments, the following attributes are exported:

- `id` - The ID of the volume.
- `server_id` - The id of the associated server.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/k8s_cluster_beta.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ The following arguments are supported:

## Attributes Reference

In addition to all arguments above, the following attributes are exported:
In addition to all above arguments, the following attributes are exported:

- `id` - The ID of the cluster.
- `created_at` - The creation date of the cluster.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/k8s_pool_beta.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The following arguments are supported:

## Attributes Reference

In addition to all arguments above, the following attributes are exported:
In addition to all above arguments, the following attributes are exported:

- `id` - The ID of the pool.
- `created_at` - The creation date of the pool.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/object_bucket.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The following arguments are supported:

## Attributes Reference

In addition to all arguments above, the following attribute is exported:
In addition to all above arguments, the following attribute is exported:

* `id` - The ID of the bucket.

Expand Down
8 changes: 8 additions & 0 deletions website/scaleway.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
</ul>
</li>

<li>
<a href="#">Account Data Sources</a>
<ul class="nav nav-visible">
<li>
<a href="/docs/providers/scaleway/d/account_ssh_key.html">account_ssh_key</a>
</li>
</ul>
</li>
<li>
<a href="#">Account Resources</a>
<ul class="nav nav-visible">
Expand Down

0 comments on commit da23f3e

Please sign in to comment.