Skip to content

Commit 36e5e03

Browse files
authored
Merge branch 'master' into feat/support-resource-identity
2 parents d4d2100 + c4455c2 commit 36e5e03

File tree

4 files changed

+108
-6
lines changed

4 files changed

+108
-6
lines changed

docs/resources/rdb_acl.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,55 @@ resource "scaleway_rdb_acl" "main" {
3232
}
3333
```
3434

35+
### Multiple ACL Rules
36+
37+
```terraform
38+
resource "scaleway_rdb_acl" "main" {
39+
instance_id = scaleway_rdb_instance.main.id
40+
41+
acl_rules {
42+
ip = "1.2.3.4/32"
43+
description = "Office IP"
44+
}
45+
46+
acl_rules {
47+
ip = "5.6.7.8/32"
48+
description = "Home IP"
49+
}
50+
51+
acl_rules {
52+
ip = "10.0.0.0/24"
53+
description = "Internal network"
54+
}
55+
}
56+
```
57+
58+
### Dynamic ACL Rules with Variables
59+
60+
```terraform
61+
variable "allowed_ips" {
62+
description = "Map of allowed IPs with descriptions"
63+
type = map(string)
64+
default = {
65+
"1.2.3.4/32" = "Office IP"
66+
"5.6.7.8/32" = "Home IP"
67+
"10.0.0.0/24" = "Internal network"
68+
}
69+
}
70+
71+
resource "scaleway_rdb_acl" "main" {
72+
instance_id = scaleway_rdb_instance.main.id
73+
74+
dynamic "acl_rules" {
75+
for_each = var.allowed_ips
76+
content {
77+
ip = acl_rules.key
78+
description = acl_rules.value
79+
}
80+
}
81+
}
82+
```
83+
3584
## Argument Reference
3685

3786
The following arguments are supported:
@@ -42,6 +91,8 @@ The following arguments are supported:
4291

4392
- `acl_rules` - A list of ACLs (structure is described below)
4493

94+
~> **Important:** The `scaleway_rdb_acl` resource replaces **all** ACL rules for the given instance. Multiple `scaleway_rdb_acl` resources targeting the same `instance_id` will conflict with each other. Use multiple `acl_rules` blocks within a single resource instead.
95+
4596
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the Database Instance should be created.
4697

4798
The `acl_rules` block supports:

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/aws/aws-sdk-go-v2/credentials v1.18.12
1010
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.1
1111
github.com/aws/aws-sdk-go-v2/service/sns v1.38.3
12-
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.5
12+
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.6
1313
github.com/aws/smithy-go v1.23.0
1414
github.com/docker/docker v28.4.0+incompatible
1515
github.com/dustin/go-humanize v1.0.1
@@ -24,7 +24,7 @@ require (
2424
github.com/hashicorp/terraform-plugin-go v0.29.0
2525
github.com/hashicorp/terraform-plugin-log v0.9.0
2626
github.com/hashicorp/terraform-plugin-mux v0.21.0
27-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.0
27+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.1
2828
github.com/hashicorp/terraform-plugin-testing v1.13.3
2929
github.com/nats-io/jwt/v2 v2.8.0
3030
github.com/nats-io/nats.go v1.45.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ github.com/aws/aws-sdk-go-v2/service/s3 v1.88.1 h1:+RpGuaQ72qnU83qBKVwxkznewEdAG
101101
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.1/go.mod h1:xajPTguLoeQMAOE44AAP2RQoUhF8ey1g5IFHARv71po=
102102
github.com/aws/aws-sdk-go-v2/service/sns v1.38.3 h1:4T0EjsLqUANqnBWafst2+Nr3Uw44MPdrPgysNbxDqBs=
103103
github.com/aws/aws-sdk-go-v2/service/sns v1.38.3/go.mod h1:kHMCS+JDWKuKSDP9J/v3dlV2S9zNBKbXzaLy/kHSdEE=
104-
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.5 h1:HbaHWaTkGec2pMa/UQa3+WNWtUaFFF1ZLfwCeVFtBns=
105-
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.5/go.mod h1:wCAPjT7bNg5+4HSNefwNEC2hM3d+NSD5w5DU/8jrPrI=
104+
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.6 h1:TxOBDZKQGhO2Q2Z3HiaqXjw582f6IFue+z9sM/RgXkk=
105+
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.6/go.mod h1:wCAPjT7bNg5+4HSNefwNEC2hM3d+NSD5w5DU/8jrPrI=
106106
github.com/aws/aws-sdk-go-v2/service/sso v1.29.3 h1:7PKX3VYsZ8LUWceVRuv0+PU+E7OtQb1lgmi5vmUE9CM=
107107
github.com/aws/aws-sdk-go-v2/service/sso v1.29.3/go.mod h1:Ql6jE9kyyWI5JHn+61UT/Y5Z0oyVJGmgmJbZD5g4unY=
108108
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.4 h1:e0XBRn3AptQotkyBFrHAxFB8mDhAIOfsG+7KyJ0dg98=
@@ -329,8 +329,8 @@ github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9T
329329
github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow=
330330
github.com/hashicorp/terraform-plugin-mux v0.21.0 h1:QsEYnzSD2c3zT8zUrUGqaFGhV/Z8zRUlU7FY3ZPJFfw=
331331
github.com/hashicorp/terraform-plugin-mux v0.21.0/go.mod h1:Qpt8+6AD7NmL0DS7ASkN0EXpDQ2J/FnnIgeUr1tzr5A=
332-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.0 h1:PQP7Crrc7t/ozj+P9x0/lsTzGNy3lVppH8zAJylofaE=
333-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.0/go.mod h1:GQhpKVvvuwzD79e8/NZ+xzj+ZpWovdPAe8nfV/skwNU=
332+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.1 h1:mlAq/OrMlg04IuJT7NpefI1wwtdpWudnEmjuQs04t/4=
333+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.1/go.mod h1:GQhpKVvvuwzD79e8/NZ+xzj+ZpWovdPAe8nfV/skwNU=
334334
github.com/hashicorp/terraform-plugin-testing v1.13.3 h1:QLi/khB8Z0a5L54AfPrHukFpnwsGL8cwwswj4RZduCo=
335335
github.com/hashicorp/terraform-plugin-testing v1.13.3/go.mod h1:WHQ9FDdiLoneey2/QHpGM/6SAYf4A7AZazVg7230pLE=
336336
github.com/hashicorp/terraform-registry-address v0.4.0 h1:S1yCGomj30Sao4l5BMPjTGZmCNzuv7/GDTDX99E9gTk=

templates/resources/rdb_acl.md.tmpl

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,55 @@ resource "scaleway_rdb_acl" "main" {
3232
}
3333
```
3434

