From 81640f9778afaeb0da788ad41f5ad5335e0415fd Mon Sep 17 00:00:00 2001 From: noham14 <45514308+noham14@users.noreply.github.com> Date: Thu, 16 Feb 2023 12:29:47 +0200 Subject: [PATCH 1/5] Update rediscloud_active_active_regions.md --- .../rediscloud_active_active_regions.md | 36 ++++++++----------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/docs/resources/rediscloud_active_active_regions.md b/docs/resources/rediscloud_active_active_regions.md index 851a99d0..c93f9a55 100644 --- a/docs/resources/rediscloud_active_active_regions.md +++ b/docs/resources/rediscloud_active_active_regions.md @@ -19,16 +19,15 @@ data "rediscloud_payment_method" "card" { card_type = "Visa" } -resource "rediscloud_active_active_subscription_regions" "example" { - subscription_id = 151945 +resource "rediscloud_active_active_subscription_regions" "regions-resource" { + subscription_id = rediscloud_active_active_subscription.subscription-resource.id delete_regions = false region { region = "us-east-1" networking_deployment_cidr = "10.0.0.0/24" recreate_region = false database { - id = "7839" - database_name = "test-db-1" + database_id = rediscloud_active_active_subscription_database.database-resource.id local_write_operations_per_second = 1000 local_read_operations_per_second = 1000 } @@ -38,8 +37,7 @@ resource "rediscloud_active_active_subscription_regions" "example" { networking_deployment_cidr = "10.1.0.0/24" recreate_region = false database { - id = "7839" - database_name = "test-db-1" + database_id = rediscloud_active_active_subscription_database.database-resource.id local_write_operations_per_second = 1000 local_read_operations_per_second = 1000 } @@ -49,8 +47,7 @@ resource "rediscloud_active_active_subscription_regions" "example" { networking_deployment_cidr = "10.2.0.0/24" recreate_region = false database { - id = "7839" - database_name = "test-db-1" + database_id = rediscloud_active_active_subscription_database.database-resource.id local_write_operations_per_second = 1500 local_read_operations_per_second = 1500 } @@ -68,36 +65,31 @@ The following arguments are supported: The `region` block supports: -* `region_id` - (Optional) Region ID * `region` - (Required) Region name -* `vpc_id` - (Required) Identifier of the VPC to be peered * `networking_deployment_cidr` - (Required) Deployment CIDR mask -* `recreate_region` - (Optional) Flag, needs to be set if a region has to be re-created. A region will need to be re-created in the case of a change on - the `networking_deployment_cidr` field. During re-create the region will be deleted (so the `delete_regions` flag also needs to be set) and then created again. -* `database` - (Required) The database resource, documented below +* `recreate_region` - (Optional) Protection flag, needs to be set if a region has to be re-created. A region will need to be re-created in the case of a change on the `networking_deployment_cidr` field. During re-create, the region will be deleted (so the `delete_regions` flag also needs to be set) and then created again. Default: 'false' +* `database` - (Required) A block defining the write and read operations in the region, per database, documented below The `database` block supports: -* `id` - (Required) Database id beloging to the subscription -* `database_name` - (Required) Database name belonging to the subscription -* `local_write_operations_per_second` - (Required) Local throughput measurement for an active-active region -* `local_read_operations_per_second` - (Required) Local throughput measurement for an active-active region +* `database_id` - (Required) Database ID belonging to the subscription +* `local_write_operations_per_second` - (Required) Local write operations per second for this active-active region +* `local_read_operations_per_second` - (Required) Local read operations per second for this active-active region ### Timeouts The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: -* `create` - (Defaults to 60 mins) Used when creating the subscription -* `update` - (Defaults to 60 mins) Used when updating the subscription -* `delete` - (Defaults to 10 mins) Used when destroying the subscription +* `create` - (Defaults to 60 mins) Used when creating the regions +* `update` - (Defaults to 60 mins) Used when updating the regions +* `delete` - (Defaults to 10 mins) Used when destroying the regions ## Import `rediscloud_active_active_regions` can be imported using the ID of the subscription, e.g. ``` -$ terraform import rediscloud_active_active_regions.example 12345678 +$ terraform import rediscloud_active_active_regions.regions-resource 12345678 ``` -~> **Note:** the creation_plan block will be ignored during imports. From bb233528b3199b1ffa4a55467b9d84425dcea459 Mon Sep 17 00:00:00 2001 From: noham14 <45514308+noham14@users.noreply.github.com> Date: Thu, 16 Feb 2023 15:38:01 +0200 Subject: [PATCH 2/5] Update rediscloud_active_active_regions.md --- docs/resources/rediscloud_active_active_regions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/resources/rediscloud_active_active_regions.md b/docs/resources/rediscloud_active_active_regions.md index c93f9a55..67a67fa0 100644 --- a/docs/resources/rediscloud_active_active_regions.md +++ b/docs/resources/rediscloud_active_active_regions.md @@ -28,6 +28,7 @@ resource "rediscloud_active_active_subscription_regions" "regions-resource" { recreate_region = false database { database_id = rediscloud_active_active_subscription_database.database-resource.id + database_name = rediscloud_active_active_subscription_database.database-resource.name local_write_operations_per_second = 1000 local_read_operations_per_second = 1000 } @@ -38,6 +39,7 @@ resource "rediscloud_active_active_subscription_regions" "regions-resource" { recreate_region = false database { database_id = rediscloud_active_active_subscription_database.database-resource.id + database_name = rediscloud_active_active_subscription_database.database-resource.name local_write_operations_per_second = 1000 local_read_operations_per_second = 1000 } @@ -48,6 +50,7 @@ resource "rediscloud_active_active_subscription_regions" "regions-resource" { recreate_region = false database { database_id = rediscloud_active_active_subscription_database.database-resource.id + database_name = rediscloud_active_active_subscription_database.database-resource.name local_write_operations_per_second = 1500 local_read_operations_per_second = 1500 } @@ -73,6 +76,7 @@ The `region` block supports: The `database` block supports: * `database_id` - (Required) Database ID belonging to the subscription +* `database_name` - (Required) Database name belonging to the subscription * `local_write_operations_per_second` - (Required) Local write operations per second for this active-active region * `local_read_operations_per_second` - (Required) Local read operations per second for this active-active region From 418b071495edec0168fbda9d9060a671b7fc7b29 Mon Sep 17 00:00:00 2001 From: noham14 <45514308+noham14@users.noreply.github.com> Date: Thu, 16 Feb 2023 18:51:25 +0200 Subject: [PATCH 3/5] Update rediscloud_active_active_regions.md --- docs/resources/rediscloud_active_active_regions.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/resources/rediscloud_active_active_regions.md b/docs/resources/rediscloud_active_active_regions.md index 67a67fa0..6201cba7 100644 --- a/docs/resources/rediscloud_active_active_regions.md +++ b/docs/resources/rediscloud_active_active_regions.md @@ -14,11 +14,7 @@ your regions defined in separate resources in the most efficient way. ## Example Usage -```hcl -data "rediscloud_payment_method" "card" { - card_type = "Visa" -} - +```hcl resource "rediscloud_active_active_subscription_regions" "regions-resource" { subscription_id = rediscloud_active_active_subscription.subscription-resource.id delete_regions = false @@ -34,7 +30,7 @@ resource "rediscloud_active_active_subscription_regions" "regions-resource" { } } region { - region = "eu-west-1" + region = "us-east-2" networking_deployment_cidr = "10.1.0.0/24" recreate_region = false database { From 1005a61977bf4e5f5447cf4580f5a43665407e1a Mon Sep 17 00:00:00 2001 From: noham14 <45514308+noham14@users.noreply.github.com> Date: Thu, 16 Feb 2023 19:42:01 +0200 Subject: [PATCH 4/5] Update rediscloud_active_active_regions.md --- .../rediscloud_active_active_regions.md | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/docs/resources/rediscloud_active_active_regions.md b/docs/resources/rediscloud_active_active_regions.md index 6201cba7..65b41c59 100644 --- a/docs/resources/rediscloud_active_active_regions.md +++ b/docs/resources/rediscloud_active_active_regions.md @@ -20,10 +20,9 @@ resource "rediscloud_active_active_subscription_regions" "regions-resource" { delete_regions = false region { region = "us-east-1" - networking_deployment_cidr = "10.0.0.0/24" - recreate_region = false + networking_deployment_cidr = "192.168.0.0/24" database { - database_id = rediscloud_active_active_subscription_database.database-resource.id + database_id = rediscloud_active_active_subscription_database.database-resource.db_id database_name = rediscloud_active_active_subscription_database.database-resource.name local_write_operations_per_second = 1000 local_read_operations_per_second = 1000 @@ -32,25 +31,13 @@ resource "rediscloud_active_active_subscription_regions" "regions-resource" { region { region = "us-east-2" networking_deployment_cidr = "10.1.0.0/24" - recreate_region = false database { - database_id = rediscloud_active_active_subscription_database.database-resource.id + database_id = rediscloud_active_active_subscription_database.database-resource.db_id database_name = rediscloud_active_active_subscription_database.database-resource.name - local_write_operations_per_second = 1000 - local_read_operations_per_second = 1000 + local_write_operations_per_second = 2000 + local_read_operations_per_second = 4000 } } - region { - region = "eu-west-2" - networking_deployment_cidr = "10.2.0.0/24" - recreate_region = false - database { - database_id = rediscloud_active_active_subscription_database.database-resource.id - database_name = rediscloud_active_active_subscription_database.database-resource.name - local_write_operations_per_second = 1500 - local_read_operations_per_second = 1500 - } - } } ``` From acd633f01e8fdcc644b1881d133abe289c5250e0 Mon Sep 17 00:00:00 2001 From: noham14 <45514308+noham14@users.noreply.github.com> Date: Thu, 16 Feb 2023 19:52:53 +0200 Subject: [PATCH 5/5] Update rediscloud_active_active_regions.md --- docs/resources/rediscloud_active_active_regions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/rediscloud_active_active_regions.md b/docs/resources/rediscloud_active_active_regions.md index 65b41c59..19b49f27 100644 --- a/docs/resources/rediscloud_active_active_regions.md +++ b/docs/resources/rediscloud_active_active_regions.md @@ -30,7 +30,7 @@ resource "rediscloud_active_active_subscription_regions" "regions-resource" { } region { region = "us-east-2" - networking_deployment_cidr = "10.1.0.0/24" + networking_deployment_cidr = "10.0.1.0/24" database { database_id = rediscloud_active_active_subscription_database.database-resource.db_id database_name = rediscloud_active_active_subscription_database.database-resource.name