Skip to content

Commit e3f2b53

Browse files
committed
Merge branch 'dependabot/go_modules/github.com/hashicorp/terraform-plugin-testing-1.13.3' of github.com:scaleway/terraform-provider-scaleway into dependabot/go_modules/github.com/hashicorp/terraform-plugin-testing-1.13.3
2 parents 4df915d + 42b5468 commit e3f2b53

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+18966
-8879
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
subcategory: "Cockpit"
3+
page_title: "Scaleway: scaleway_cockpit_sources"
4+
---
5+
6+
# scaleway_cockpit_sources
7+
8+
Gets information about multiple Cockpit data sources.
9+
10+
## Example Usage
11+
12+
### List all sources in a project
13+
14+
```hcl
15+
data "scaleway_cockpit_sources" "all" {
16+
project_id = "11111111-1111-1111-1111-111111111111"
17+
}
18+
```
19+
20+
### Filter sources by type
21+
22+
```hcl
23+
data "scaleway_cockpit_sources" "metrics" {
24+
project_id = "11111111-1111-1111-1111-111111111111"
25+
type = "metrics"
26+
}
27+
```
28+
29+
### Filter sources by name
30+
31+
```hcl
32+
data "scaleway_cockpit_sources" "my_sources" {
33+
project_id = "11111111-1111-1111-1111-111111111111"
34+
name = "my-data-source"
35+
}
36+
```
37+
38+
### Filter sources by origin
39+
40+
```hcl
41+
data "scaleway_cockpit_sources" "external" {
42+
project_id = "11111111-1111-1111-1111-111111111111"
43+
origin = "external"
44+
}
45+
```
46+
47+
### List default Scaleway sources
48+
49+
```hcl
50+
data "scaleway_cockpit_sources" "default" {
51+
project_id = "11111111-1111-1111-1111-111111111111"
52+
origin = "scaleway"
53+
}
54+
```
55+
56+
## Argument Reference
57+
58+
The following arguments are supported:
59+
60+
- `project_id` - (Optional) The project ID the cockpit sources are associated with.
61+
- `region` - (Optional) The region in which the cockpit sources are located.
62+
- `name` - (Optional) Filter sources by name.
63+
- `type` - (Optional) Filter sources by type. Possible values are: `metrics`, `logs`, `traces`.
64+
- `origin` - (Optional) Filter sources by origin. Possible values are: `scaleway`, `external`, `custom`.
65+
66+
## Attributes Reference
67+
68+
In addition to all arguments above, the following attributes are exported:
69+
70+
- `sources` - List of cockpit sources.
71+
72+
Each `sources` block contains:
73+
74+
- `id` - The ID of the data source.
75+
- `name` - Name of the datasource.
76+
- `url` - The URL of the datasource.
77+
- `type` - The type of the datasource.
78+
- `origin` - The origin of the datasource.
79+
- `synchronized_with_grafana` - Indicates whether the data source is synchronized with Grafana.
80+
- `created_at` - The date and time of the creation of the cockpit datasource.
81+
- `updated_at` - The date and time of the last update of the cockpit datasource.
82+
- `retention_days` - The number of days to retain data.
83+
- `push_url` - The URL endpoint used for pushing data to the cockpit data source.
84+
- `region` - The region of the data source.
85+
- `project_id` - The project ID of the data source.
86+

