Skip to content

Commit e922f4c

Browse files
bengesoffgreg-ocpvegh-ocdanielarbivnoham14
authored
feat: support new active-active databases (#318)
* (WIP) Initial AA subscription implementation * adds aa subscription documentation * adds acceptance tests * addresses TODOs * Updating go client api version * Removing replace from go.mod * Fixing AA Subscription Acceptance test * Removing unneccesary test for average_item_size_in_bytes * Temporary cloud_account_id fix while oc account is broken * Active active read initial create * Active active Region create acceptance test * Active Active Region update, delete and in dev acceptance test * Refactoring + fixing state update issue on recreate_region flag change * AA Database implementation Squashed commit of the following: commit ebf043a Author: gregnuttall <[email protected]> Date: Tue Dec 20 14:15:05 2022 +0000 Comment out WIP tests commit b0ade13 Author: gregnuttall <[email protected]> Date: Tue Dec 20 13:42:49 2022 +0000 fix tf lint issue and remove completed TODOs commit 9e5d412 Merge: 67d9a9e 4313fe7 Author: gregnuttall <[email protected]> Date: Tue Dec 20 13:33:47 2022 +0000 Merge branch 'aa_database' of github.com:RedisLabs/terraform-provider-rediscloud into aa_database commit 67d9a9e Author: gregnuttall <[email protected]> Date: Tue Dec 20 13:33:17 2022 +0000 acceptance test fixes commit 5c3c9c5 Author: gregnuttall <[email protected]> Date: Tue Dec 20 13:30:57 2022 +0000 documentation fixes commit d0f3338 Author: gregnuttall <[email protected]> Date: Tue Dec 20 13:30:28 2022 +0000 addresses TFLint issues commit 4313fe7 Merge: d3c436b 848cfa6 Author: Greg Nuttall <[email protected]> Date: Tue Dec 20 12:01:47 2022 +0000 Merge branch 'develop' into aa_database commit d3c436b Author: gregnuttall <[email protected]> Date: Tue Dec 20 11:43:38 2022 +0000 updates go.mod commit 030a8e2 Author: gregnuttall <[email protected]> Date: Tue Dec 20 11:35:06 2022 +0000 Fixing small TODOs commit 6085345 Author: gregnuttall <[email protected]> Date: Tue Dec 20 10:58:16 2022 +0000 add public and private endpoint attributes commit 80a87a0 Author: gregnuttall <[email protected]> Date: Fri Dec 16 10:42:46 2022 +0000 single layer map solution commit 606a948 Author: gregnuttall <[email protected]> Date: Thu Dec 15 13:39:01 2022 +0000 (WIP) AA Database implementation commit c1bbd18 Author: gregnuttall <[email protected]> Date: Thu Dec 15 13:31:48 2022 +0000 updates single region database documentation commit c26b8e6 Author: gregnuttall <[email protected]> Date: Thu Dec 15 13:30:34 2022 +0000 removing secrets workflow commit 404cc2c Author: gregnuttall <[email protected]> Date: Thu Dec 15 11:19:49 2022 +0000 temporarily add secrets hack commit 1bbe7f7 Merge: a6a5615 028e163 Author: gregnuttall <[email protected]> Date: Tue Dec 6 09:15:41 2022 +0000 Merge branch 'aa_database' of github.com:RedisLabs/terraform-provider-rediscloud into aa_database commit a6a5615 Author: gregnuttall <[email protected]> Date: Mon Dec 5 13:42:52 2022 +0000 AA Database add create and update functions commit 028e163 Author: Peter Vegh <[email protected]> Date: Mon Dec 5 11:23:58 2022 +0000 Active active Database Acceptance test commit a716015 Author: Peter Vegh <[email protected]> Date: Mon Dec 5 10:22:25 2022 +0000 Adding Active Active Database read Acceptance test commit 09da797 Author: Peter Vegh <[email protected]> Date: Mon Dec 5 08:49:02 2022 +0000 Updating ActiveActiveDatabase documentation commit f95146d Merge: 02da20a af4e26e Author: gregnuttall <[email protected]> Date: Thu Dec 1 16:09:02 2022 +0000 Merge branch 'aa_subscription' into aa_database commit 02da20a Author: gregnuttall <[email protected]> Date: Thu Dec 1 14:26:28 2022 +0000 (WIP) Initial AA database implementation commit 16c6a15 Author: gregnuttall <[email protected]> Date: Thu Dec 1 13:12:04 2022 +0000 add aa database to provider.go * Review changes + documentation for Regions resource * fix issue with undefined override_region block * Enabling scenario back * Fixing Linting issue * Updating AWS_CLOUD_ACCOUNT in gihub actions * Fixing ordering issue of delete and create + a new acceptance to test * Fixing aa regions acceptance test * Update terraform_provider.yml update AWS_TEST_CLOUD_ACCOUNT_NAME * Fixing AA subscription test checks + increasing git workflow test timeout * Revert "Temporary cloud_account_id fix while oc account is broken" This reverts commit 848cfa6. * Adding wait for db delete * Active-Active Database (#300) * add aa database to provider.go * (WIP) Initial AA database implementation * Updating ActiveActiveDatabase documentation * Adding Active Active Database read Acceptance test * Active active Database Acceptance test * AA Database add create and update functions * temporarily add secrets hack * removing secrets workflow * updates single region database documentation * (WIP) AA Database implementation * single layer map solution * add public and private endpoint attributes * Fixing small TODOs * updates go.mod * addresses TFLint issues * documentation fixes * acceptance test fixes * fix tf lint issue and remove completed TODOs * Comment out WIP tests * add source_ips example to documentation * fixes failing acceptance tests * fixing issues discovered through acc tests * update import documentation * fix: active-active subscription acceptance test attribute check bug * fix: subscription acceptance test's import check Needs to handle the case when the set isn't defined as an equivalent to the set being empty. This is the same behaviour as the `resource.TestCheckResourceAttr` check from the SDK. * upgrade go api client * chore: change test timeout to 6h instead of 2h * fix acceptance test * remove ossClusterApi checks temporarily * wait for database to be deleted (corrects merge error) * remove old TODOs * remove unused import * Addresses code review comments Co-authored-by: Peter Vegh <[email protected]> Co-authored-by: Ben Gesoff <[email protected]> * test: add `CheckDestroy` function for active-active resources (#307) * test: add `CheckDestroy` function for active-active subscriptions * chore: fake change to try and trigger CI * test: add `CheckDestroy` function for active-active regions * feat: active-active subscription network peering (#313) * wip: Byron implementation * wip Ben * chore: temporarily point to `aa_subscription` branch of Go client * wip: peering test * test: use peering resources from envs vars * ci: update test cloud account name * test: reenable the `support_oss_cluster_api` test * chore: update go client dependency * ci: reset `AWS_TEST_CLOUD_ACCOUNT_NAME` * test: fix some of the reasons for previous failure * fix: read `vpc_cidrs` correctly when there's only one CIDR block * test: ignore global and override attributes while importing AA DB Not supported by import operation, as stated in documentation. Therefore must also be omitted when testing. Co-authored-by: gregnuttall <[email protected]> * chore: update rediscloud-go-api and add AA test sweepers (#315) * fix: AA regions bug and some assorted documentation things (#317) * fix `make build` command * fix: AA regions not setting resource ID when all regions already exist * make `support_oss_cluster_api` optional to match docs * docs: fix AA peering example to use AA subscription * fix: importing active-active regions failing due to incorrect ID (#319) * Update rediscloud_active_active_subscription.md Fixes of documentation - rediscloud_active_active_subscription * Update rediscloud_active_active_subscription_database.md Align documentation - rediscloud_active_active_subscription_database resource * fix: regions inactive subscription error and memory limit hardcoding (#320) * fix: remove incorrect hardcoding of DB memory limit * temp: change rediscloud-go-api dependency to branch * fix: restructure regions resource to always use update logic, fix issue Also some minor improvements such as code simplifications, and avoiding the use of the `cmp` package which should only be used in tests as it can panic instead of error for some conditions. The create function now calls into the update function so that the logic is consistent. It also rearranges a lot of the code so it is easier to follow. Finally the order of when things get created and deleted are more clear and the appropriate waits are in place. There is an outstanding TODO regarding subscription mutexes which I will seek further clarification on before merging. * chore: bump regions timeout to 1hr for extra subscription waits * test: update tests to avoid CIDR clash error * refactor: make AA subs cloud_provider default to AWS * fix: move subscription mutex locking to guard actual update operations * ci: change cloud account name * chore: remove go.mod `replace` for go-api and upgrade (#329) * refactor: remove support_oss_cluster_api from subscription creation plan (#330) * refactor: remove support_oss_cluster_api from subscription creation plan * test: remove `support_oss_cluster_api` attribute from test resources * docs: remove `region_id` from active-active regions * docs: set `region_id` and `vpc_id` as computed for regions resource * refactor: rename to `database_id` * refactor: change `vpc_cidrs` to `vpc_cidr` single string attribute * docs: update peering `vpc_cidr` example * Update rediscloud_active_active_subscription_database.md * Update rediscloud_active_active_subscription_database.md * Update rediscloud_active_active_regions.md (#336) * Update rediscloud_active_active_regions.md * Update rediscloud_active_active_regions.md * Update rediscloud_active_active_regions.md * Update rediscloud_active_active_regions.md * Update rediscloud_active_active_regions.md --------- Co-authored-by: Ben Gesoff <[email protected]> * Update docs/resources/rediscloud_active_active_subscription_database.md Co-authored-by: Ben Gesoff <[email protected]> * Update rediscloud_active_active_subscription_peering.md (#337) * Update rediscloud_subscription.md (#314) Clarification for the users about this field. * Update rediscloud_subscription.md (#311) * Update rediscloud_subscription.md As we are not supporting it for our hosted AWS solution, it may and confuse customers. * Update rediscloud_subscription.md (#326) Updates the AZ selection field description * Update rediscloud_subscription.md (#322) documentation adjustment * Update rediscloud_subscription_database.md (#323) Documentation adjustments * Update rediscloud_subscription_database.md (#340) * Update rediscloud_subscription_peering.md (#338) * Update rediscloud_subscription.md (#339) * Fixing ordering issue of delete and create + a new acceptance to test * uncomment failing tests * remove new line to re-run workflow * add new line to re-run workflow * Update rediscloud_active_active_subscription.md (#348) * Update rediscloud_active_active_subscription_database.md (#345) * Update rediscloud_active_active_regions.md (#343) * Update rediscloud_active_active_regions.md (#350) * Update rediscloud_active_active_subscription.md (#351) * add the latest redis-go-api tag v0.2.0 to go.mod --------- Co-authored-by: gregnuttall <[email protected]> Co-authored-by: Peter Vegh <[email protected]> Co-authored-by: Greg Nuttall <[email protected]> Co-authored-by: pvegh-oc <[email protected]> Co-authored-by: danielarbiv <[email protected]> Co-authored-by: noham14 <[email protected]> Co-authored-by: byron-oc <[email protected]>
1 parent df3e593 commit e922f4c

24 files changed

+4262
-108
lines changed

.github/workflows/terraform_provider.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ jobs:
159159
REDISCLOUD_ACCESS_KEY: ${{ secrets.REDISCLOUD_ACCESS_KEY_QA }}
160160
REDISCLOUD_SECRET_KEY: ${{ secrets.REDISCLOUD_SECRET_KEY_QA }}
161161
REDISCLOUD_URL: https://api-cloudapi.qa.redislabs.com/v1
162-
AWS_TEST_CLOUD_ACCOUNT_NAME: oc
162+
AWS_TEST_CLOUD_ACCOUNT_NAME: EXTERNAL-CA-2023
163163
# REDISCLOUD_ACCESS_KEY: ${{ secrets.REDISCLOUD_ACCESS_KEY_PROD }}
164164
# REDISCLOUD_SECRET_KEY: ${{ secrets.REDISCLOUD_SECRET_KEY_PROD }}
165165
# REDISCLOUD_URL: https://api.redislabs.com/v1/

GNUmakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ $(BIN)/%:
2222

2323
build:
2424
@echo "Building local provider binary"
25-
@mkdir -p ./$(BIN)
26-
go build -o ./$(BIN)/terraform-provider-rediscloud_v$(PROVIDER_VERSION)
25+
@mkdir -p $(BIN)
26+
go build -o $(BIN)/terraform-provider-rediscloud_v$(PROVIDER_VERSION)
2727
@sh -c "'$(CURDIR)/scripts/generate-dev-overrides.sh'"
2828

2929
clean:
3030
@echo "Deleting local provider binary"
3131
rm -rf $(BIN)
3232

3333
testacc:
34-
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m -parallel=$(TEST_PARALLELISM)
34+
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 360m -parallel=$(TEST_PARALLELISM)
3535

3636
install_local: build
3737
@echo "Installing local provider binary to plugins mirror path $(PLUGINS_PATH)/$(PLUGINS_PROVIDER_PATH)"
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
layout: "rediscloud"
3+
page_title: "Redis Cloud: rediscloud_active_active_regions"
4+
description: |-
5+
Regions resource in the Terraform provider Redis Cloud.
6+
---
7+
8+
# Resource: rediscloud_active_active_regions
9+
10+
Creates an Active Active Regions within your Redis Enterprise Cloud subscription.
11+
This resource is responsible for creating and managing regions within that subscription. This allows Redis Enterprise Cloud to efficiently provision your cluster within each defined region in a separate block.
12+
13+
## Example Usage
14+
15+
```hcl
16+
resource "rediscloud_active_active_subscription_regions" "regions-resource" {
17+
subscription_id = rediscloud_active_active_subscription.subscription-resource.id
18+
delete_regions = false
19+
region {
20+
region = "us-east-1"
21+
networking_deployment_cidr = "192.168.0.0/24"
22+
database {
23+
database_id = rediscloud_active_active_subscription_database.database-resource.db_id
24+
database_name = rediscloud_active_active_subscription_database.database-resource.name
25+
local_write_operations_per_second = 1000
26+
local_read_operations_per_second = 1000
27+
}
28+
}
29+
region {
30+
region = "us-east-2"
31+
networking_deployment_cidr = "10.0.1.0/24"
32+
database {
33+
database_id = rediscloud_active_active_subscription_database.database-resource.db_id
34+
database_name = rediscloud_active_active_subscription_database.database-resource.name
35+
local_write_operations_per_second = 2000
36+
local_read_operations_per_second = 4000
37+
}
38+
}
39+
}
40+
```
41+
42+
## Argument Reference
43+
44+
The following arguments are supported:
45+
46+
* `subscription_id` - (Required) ID of the subscription that the regions belong to
47+
* `delete_regions` - (Optional) Flag required to be set when one or more regions is to be deleted, if the flag is not set an error will be thrown
48+
* `region` - (Required) Cloud networking details, per region, documented below
49+
50+
The `region` block supports:
51+
52+
* `region_id` - (Computed) The ID of the region, as created by the API
53+
* `region` - (Required) Region name
54+
* `vpc_id` - (Computed) Identifier of the VPC to be peered, set by the API
55+
* `networking_deployment_cidr` - (Required) Deployment CIDR mask. The total number of bits must be 24 (x.x.x.x/24)
56+
* `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'
57+
* `database` - (Required) A block defining the write and read operations in the region, per database, documented below
58+
59+
The `database` block supports:
60+
61+
* `database_id` - (Required) Database ID belonging to the subscription
62+
* `database_name` - (Required) Database name belonging to the subscription
63+
* `local_write_operations_per_second` - (Required) Local write operations per second for this active-active region
64+
* `local_read_operations_per_second` - (Required) Local read operations per second for this active-active region
65+
66+
67+
### Timeouts
68+
69+
The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:
70+
71+
* `create` - (Defaults to 60 mins) Used when creating the regions
72+
* `update` - (Defaults to 60 mins) Used when updating the regions
73+
* `delete` - (Defaults to 10 mins) Used when destroying the regions
74+
75+
## Import
76+
77+
`rediscloud_active_active_regions` can be imported using the ID of the subscription, e.g.
78+
79+
```
80+
$ terraform import rediscloud_active_active_regions.regions-resource 12345678
81+
```
82+
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
layout: "rediscloud"
3+
page_title: "Redis Cloud: rediscloud_active_active_subscription"
4+
description: |-
5+
Subscription resource in the Terraform provider Redis Cloud.
6+
---
7+
8+
# Resource: rediscloud_active_active_subscription
9+
10+
Creates an Active-Active Subscription within your Redis Enterprise Cloud Account.
11+
This resource is responsible for creating and managing subscriptions.
12+
13+
~> **Note:** The creation_plan block allows the API server to create a well-optimised infrastructure for your databases in the cluster.
14+
The attributes inside the block are used by the provider to create initial
15+
databases. Those databases will be deleted after provisioning a new
16+
subscription, then the databases defined as separate resources will be attached to
17+
the subscription. The creation_plan block can ONLY be used for provisioning new
18+
subscriptions, the block will be ignored if you make any further changes or try importing the resource (e.g. `terraform import` ...).
19+
20+
## Example Usage
21+
22+
```hcl
23+
data "rediscloud_payment_method" "card" {
24+
card_type = "Visa"
25+
}
26+
27+
resource "rediscloud_active_active_subscription" "subscription-resource" {
28+
name = "subscription-name"
29+
payment_method_id = data.rediscloud_payment_method.card.id
30+
cloud_provider = "AWS"
31+
32+
creation_plan {
33+
memory_limit_in_gb = 1
34+
quantity = 1
35+
region {
36+
region = "us-east-1"
37+
networking_deployment_cidr = "192.168.0.0/24"
38+
write_operations_per_second = 1000
39+
read_operations_per_second = 1000
40+
}
41+
region {
42+
region = "us-east-2"
43+
networking_deployment_cidr = "10.0.1.0/24"
44+
write_operations_per_second = 1000
45+
read_operations_per_second = 1000
46+
}
47+
}
48+
}
49+
```
50+
51+
## Argument Reference
52+
53+
The following arguments are supported:
54+
55+
* `name` - (Required) A meaningful name to identify the subscription
56+
* `payment_method` (Optional) The payment method for the requested subscription, (either `credit-card` or `marketplace`). If `credit-card` is specified, `payment_method_id` must be defined. Default: 'credit-card'
57+
* `payment_method_id` - (Optional) A valid payment method pre-defined in the current account. This value is __Optional__ for AWS/GCP Marketplace accounts, but __Required__ for all other account types
58+
* `cloud_provider` - (Optional) The cloud provider to use with the subscription, (either `AWS` or `GCP`). Default: ‘AWS’
59+
* `creation_plan` - (Required) A creation plan object, documented below
60+
61+
The `creation_plan` block supports:
62+
63+
* `memory_limit_in_gb` - (Required) Maximum memory usage that will be used for your largest planned database, including replication and other overhead
64+
* `quantity` - (Required) The planned number of databases in the subscription.
65+
66+
The creation_plan `region` block supports:
67+
68+
* `region` - (Required) Deployment region as defined by cloud provider
69+
* `networking_deployment_cidr` - (Required) Deployment CIDR mask. The total number of bits must be 24 (x.x.x.x/24)
70+
* `write_operations_per_second` - (Required) Throughput measurement for an active-active subscription
71+
* `read_operations_per_second` - (Required) Throughput measurement for an active-active subscription
72+
73+
~> **Note:** If changes are made to attributes in the subscription which require the subscription to be recreated (such as `cloud_provider` or `payment_method`), the creation_plan will need to be defined in order to change these attributes. This is because the creation_plan is always required when a subscription is created.
74+
75+
76+
### Timeouts
77+
78+
The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:
79+
80+
* `create` - (Defaults to 30 mins) Used when creating the subscription
81+
* `update` - (Defaults to 30 mins) Used when updating the subscription
82+
* `delete` - (Defaults to 10 mins) Used when destroying the subscription
83+
84+
## Import
85+
86+
`rediscloud_active_active_subscription` can be imported using the ID of the subscription, e.g.
87+
88+
```
89+
$ terraform import rediscloud_active_active_subscription.subscription-resource 12345678
90+
```
91+
92+
~> **Note:** the creation_plan block will be ignored during imports.
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
layout: "rediscloud"
3+
page_title: "Redis Cloud: rediscloud_active_active_subscription_database"
4+
description: |-
5+
Database resource for Active-Active Subscriptions in the Terraform provider Redis Cloud.
6+
---
7+
8+
# Resource: rediscloud_active_active_subscription_database
9+
10+
Creates a Database within a specified Active-Active Subscription in your Redis Enterprise Cloud Account.
11+
12+
## Example Usage
13+
14+
```hcl
15+
data "rediscloud_payment_method" "card" {
16+
card_type = "Visa"
17+
}
18+
19+
resource "rediscloud_active_active_subscription" "subscription-resource" {
20+
name = "subscription-name"
21+
payment_method_id = data.rediscloud_payment_method.card.id
22+
cloud_provider = "AWS"
23+
24+
creation_plan {
25+
memory_limit_in_gb = 1
26+
quantity = 1
27+
region {
28+
region = "us-east-1"
29+
networking_deployment_cidr = "192.168.0.0/24"
30+
write_operations_per_second = 1000
31+
read_operations_per_second = 1000
32+
}
33+
region {
34+
region = "us-east-2"
35+
networking_deployment_cidr = "10.0.1.0/24"
36+
write_operations_per_second = 1000
37+
read_operations_per_second = 2000
38+
}
39+
}
40+
}
41+
42+
resource "rediscloud_active_active_subscription_database" "database-resource" {
43+
subscription_id = rediscloud_active_active_subscription.subscription-resource.id
44+
name = "database-name"
45+
memory_limit_in_gb = 1
46+
global_data_persistence = "aof-every-1-second"
47+
global_password = "some-random-pass-2"
48+
global_source_ips = ["192.168.0.0/16"]
49+
global_alert {
50+
name = "dataset-size"
51+
value = 40
52+
}
53+
54+
override_region {
55+
name = "us-east-2"
56+
override_global_source_ips = ["192.10.0.0/16"]
57+
}
58+
59+
override_region {
60+
name = "us-east-1"
61+
override_global_data_persistence = "none"
62+
override_global_password = "region-specific-password"
63+
override_global_alert {
64+
name = "dataset-size"
65+
value = 60
66+
}
67+
}
68+
}
69+
70+
output "us-east-1-public-endpoints" {
71+
value = rediscloud_active_active_subscription_database.database-resource.public_endpoint.us-east-1
72+
}
73+
74+
output "us-east-2-private-endpoints" {
75+
value = rediscloud_active_active_subscription_database.database-resource.private_endpoint.us-east-1
76+
}
77+
```
78+
79+
## Argument Reference
80+
81+
The following arguments are supported:
82+
* `subscription_id`: (Required) The ID of the Active-Active subscription to create the database in
83+
* `name` - (Required) A meaningful name to identify the database
84+
* `memory_limit_in_gb` - (Required) Maximum memory usage for this specific database, including replication and other overhead
85+
* `support_oss_cluster_api` - (Optional) Support Redis open-source (OSS) Cluster API. Default: ‘false’
86+
* `external_endpoint_for_oss_cluster_api` - (Optional) Should use the external endpoint for open-source (OSS) Cluster API.
87+
Can only be enabled if OSS Cluster API support is enabled. Default: 'false'
88+
* `enable_tls` - (Optional) Use TLS for authentication. Default: ‘false’
89+
* `client_ssl_certificate` - (Optional) SSL certificate to authenticate user connections.
90+
* `data_eviction` - (Optional) The data items eviction policy (either: 'allkeys-lru', 'allkeys-lfu', 'allkeys-random', 'volatile-lru', 'volatile-lfu', 'volatile-random', 'volatile-ttl' or 'noeviction'. Default: 'volatile-lru')
91+
* `global_data_persistence` - (Optional) Global rate of database data persistence (in persistent storage) of regions that dont override global settings. Default: 'none'
92+
* `global_password` - (Optional) Password to access the database of regions that dont override global settings. If left empty, the password will be generated automatically
93+
* `global_alert` - (Optional) A block defining Redis database alert of regions that dont override global settings, documented below, can be specified multiple times
94+
* `global_source_ips` - (Optional) List of source IP addresses or subnet masks of regions that dont override global settings. If specified, Redis clients will be able to connect to this database only from within the specified source IP addresses ranges (example: ['192.168.10.0/32', '192.168.12.0/24'])
95+
* `override_region` - (Optional) Override region specific configuration, documented below
96+
97+
98+
The `override_region` block supports:
99+
100+
* `name` - (Required) Region name.
101+
* `override_global_alert` - (Optional) A block defining Redis regional instance of an Active-Active database alert, documented below, can be specified multiple times
102+
* `override_global_password` - (Optional) If specified, this regional instance of an Active-Active database password will be used to access the database
103+
* `override_global_source_ips` - (Optional) List of regional instance of an Active-Active database source IP addresses or subnet masks. If specified, Redis clients will be able to connect to this database only from within the specified source IP addresses ranges (example: ['192.168.10.0/32', '192.168.12.0/24'] )
104+
* `override_global_data_persistence` - (Optional) Regional instance of an Active-Active database data persistence rate (in persistent storage)
105+
106+
The `override_global_alert` block supports:
107+
108+
* `name` - (Required) Alert name
109+
* `value` - (Required) Alert value
110+
111+
### Timeouts
112+
113+
The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions:
114+
115+
* `create` - (Defaults to 30 mins) Used when creating the database
116+
* `update` - (Defaults to 30 mins) Used when updating the database
117+
* `delete` - (Defaults to 10 mins) Used when destroying the database
118+
119+
## Attribute reference
120+
121+
* `db_id` - Identifier of the database created
122+
* `public_endpoint` - A map of which public endpoints can to access the database per region, uses region name as key.
123+
* `private_endpoint` - A map of which private endpoints can to access the database per region, uses region name as key.
124+
125+
## Import
126+
`rediscloud_active_active_subscription_database` can be imported using the ID of the Active-Active subscription and the ID of the database in the format {subscription ID}/{database ID}, e.g.
127+
128+
```
129+
$ terraform import rediscloud_active_active_subscription_database.database-resource 123456/12345678
130+
```
131+
132+
Note: Due to constraints in the Redis Cloud API, the import process will not import global attributes or override region attributes. If you wish to use these attributes in your Terraform configuraton, you will need to manually add them to your Terraform configuration and run `terraform apply` to update the database.
133+

0 commit comments

Comments
 (0)