Skip to content

Commit f2f2c88

Browse files
authored
Merge branch 'master' into add_framework
2 parents 78a29c0 + c4455c2 commit f2f2c88

File tree

4 files changed

+129
-33
lines changed

4 files changed

+129
-33
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: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ require (
77
github.com/aws/aws-sdk-go-v2 v1.39.0
88
github.com/aws/aws-sdk-go-v2/config v1.31.8
99
github.com/aws/aws-sdk-go-v2/credentials v1.18.12
10-
github.com/aws/aws-sdk-go-v2/service/s3 v1.87.3
11-
github.com/aws/aws-sdk-go-v2/service/sns v1.38.1
12-
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.5
10+
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.1
11+
github.com/aws/aws-sdk-go-v2/service/sns v1.38.3
12+
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.6
1313
github.com/aws/smithy-go v1.23.0
14-
github.com/docker/docker v28.3.3+incompatible
14+
github.com/docker/docker v28.4.0+incompatible
1515
github.com/dustin/go-humanize v1.0.1
1616
github.com/google/go-cmp v0.7.0
1717
github.com/google/uuid v1.6.0
@@ -24,8 +24,8 @@ require (
2424
github.com/hashicorp/terraform-plugin-framework v1.16.0
2525
github.com/hashicorp/terraform-plugin-go v0.29.0
2626
github.com/hashicorp/terraform-plugin-log v0.9.0
27-
github.com/hashicorp/terraform-plugin-mux v0.20.0
28-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.0
27+
github.com/hashicorp/terraform-plugin-mux v0.21.0
28+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.1
2929
github.com/hashicorp/terraform-plugin-testing v1.13.3
3030
github.com/nats-io/jwt/v2 v2.8.0
3131
github.com/nats-io/nats.go v1.45.0
@@ -53,11 +53,11 @@ require (
5353
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.7 // indirect
5454
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.7 // indirect
5555
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
56-
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.6 // indirect
56+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.7 // indirect
5757
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 // indirect
58-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.6 // indirect
58+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.7 // indirect
5959
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.7 // indirect
60-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.6 // indirect
60+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.7 // indirect
6161
github.com/aws/aws-sdk-go-v2/service/sso v1.29.3 // indirect
6262
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.4 // indirect
6363
github.com/aws/aws-sdk-go-v2/service/sts v1.38.4 // indirect
@@ -82,7 +82,6 @@ require (
8282
github.com/fsnotify/fsnotify v1.8.0 // indirect
8383
github.com/go-logr/logr v1.4.3 // indirect
8484
github.com/go-logr/stdr v1.2.2 // indirect
85-
github.com/gogo/protobuf v1.3.2 // indirect
8685
github.com/golang/protobuf v1.5.4 // indirect
8786
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
8887
github.com/gookit/color v1.5.1 // indirect

go.sum

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,22 @@ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.7 h1:Y6DTZUn7ZUC4th9FMBb
8787
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.7/go.mod h1:x3XE6vMnU9QvHN/Wrx2s44kwzV2o2g5x/siw4ZUJ9g8=
8888
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo=
8989
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo=
90-
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.6 h1:R0tNFJqfjHL3900cqhXuwQ+1K4G0xc9Yf8EDbFXCKEw=
91-
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.6/go.mod h1:y/7sDdu+aJvPtGXr4xYosdpq9a6T9Z0jkXfugmti0rI=
90+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.7 h1:BszAktdUo2xlzmYHjWMq70DqJ7cROM8iBd3f6hrpuMQ=
91+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.7/go.mod h1:XJ1yHki/P7ZPuG4fd3f0Pg/dSGA2cTQBCLw82MH2H48=
9292
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 h1:oegbebPEMA/1Jny7kvwejowCaHz1FWZAQ94WXFNCyTM=
9393
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1/go.mod h1:kemo5Myr9ac0U9JfSjMo9yHLtw+pECEHsFtJ9tqCEI8=
94-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.6 h1:hncKj/4gR+TPauZgTAsxOxNcvBayhUlYZ6LO/BYiQ30=
95-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.6/go.mod h1:OiIh45tp6HdJDDJGnja0mw8ihQGz3VGrUflLqSL0SmM=
94+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.7 h1:zmZ8qvtE9chfhBPuKB2aQFxW5F/rpwXUgmcVCgQzqRw=
95+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.7/go.mod h1:vVYfbpd2l+pKqlSIDIOgouxNsGu5il9uDp0ooWb0jys=
9696
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.7 h1:mLgc5QIgOy26qyh5bvW+nDoAppxgn3J2WV3m9ewq7+8=
9797
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.7/go.mod h1:wXb/eQnqt8mDQIQTTmcw58B5mYGxzLGZGK8PWNFZ0BA=
98-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.6 h1:nEXUSAwyUfLTgnc9cxlDWy637qsq4UWwp3sNAfl0Z3Y=
99-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.6/go.mod h1:HGzIULx4Ge3Do2V0FaiYKcyKzOqwrhUZgCI77NisswQ=
100-
github.com/aws/aws-sdk-go-v2/service/s3 v1.87.3 h1:ETkfWcXP2KNPLecaDa++5bsQhCRa5M5sLUJa5DWYIIg=
101-
github.com/aws/aws-sdk-go-v2/service/s3 v1.87.3/go.mod h1:+/3ZTqoYb3Ur7DObD00tarKMLMuKg8iqz5CHEanqTnw=
102-
github.com/aws/aws-sdk-go-v2/service/sns v1.38.1 h1:6AqFh9gI+BEOlKRXaYryGMCwygwaTlISVUs6qEMosaU=
103-
github.com/aws/aws-sdk-go-v2/service/sns v1.38.1/go.mod h1:wZGK3CJNllAOeJ/xrnyTHotaXEvtC27KOLMMKGBeT+4=
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=
98+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.7 h1:u3VbDKUCWarWiU+aIUK4gjTr/wQFXV17y3hgNno9fcA=
99+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.7/go.mod h1:/OuMQwhSyRapYxq6ZNpPer8juGNrB4P5Oz8bZ2cgjQE=
100+
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.1 h1:+RpGuaQ72qnU83qBKVwxkznewEdAGhIWo/PQCmkhhog=
101+
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.1/go.mod h1:xajPTguLoeQMAOE44AAP2RQoUhF8ey1g5IFHARv71po=
102+
github.com/aws/aws-sdk-go-v2/service/sns v1.38.3 h1:4T0EjsLqUANqnBWafst2+Nr3Uw44MPdrPgysNbxDqBs=
103+
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.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=
@@ -159,8 +159,8 @@ github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI=
159159
github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ=
160160
github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk=
161161
github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE=
162-
github.com/docker/docker v28.3.3+incompatible h1:Dypm25kh4rmk49v1eiVbsAtpAsYURjYkaKubwuBdxEI=
163-
github.com/docker/docker v28.3.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
162+
github.com/docker/docker v28.4.0+incompatible h1:KVC7bz5zJY/4AZe/78BIvCnPsLaC9T/zh72xnlrTTOk=
163+
github.com/docker/docker v28.4.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
164164
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
165165
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
166166
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
@@ -202,8 +202,6 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre
202202
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
203203
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
204204
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
205-
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
206-
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
207205
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
208206
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
209207
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -331,10 +329,10 @@ github.com/hashicorp/terraform-plugin-go v0.29.0 h1:1nXKl/nSpaYIUBU1IG/EsDOX0vv+
331329
github.com/hashicorp/terraform-plugin-go v0.29.0/go.mod h1:vYZbIyvxyy0FWSmDHChCqKvI40cFTDGSb3D8D70i9GM=
332330
github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0=
333331
github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow=
334-
github.com/hashicorp/terraform-plugin-mux v0.20.0 h1:3QpBnI9uCuL0Yy2Rq/kR9cOdmOFNhw88A2GoZtk5aXM=
335-
github.com/hashicorp/terraform-plugin-mux v0.20.0/go.mod h1:wSIZwJjSYk86NOTX3fKUlThMT4EAV1XpBHz9SAvjQr4=
336-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.0 h1:PQP7Crrc7t/ozj+P9x0/lsTzGNy3lVppH8zAJylofaE=
337-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.0/go.mod h1:GQhpKVvvuwzD79e8/NZ+xzj+ZpWovdPAe8nfV/skwNU=
332+
github.com/hashicorp/terraform-plugin-mux v0.21.0 h1:QsEYnzSD2c3zT8zUrUGqaFGhV/Z8zRUlU7FY3ZPJFfw=
333+
github.com/hashicorp/terraform-plugin-mux v0.21.0/go.mod h1:Qpt8+6AD7NmL0DS7ASkN0EXpDQ2J/FnnIgeUr1tzr5A=
334+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.1 h1:mlAq/OrMlg04IuJT7NpefI1wwtdpWudnEmjuQs04t/4=
335+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.1/go.mod h1:GQhpKVvvuwzD79e8/NZ+xzj+ZpWovdPAe8nfV/skwNU=
338336
github.com/hashicorp/terraform-plugin-testing v1.13.3 h1:QLi/khB8Z0a5L54AfPrHukFpnwsGL8cwwswj4RZduCo=
339337
github.com/hashicorp/terraform-plugin-testing v1.13.3/go.mod h1:WHQ9FDdiLoneey2/QHpGM/6SAYf4A7AZazVg7230pLE=
340338
github.com/hashicorp/terraform-registry-address v0.4.0 h1:S1yCGomj30Sao4l5BMPjTGZmCNzuv7/GDTDX99E9gTk=
@@ -369,7 +367,6 @@ github.com/katbyte/terrafmt v0.5.5 h1:rd0aJYfGj9euWxRAbD5Km+cH+Fh68Tv2sUrerZI5fU
369367
github.com/katbyte/terrafmt v0.5.5/go.mod h1:y8qQXMFOm2d5t9pqrQeGPKpsuIHrU4F1BHXcbF2pvUo=
370368
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
371369
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
372-
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
373370
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
374371
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
375372
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
@@ -777,7 +774,6 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY
777774
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
778775
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
779776
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
780-
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
781777
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
782778
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
783779
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
@@ -786,7 +782,6 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f
786782
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
787783
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
788784
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
789-
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
790785
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
791786
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
792787
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=

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)