From da23f3e1717983eadc6c115486a0ead46a5a6307 Mon Sep 17 00:00:00 2001 From: Jerome Quere Date: Thu, 17 Oct 2019 15:13:36 +0200 Subject: [PATCH] doc: add doc for account_ssh_key data source (#283) --- ..._ssh.go => data_source_account_ssh_key.go} | 6 +-- ...go => data_source_account_ssh_key_test.go} | 2 +- scaleway/provider.go | 2 +- website/docs/d/account_ssh_key.html.markdown | 38 +++++++++++++++++++ website/docs/r/account_ssh_key.html.markdown | 2 +- .../r/baremetal_server_beta.html.markdown | 2 +- website/docs/r/instance_ip.html.markdown | 2 +- .../r/instance_placement_group.html.markdown | 2 +- .../r/instance_security_group.html.markdown | 2 +- website/docs/r/instance_server.html.markdown | 2 +- website/docs/r/instance_volume.html.markdown | 2 +- website/docs/r/k8s_cluster_beta.html.markdown | 2 +- website/docs/r/k8s_pool_beta.html.markdown | 2 +- website/docs/r/object_bucket.html.markdown | 2 +- website/scaleway.erb | 8 ++++ 15 files changed, 61 insertions(+), 15 deletions(-) rename scaleway/{data_source_account_ssh.go => data_source_account_ssh_key.go} (89%) rename scaleway/{data_source_account_ssh_test.go => data_source_account_ssh_key_test.go} (96%) create mode 100644 website/docs/d/account_ssh_key.html.markdown diff --git a/scaleway/data_source_account_ssh.go b/scaleway/data_source_account_ssh_key.go similarity index 89% rename from scaleway/data_source_account_ssh.go rename to scaleway/data_source_account_ssh_key.go index e534deab81..fd06a1c8b6 100644 --- a/scaleway/data_source_account_ssh.go +++ b/scaleway/data_source_account_ssh_key.go @@ -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": { @@ -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 diff --git a/scaleway/data_source_account_ssh_test.go b/scaleway/data_source_account_ssh_key_test.go similarity index 96% rename from scaleway/data_source_account_ssh_test.go rename to scaleway/data_source_account_ssh_key_test.go index 9a9a3444e2..7188060f01 100644 --- a/scaleway/data_source_account_ssh_test.go +++ b/scaleway/data_source_account_ssh_key_test.go @@ -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) }, diff --git a/scaleway/provider.go b/scaleway/provider.go index 48302b5753..8270dccab4 100644 --- a/scaleway/provider.go +++ b/scaleway/provider.go @@ -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, diff --git a/website/docs/d/account_ssh_key.html.markdown b/website/docs/d/account_ssh_key.html.markdown new file mode 100644 index 0000000000..191e71a2db --- /dev/null +++ b/website/docs/d/account_ssh_key.html.markdown @@ -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 diff --git a/website/docs/r/account_ssh_key.html.markdown b/website/docs/r/account_ssh_key.html.markdown index aceb8811df..b6b8af8120 100644 --- a/website/docs/r/account_ssh_key.html.markdown +++ b/website/docs/r/account_ssh_key.html.markdown @@ -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. diff --git a/website/docs/r/baremetal_server_beta.html.markdown b/website/docs/r/baremetal_server_beta.html.markdown index 0154925f68..87b5f94b48 100644 --- a/website/docs/r/baremetal_server_beta.html.markdown +++ b/website/docs/r/baremetal_server_beta.html.markdown @@ -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. diff --git a/website/docs/r/instance_ip.html.markdown b/website/docs/r/instance_ip.html.markdown index 00016d76ef..0f4776351a 100644 --- a/website/docs/r/instance_ip.html.markdown +++ b/website/docs/r/instance_ip.html.markdown @@ -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. diff --git a/website/docs/r/instance_placement_group.html.markdown b/website/docs/r/instance_placement_group.html.markdown index b78b1f6f1a..cf4b64532e 100644 --- a/website/docs/r/instance_placement_group.html.markdown +++ b/website/docs/r/instance_placement_group.html.markdown @@ -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. diff --git a/website/docs/r/instance_security_group.html.markdown b/website/docs/r/instance_security_group.html.markdown index 67e1c1cf5e..99dfe71ec7 100644 --- a/website/docs/r/instance_security_group.html.markdown +++ b/website/docs/r/instance_security_group.html.markdown @@ -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. diff --git a/website/docs/r/instance_server.html.markdown b/website/docs/r/instance_server.html.markdown index 294b0bdb21..dc0c3ea029 100644 --- a/website/docs/r/instance_server.html.markdown +++ b/website/docs/r/instance_server.html.markdown @@ -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. diff --git a/website/docs/r/instance_volume.html.markdown b/website/docs/r/instance_volume.html.markdown index 1de69dfe8b..d167f91458 100644 --- a/website/docs/r/instance_volume.html.markdown +++ b/website/docs/r/instance_volume.html.markdown @@ -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. diff --git a/website/docs/r/k8s_cluster_beta.html.markdown b/website/docs/r/k8s_cluster_beta.html.markdown index 0a5c50306c..198700b5aa 100644 --- a/website/docs/r/k8s_cluster_beta.html.markdown +++ b/website/docs/r/k8s_cluster_beta.html.markdown @@ -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. diff --git a/website/docs/r/k8s_pool_beta.html.markdown b/website/docs/r/k8s_pool_beta.html.markdown index 92d64da331..588b20da11 100644 --- a/website/docs/r/k8s_pool_beta.html.markdown +++ b/website/docs/r/k8s_pool_beta.html.markdown @@ -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. diff --git a/website/docs/r/object_bucket.html.markdown b/website/docs/r/object_bucket.html.markdown index 394504d0d8..90ad4d8e9e 100644 --- a/website/docs/r/object_bucket.html.markdown +++ b/website/docs/r/object_bucket.html.markdown @@ -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. diff --git a/website/scaleway.erb b/website/scaleway.erb index a778469b82..6680585845 100644 --- a/website/scaleway.erb +++ b/website/scaleway.erb @@ -22,6 +22,14 @@ +
  • + Account Data Sources + +
  • Account Resources