docs/data-sources/mongodb_instance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ output "mongodb_version" {
3939

4040
- `project_id` - (Optional) The ID of the project the MongoDB® instance is in. Can be used to filter instances when using `name`.
4141

42-
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#zones) in which the MongoDB® Instance exists.
42+
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the MongoDB® Instance exists.
4343

4444
- `organization_id` - (Defaults to [provider](../index.md#organization_id) `organization_id`) The ID of the organization the MongoDB® instance is in.
4545

@@ -64,5 +64,5 @@ In addition to all above arguments, the following attributes are exported:
6464
MongoDB® instance can be imported using the `id`, e.g.
6565

6666
```bash
67-
terraform import scaleway_mongodb_instance.main fr-par-1/11111111-1111-1111-1111-111111111111
67+
terraform import scaleway_mongodb_instance.main fr-par/11111111-1111-1111-1111-111111111111
6868
```

docs/resources/mnq_sqs_queue.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,44 @@ resource "scaleway_mnq_sqs_queue" "main" {
3636
}
3737
```
3838

39+
### With Dead Letter Queue
40+
41+
```terraform
42+
resource "scaleway_mnq_sqs" "main" {}
43+
44+
resource "scaleway_mnq_sqs_credentials" "main" {
45+
project_id = scaleway_mnq_sqs.main.project_id
46+
name = "sqs-credentials"
47+
48+
permissions {
49+
can_manage = true
50+
can_receive = false
51+
can_publish = false
52+
}
53+
}
54+
55+
resource "scaleway_mnq_sqs_queue" "dead_letter" {
56+
project_id = scaleway_mnq_sqs.main.project_id
57+
name = "dead-letter-queue"
58+
sqs_endpoint = scaleway_mnq_sqs.main.endpoint
59+
access_key = scaleway_mnq_sqs_credentials.main.access_key
60+
secret_key = scaleway_mnq_sqs_credentials.main.secret_key
61+
}
62+
63+
resource "scaleway_mnq_sqs_queue" "main" {
64+
project_id = scaleway_mnq_sqs.main.project_id
65+
name = "my-queue"
66+
sqs_endpoint = scaleway_mnq_sqs.main.endpoint
67+
access_key = scaleway_mnq_sqs_credentials.main.access_key
68+
secret_key = scaleway_mnq_sqs_credentials.main.secret_key
69+
70+
dead_letter_queue {
71+
id = scaleway_mnq_sqs_queue.dead_letter.id
72+
max_receive_count = 3
73+
}
74+
}
75+
```
76+
3977
## Argument Reference
4078

4179
The following arguments are supported:
@@ -62,10 +100,20 @@ The following arguments are supported:
62100

63101
- `message_max_size` - (Optional) The maximum size of a message. Should be in bytes. Must be between 1024 and 262_144. Defaults to 262_144.
64102

103+
- `dead_letter_queue` - (Optional) Configuration for the dead letter queue. See [Dead Letter Queue](#dead-letter-queue) below for details.
104+
65105
- `region` - (Defaults to [provider](../index.md#region) `region`). The [region](../guides/regions_and_zones.md#regions) in which SQS is enabled.
66106

67107
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the Project in which SQS is enabled.
68108

109+
## Dead Letter Queue
110+
111+
The `dead_letter_queue` block supports the following:
112+
113+
- `id` - (Required) The ID of the dead letter queue. Can be either in the format `{region}/{project-id}/{queue-name}` or `arn:scw:sqs:{region}:project-{project-id}:{queue-name}`.
114+
115+
- `max_receive_count` - (Required) The number of times a message is delivered to the source queue before being moved to the dead letter queue. Must be between 1 and 1000.
116+
69117

70118
## Attributes Reference
71119

docs/resources/mongodb_instance.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ The following arguments are supported:
104104
- `private_network` - (Optional) Private Network endpoints of the Database Instance.
105105
- `pn_id` - (Required) The ID of the Private Network.
106106
- `public_network` - (Optional) Public network endpoint configuration (no arguments).
107+
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the MongoDB® instance should be created.
108+
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the MongoDB® instance is associated with.
109+
107110
~> **Important** If neither private_network nor public_network is specified, a public network endpoint is created by default.
108111

109112

@@ -114,6 +117,7 @@ In addition to all arguments above, the following attributes are exported:
114117
- `id` - The ID of the MongoDB® instance.
115118
- `created_at` - The date and time of the creation of the MongoDB® instance.
116119
- `updated_at` - The date and time of the last update of the MongoDB® instance.
120+
- `region` - The region of the MongoDB® instance.
117121
- `private_network` - Private Network endpoints of the Database Instance.
118122
- `id` - The ID of the endpoint.
119123
- `ips` - List of IP addresses for your endpoint.
@@ -133,5 +137,5 @@ In addition to all arguments above, the following attributes are exported:
133137
MongoDB® instance can be imported using the `id`, e.g.
134138

135139
```bash
136-
terraform import scaleway_mongodb_instance.main fr-par-1/11111111-1111-1111-1111-111111111111
140+
terraform import scaleway_mongodb_instance.main fr-par/11111111-1111-1111-1111-111111111111
137141
```

docs/resources/mongodb_snapshot.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The following arguments are supported:
3333

3434
~> **Important:** Once set, `expires_at` cannot be removed.
3535

36-
- `region` - (Defaults to [provider](../index.md) `region`) The [region](../guides/regions_and_zones.md#regions) in which the MongoDB® snapshot should be created.
36+
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the MongoDB® snapshot should be created.
3737

3838
## Attributes Reference
3939

@@ -58,5 +58,5 @@ In addition to all arguments above, the following attributes are exported:
5858
MongoDB® snapshots can be imported using the `{region}/{id}`, e.g.
5959

6060
```bash
61-
terraform import scaleway_mongodb_snapshot.main fr-par-1/11111111-1111-1111-1111-111111111111
61+
terraform import scaleway_mongodb_snapshot.main fr-par/11111111-1111-1111-1111-111111111111
6262
```

docs/resources/mongodb_user.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
subcategory: "MongoDB®"
3+
page_title: "Scaleway: scaleway_mongodb_user"
4+
---
5+
6+
# Resource: scaleway_mongodb_user
7+
8+
Creates and manages Scaleway MongoDB® users.
9+
For more information refer to the [product documentation](https://www.scaleway.com/en/docs/managed-mongodb-databases/).
10+
11+
## Example Usage
12+
13+
### Basic
14+
15+
```terraform
16+
resource "scaleway_mongodb_instance" "main" {
17+
name = "test-mongodb-user"
18+
version = "7.0.12"
19+
node_type = "MGDB-PLAY2-NANO"
20+
node_number = 1
21+
user_name = "initial_user"
22+
password = "initial_password123"
23+
volume_size_in_gb = 5
24+
}
25+
26+
resource "scaleway_mongodb_user" "main" {
27+
instance_id = scaleway_mongodb_instance.main.id
28+
name = "my_user"
29+
password = "my_password123"
30+
31+
roles {
32+
role = "read_write"
33+
database_name = "my_database"
34+
}
35+
}
36+
```
37+
38+
### With Multiple Users
39+
40+
```terraform
41+
resource "scaleway_mongodb_instance" "main" {
42+
name = "test-mongodb-multi-user"
43+
version = "7.0.12"
44+
node_type = "MGDB-PLAY2-NANO"
45+
node_number = 1
46+
user_name = "admin_user"
47+
password = "admin_password123"
48+
volume_size_in_gb = 5
49+
}
50+
51+
resource "scaleway_mongodb_user" "app_user" {
52+
instance_id = scaleway_mongodb_instance.main.id
53+
name = "app_user"
54+
password = "app_password123"
55+
56+
roles {
57+
role = "read_write"
58+
database_name = "app_database"
59+
}
60+
61+
roles {
62+
role = "read"
63+
database_name = "logs_database"
64+
}
65+
}
66+
67+
resource "scaleway_mongodb_user" "admin_user" {
68+
instance_id = scaleway_mongodb_instance.main.id
69+
name = "admin_user"
70+
password = "admin_password123"
71+
72+
roles {
73+
role = "db_admin"
74+
database_name = "admin"
75+
}
76+
77+
roles {
78+
role = "read"
79+
any_database = true
80+
}
81+
}
82+
```
83+
84+
## Argument Reference
85+
86+
The following arguments are supported:
87+
88+
- `instance_id` - (Required) The ID of the MongoDB® instance.
89+
90+
- `name` - (Required) The name of the MongoDB® user.
91+
92+
- `password` - (Required) The password of the MongoDB® user.
93+
94+
- `roles` - (Optional) List of roles assigned to the user. Each role block supports:
95+
- `role` - (Required) The role name. Valid values are `read`, `read_write`, `db_admin`, `sync`.
96+
- `database_name` - (Optional) The database name for the role. Cannot be used with `any_database`.
97+
- `any_database` - (Optional) Apply the role to all databases. Cannot be used with `database_name`.
98+
99+
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the MongoDB® user should be created.
100+
101+
## Attributes Reference
102+
103+
In addition to all arguments above, the following attributes are exported:
104+
105+
- `id` - The ID of the MongoDB® user.
106+
107+
- `roles` - The list of roles assigned to the user.
108+
109+
## Import
110+
111+
MongoDB® users can be imported using the `{region}/{instance_id}/{name}`, e.g.
112+
113+
```bash
114+
terraform import scaleway_mongodb_user.main fr-par/11111111-1111-1111-1111-111111111111/my_user
115+
```

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/aws/aws-sdk-go-v2/credentials v1.18.10
1010
github.com/aws/aws-sdk-go-v2/service/s3 v1.85.1
1111
github.com/aws/aws-sdk-go-v2/service/sns v1.34.4
12-
github.com/aws/aws-sdk-go-v2/service/sqs v1.38.6
12+
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.3
1313
github.com/aws/smithy-go v1.23.0
1414
github.com/docker/docker v28.3.3+incompatible
1515
github.com/dustin/go-humanize v1.0.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ github.com/aws/aws-sdk-go-v2/service/s3 v1.85.1 h1:Hsqo8+dFxSdDvv9B2PgIx1AJAnDpq
101101
github.com/aws/aws-sdk-go-v2/service/s3 v1.85.1/go.mod h1:8Q0TAPXD68Z8YqlcIGHs/UNIDHsxErV9H4dl4vJEpgw=
102102
github.com/aws/aws-sdk-go-v2/service/sns v1.34.4 h1:ihddI5wufQQCJiujUgAvWRqZcfDmSKIfXlAuX7T95cg=
103103
github.com/aws/aws-sdk-go-v2/service/sns v1.34.4/go.mod h1:PJtxxMdj747j8DeZENRTTYAz/lx/pADn/U0k7YNNiUY=
104-
github.com/aws/aws-sdk-go-v2/service/sqs v1.38.6 h1:XwpzAaL0nKdSvDS0SRGIQWkqpS8DjcyBRJcatPBFijY=
105-
github.com/aws/aws-sdk-go-v2/service/sqs v1.38.6/go.mod h1:Bar4MrRxeqdn6XIh8JGfiXuFRmyrrsZNTJotxEJmWW0=
104+
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.3 h1:0dWg1Tkz3FnEo48DgAh7CT22hYyMShly8WMd3sGx0xI=
105+
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.3/go.mod h1:hpOo4IGPfGPlHRcf2nizYAzKfz8GzbQ8tTDIUR4H4GQ=
106106
github.com/aws/aws-sdk-go-v2/service/sso v1.29.1 h1:8OLZnVJPvjnrxEwHFg9hVUof/P4sibH+Ea4KKuqAGSg=
107107
github.com/aws/aws-sdk-go-v2/service/sso v1.29.1/go.mod h1:27M3BpVi0C02UiQh1w9nsBEit6pLhlaH3NHna6WUbDE=
108108
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.2 h1:gKWSTnqudpo8dAxqBqZnDoDWCiEh/40FziUjr/mo6uA=

internal/provider/provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ func Provider(config *Config) plugin.ProviderFunc {
215215
"scaleway_mnq_sqs_queue": mnq.ResourceSQSQueue(),
216216
"scaleway_mongodb_instance": mongodb.ResourceInstance(),
217217
"scaleway_mongodb_snapshot": mongodb.ResourceSnapshot(),
218+
"scaleway_mongodb_user": mongodb.ResourceUser(),
218219
"scaleway_object": object.ResourceObject(),
219220
"scaleway_object_bucket": object.ResourceBucket(),
220221
"scaleway_object_bucket_acl": object.ResourceBucketACL(),
@@ -268,6 +269,7 @@ func Provider(config *Config) plugin.ProviderFunc {
268269
"scaleway_block_volume": block.DataSourceVolume(),
269270
"scaleway_cockpit": cockpit.DataSourceCockpit(),
270271
"scaleway_cockpit_source": cockpit.DataSourceCockpitSource(),
272+
"scaleway_cockpit_sources": cockpit.DataSourceCockpitSources(),
271273
"scaleway_config": scwconfig.DataSourceConfig(),
272274
"scaleway_container": container.DataSourceContainer(),
273275
"scaleway_container_namespace": container.DataSourceNamespace(),

0 commit comments

Comments
 (0)