35+
### Multiple ACL Rules
36+
37+
```terraform
38+
resource "scaleway_rdb_acl" "main" {
39+
instance_id = scaleway_rdb_instance.main.id
40+
41+
acl_rules {
42+
ip = "1.2.3.4/32"
43+
description = "Office IP"
44+
}
45+
46+
acl_rules {
47+
ip = "5.6.7.8/32"
48+
description = "Home IP"
49+
}
50+
51+
acl_rules {
52+
ip = "10.0.0.0/24"
53+
description = "Internal network"
54+
}
55+
}
56+
```
57+
58+
### Dynamic ACL Rules with Variables
59+
60+
```terraform
61+
variable "allowed_ips" {
62+
description = "Map of allowed IPs with descriptions"
63+
type = map(string)
64+
default = {
65+
"1.2.3.4/32" = "Office IP"
66+
"5.6.7.8/32" = "Home IP"
67+
"10.0.0.0/24" = "Internal network"
68+
}
69+
}
70+
71+
resource "scaleway_rdb_acl" "main" {
72+
instance_id = scaleway_rdb_instance.main.id
73+
74+
dynamic "acl_rules" {
75+
for_each = var.allowed_ips
76+
content {
77+
ip = acl_rules.key
78+
description = acl_rules.value
79+
}
80+
}
81+
}
82+
```
83+
3584
## Argument Reference
3685

3786
The following arguments are supported:
@@ -42,6 +91,8 @@ The following arguments are supported:
4291

4392
- `acl_rules` - A list of ACLs (structure is described below)
4493

94+
~> **Important:** The `scaleway_rdb_acl` resource replaces **all** ACL rules for the given instance. Multiple `scaleway_rdb_acl` resources targeting the same `instance_id` will conflict with each other. Use multiple `acl_rules` blocks within a single resource instead.
95+
4596
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the Database Instance should be created.
4697

4798
The `acl_rules` block supports:

0 commit comments

Comments
 (0)