Skip to content

Commit dc81ab7

Browse files
authored
docs: add missing datasources (#2341)
* docs: add missing datasources * lint
1 parent d5ace61 commit dc81ab7

File tree

5 files changed

+156
-1
lines changed

5 files changed

+156
-1
lines changed

docs/data-sources/bloc_snapshot.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
subcategory: "Block"
3+
page_title: "Scaleway: scaleway_block_snapshot"
4+
---
5+
6+
# scaleway_block_snapshot
7+
8+
Gets information about a Block Snapshot.
9+
10+
## Example Usage
11+
12+
```terraform
13+
// Get info by snapshot name
14+
data "scaleway_block_snapshot" "my_snapshot" {
15+
name = "my-name"
16+
}
17+
18+
// Get info by snapshot name and volume id
19+
data "scaleway_block_snapshot" "my_snapshot" {
20+
name = "my-name"
21+
volume_id = "11111111-1111-1111-1111-111111111111"
22+
}
23+
24+
// Get info by snapshot ID
25+
data "scaleway_block_snapshot" "my_snapshot" {
26+
snapshot_id = "11111111-1111-1111-1111-111111111111"
27+
}
28+
```
29+
30+
## Argument Reference
31+
32+
The following arguments are supported:
33+
34+
- `snapshot_id` - (Optional) The ID of the snapshot. Only one of `name` and `snapshot_id` should be specified.
35+
- `name` - (Optional) The name of the snapshot. Only one of `name` and `snapshot_id` should be specified.
36+
- `volume_id` - (Optional) The ID of the volume from which the snapshot has been created.
37+
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the snapshot exists.
38+
- `project_id` - (Optional) The ID of the project the snapshot is associated with.
39+
40+
## Attributes Reference
41+
42+
Exported attributes are the ones from `scaleway_block_snapshot` [resource](../resources/block_snapshot.md)

docs/data-sources/block_volume.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
subcategory: "Block"
3+
page_title: "Scaleway: scaleway_block_volume"
4+
---
5+
6+
# scaleway_block_volume
7+
8+
Gets information about a Block Volume.
9+
10+
## Example Usage
11+
12+
```terraform
13+
// Get info by volume name
14+
data "scaleway_block_volume" "my_volume" {
15+
name = "my-name"
16+
}
17+
18+
// Get info by volume ID
19+
data "scaleway_block_volume" "my_volume" {
20+
volume_id = "11111111-1111-1111-1111-111111111111"
21+
}
22+
```
23+
24+
## Argument Reference
25+
26+
The following arguments are supported:
27+
28+
- `volume_id` - (Optional) The ID of the volume. Only one of `name` and `volume_id` should be specified.
29+
- `name` - (Optional) The name of the volume. Only one of `name` and `volume_id` should be specified.
30+
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the volume exists.
31+
- `project_id` - (Optional) The ID of the project the volume is associated with.
32+
33+
## Attributes Reference
34+
35+
Exported attributes are the ones from `scaleway_block_volume` [resource](../resources/block_volume.md)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
subcategory: "Databases"
3+
page_title: "Scaleway: scaleway_documentdb_load_balancer_endpoint"
4+
---
5+
6+
# scaleway_documentdb_load_balancer_endpoint
7+
8+
Gets information about an DocumentDB load balancer endpoint.
9+
10+
## Example Usage
11+
12+
```terraform
13+
# Get info by instance name
14+
data "scaleway_documentdb_load_balancer_endpoint" "my_endpoint" {
15+
instance_name = "foobar"
16+
}
17+
18+
# Get info by instance ID
19+
data "scaleway_documentdb_load_balancer_endpoint" "my_endpoint" {
20+
instance_id = "11111111-1111-1111-1111-111111111111"
21+
}
22+
```
23+
24+
## Argument Reference
25+
26+
- `instance_name` - (Optional) The DocumentDB Instance Name on which the endpoint is attached. Only one of `instance_name` and `instance_id` should be specified.
27+
- `instance_id` - (Optional) The DocumentDB Instance on which the endpoint is attached. Only one of `instance_name` and `instance_id` should be specified.
28+
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#zones) in which the DocumentDB endpoint exists.
29+
- `project_id` - (Optional) The ID of the project the DocumentDB endpoint is associated with.
30+
31+
## Attributes Reference
32+
33+
In addition to all above arguments, the following attributes are exported:
34+
35+
- `id` - The ID of the DocumentDB endpoint.
36+
37+
~> **Important:** DocumentDB endpoints' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111`
38+
39+
- `ip` - The IP of your load balancer service.
40+
- `port` - The port of your load balancer service.
41+
- `name` - The name of your load balancer service.
42+
- `hostname` - The hostname of your endpoint.

docs/data-sources/function.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
subcategory: "Functions"
3+
page_title: "Scaleway: scaleway_function"
4+
---
5+
6+
# scaleway_function
7+
8+
Gets information about a function.
9+
10+
## Example Usage
11+
12+
```terraform
13+
// Get info by function name
14+
data "scaleway_function" "my_function" {
15+
name = "my-namespace-name"
16+
namespace_id = "11111111-1111-1111-1111-111111111111"
17+
}
18+
19+
// Get info by function ID
20+
data "scaleway_function" "my_function" {
21+
function_id = "11111111-1111-1111-1111-111111111111"
22+
namespace_id = "11111111-1111-1111-1111-111111111111"
23+
}
24+
```
25+
26+
## Argument Reference
27+
28+
- `namespace_id` - (Required) The namespace id associated with this function.
29+
- `name` - (Optional) The function name. Only one of `name` and `namespace_id` should be specified.
30+
- `function_id` - (Optional) The function id. Only one of `name` and `function_id` should be specified.
31+
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the function exists.
32+
- `project_id` - (Optional) The ID of the project the function is associated with.
33+
34+
## Attributes Reference
35+
36+
Exported attributes are the ones from `scaleway_function` [resource](../resources/function.md)

scaleway/data_source_function.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func dataSourceScalewayFunction() *schema.Resource {
1919
Computed: true,
2020
}
2121

22-
addOptionalFieldsToSchema(dsSchema, "name", "function_id", "project_id")
22+
addOptionalFieldsToSchema(dsSchema, "name", "function_id", "project_id", "region")
2323
fixDatasourceSchemaFlags(dsSchema, true, "namespace_id")
2424

2525
return &schema.Resource{

0 commit comments

Comments
 (0)