Skip to content

Commit 4684c7c

Browse files
committed
example in readme
1 parent 032c072 commit 4684c7c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,22 @@ dynamic "tags" {
7676
#### Dynamic blocks in regions_config
7777

7878
You can use `dynamic` blocks for `regions_config`. The plugin assumes that `for_each` has an expression which is evaluated to a `list` or `set` of objects.
79-
Dynamic block and individual blocks for `regions_config` are not supported at the same time in a `replication_specs`.
79+
Dynamic block and individual blocks for `regions_config` are not supported at the same time in a `replication_specs`. This is an example of how to use dynamic blocks in `regions_config`:
80+
```hcl
81+
replication_specs {
82+
num_shards = var.replication_specs.num_shards
83+
zone_name = var.replication_specs.zone_name # only needed if you're using zones
84+
dynamic "regions_config" {
85+
for_each = var.replication_specs.regions_config
86+
content {
87+
priority = regions_config.value.priority
88+
region_name = regions_config.value.region_name
89+
electable_nodes = regions_config.value.electable_nodes
90+
read_only_nodes = regions_config.value.read_only_nodes
91+
}
92+
}
93+
}
94+
```
8095

8196
### Limitations
8297

0 commit comments

Comments
 (0)