Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
d75ec3d
(WIP) Initial AA subscription implementation
greg-oc Nov 30, 2022
7627db9
adds aa subscription documentation
greg-oc Dec 1, 2022
a7a8c88
adds acceptance tests
greg-oc Dec 1, 2022
af4e26e
addresses TODOs
greg-oc Dec 1, 2022
15a963b
Updating go client api version
pvegh-oc Dec 5, 2022
690d12d
Removing replace from go.mod
pvegh-oc Dec 5, 2022
c03e5d7
Fixing AA Subscription Acceptance test
pvegh-oc Dec 5, 2022
3f36878
Removing unneccesary test for average_item_size_in_bytes
pvegh-oc Dec 5, 2022
848cfa6
Temporary cloud_account_id fix while oc account is broken
pvegh-oc Dec 5, 2022
3f1d4c7
Active active read initial create
pvegh-oc Dec 8, 2022
c42b4bc
Merge branch 'develop' into aa_region
pvegh-oc Dec 8, 2022
2fecf7e
Active active Region create acceptance test
pvegh-oc Dec 8, 2022
b16045d
Active Active Region update, delete and in dev acceptance test
pvegh-oc Dec 16, 2022
4a413eb
Refactoring + fixing state update issue on recreate_region flag change
pvegh-oc Dec 16, 2022
1c2c05e
AA Database implementation
greg-oc Dec 20, 2022
8e6bd00
Review changes + documentation for Regions resource
pvegh-oc Dec 20, 2022
e7b8395
fix issue with undefined override_region block
greg-oc Dec 21, 2022
1209318
Acceptance test for regions
pvegh-oc Dec 21, 2022
0dcf716
Merge branch 'develop' into aa_region
pvegh-oc Dec 21, 2022
f041368
Enabling scenario back
pvegh-oc Dec 21, 2022
92af528
Fixing Linting issue
pvegh-oc Dec 21, 2022
f3c2459
Updating AWS_CLOUD_ACCOUNT in gihub actions
pvegh-oc Dec 21, 2022
b156a64
Fixing ordering issue of delete and create + a new acceptance to test
pvegh-oc Dec 21, 2022
8fc18dd
Fixing aa regions acceptance test
pvegh-oc Dec 22, 2022
26a2440
Update terraform_provider.yml
greg-oc Jan 3, 2023
afdfbd9
Fixing AA subscription test checks + increasing git workflow test tim…
pvegh-oc Jan 3, 2023
cfcf71a
Revert "Temporary cloud_account_id fix while oc account is broken"
greg-oc Jan 3, 2023
0ebab60
Adding wait for db delete
pvegh-oc Jan 3, 2023
7a3b6db
Merge branch 'develop' into aa_region
pvegh-oc Jan 4, 2023
84a6726
Merge pull request #298 from RedisLabs/aa_region
pvegh-oc Jan 4, 2023
dab45de
Active-Active Database (#300)
greg-oc Jan 5, 2023
5d1e7fc
test: add `CheckDestroy` function for active-active resources (#307)
bengesoff Jan 5, 2023
2ed2756
feat: active-active subscription network peering (#313)
bengesoff Jan 11, 2023
1c0afab
chore: update rediscloud-go-api and add AA test sweepers (#315)
bengesoff Jan 12, 2023
e6ea508
fix: AA regions bug and some assorted documentation things (#317)
bengesoff Jan 13, 2023
0dd92cc
fix: importing active-active regions failing due to incorrect ID (#319)
bengesoff Jan 19, 2023
8795a0c
Update rediscloud_active_active_subscription.md
danielarbiv Jan 26, 2023
7f12c50
Update rediscloud_active_active_subscription_database.md
danielarbiv Jan 26, 2023
d547f1f
fix: regions inactive subscription error and memory limit hardcoding …
bengesoff Feb 2, 2023
7f51880
chore: remove go.mod `replace` for go-api and upgrade (#329)
bengesoff Feb 2, 2023
e82a2a3
Merge pull request #321 from RedisLabs/danielarbiv-patch-1
danielarbiv Feb 14, 2023
3b3ab1f
Merge pull request #324 from RedisLabs/danielarbiv-patch-2
danielarbiv Feb 14, 2023
60122a3
refactor: remove support_oss_cluster_api from subscription creation p…
bengesoff Feb 14, 2023
5772d2c
docs: remove `region_id` from active-active regions
bengesoff Feb 16, 2023
246c427
docs: set `region_id` and `vpc_id` as computed for regions resource
bengesoff Feb 16, 2023
a83b055
refactor: rename to `database_id`
bengesoff Feb 16, 2023
64ebd37
refactor: change `vpc_cidrs` to `vpc_cidr` single string attribute
bengesoff Feb 16, 2023
d8cc9e8
docs: update peering `vpc_cidr` example
bengesoff Feb 16, 2023
9ca92a2
Update rediscloud_active_active_subscription_database.md
noham14 Feb 16, 2023
78123c6
Update rediscloud_active_active_subscription_database.md
noham14 Feb 16, 2023
6f972da
Update rediscloud_active_active_regions.md (#336)
noham14 Feb 17, 2023
d1cf352
Update docs/resources/rediscloud_active_active_subscription_database.md
noham14 Feb 19, 2023
0f49281
Merge pull request #341 from noham14/patch-13
danielarbiv Feb 19, 2023
faa0814
Update rediscloud_active_active_subscription_peering.md (#337)
noham14 Feb 19, 2023
86f1de0
Update rediscloud_subscription.md (#314)
noham14 Jan 16, 2023
6987dbc
Update rediscloud_subscription.md (#311)
noham14 Jan 16, 2023
ef6f72e
Update rediscloud_subscription.md (#326)
noham14 Feb 1, 2023
607d770
Update rediscloud_subscription.md (#322)
noham14 Feb 1, 2023
f9ee09c
Update rediscloud_subscription_database.md (#323)
noham14 Feb 1, 2023
4cbc3ff
Update rediscloud_subscription_database.md (#340)
noham14 Feb 19, 2023
a74444b
Update rediscloud_subscription_peering.md (#338)
noham14 Feb 19, 2023
bd22181
Update rediscloud_subscription.md (#339)
noham14 Feb 19, 2023
964fe4e
Fixing ordering issue of delete and create + a new acceptance to test
pvegh-oc Dec 21, 2022
20c2076
uncomment failing tests
byron-oc Feb 20, 2023
61e513c
remove new line to re-run workflow
byron-oc Feb 21, 2023
a1df491
add new line to re-run workflow
byron-oc Feb 21, 2023
00e91a2
Update rediscloud_active_active_subscription.md (#348)
noham14 Feb 27, 2023
80d07d2
Update rediscloud_active_active_subscription_database.md (#345)
noham14 Feb 27, 2023
212c342
Update rediscloud_active_active_regions.md (#343)
noham14 Feb 27, 2023
a99ddd0
update subscription docs
byron-oc Feb 27, 2023
f537bfd
Update rediscloud_active_active_regions.md (#350)
noham14 Mar 1, 2023
cbd29d3
Update rediscloud_active_active_subscription.md (#351)
noham14 Mar 1, 2023
dccd3bd
add the latest redis-go-api tag v0.2.0 to go.mod
byron-oc Mar 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/terraform_provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ jobs:
REDISCLOUD_ACCESS_KEY: ${{ secrets.REDISCLOUD_ACCESS_KEY_QA }}
REDISCLOUD_SECRET_KEY: ${{ secrets.REDISCLOUD_SECRET_KEY_QA }}
REDISCLOUD_URL: https://api-cloudapi.qa.redislabs.com/v1
AWS_TEST_CLOUD_ACCOUNT_NAME: oc
AWS_TEST_CLOUD_ACCOUNT_NAME: EXTERNAL-CA-2023
# REDISCLOUD_ACCESS_KEY: ${{ secrets.REDISCLOUD_ACCESS_KEY_PROD }}
# REDISCLOUD_SECRET_KEY: ${{ secrets.REDISCLOUD_SECRET_KEY_PROD }}
# REDISCLOUD_URL: https://api.redislabs.com/v1/
Expand Down
6 changes: 3 additions & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ $(BIN)/%:

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

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

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

install_local: build
@echo "Installing local provider binary to plugins mirror path $(PLUGINS_PATH)/$(PLUGINS_PROVIDER_PATH)"
Expand Down
82 changes: 82 additions & 0 deletions docs/resources/rediscloud_active_active_regions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
layout: "rediscloud"
page_title: "Redis Cloud: rediscloud_active_active_regions"
description: |-
Regions resource in the Terraform provider Redis Cloud.
---

# Resource: rediscloud_active_active_regions

Creates an Active Active Regions within your Redis Enterprise Cloud subscription.
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.

## Example Usage

```hcl
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 = "192.168.0.0/24"
database {
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
}
}
region {
region = "us-east-2"
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
local_write_operations_per_second = 2000
local_read_operations_per_second = 4000
}
}
}
```

## Argument Reference

The following arguments are supported:

* `subscription_id` - (Required) ID of the subscription that the regions belong to
* `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
* `region` - (Required) Cloud networking details, per region, documented below

The `region` block supports:

* `region_id` - (Computed) The ID of the region, as created by the API
* `region` - (Required) Region name
* `vpc_id` - (Computed) Identifier of the VPC to be peered, set by the API
* `networking_deployment_cidr` - (Required) Deployment CIDR mask. The total number of bits must be 24 (x.x.x.x/24)
* `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:

* `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


### 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 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.regions-resource 12345678
```

92 changes: 92 additions & 0 deletions docs/resources/rediscloud_active_active_subscription.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
layout: "rediscloud"
page_title: "Redis Cloud: rediscloud_active_active_subscription"
description: |-
Subscription resource in the Terraform provider Redis Cloud.
---

# Resource: rediscloud_active_active_subscription

Creates an Active-Active Subscription within your Redis Enterprise Cloud Account.
This resource is responsible for creating and managing subscriptions.

~> **Note:** The creation_plan block allows the API server to create a well-optimised infrastructure for your databases in the cluster.
The attributes inside the block are used by the provider to create initial
databases. Those databases will be deleted after provisioning a new
subscription, then the databases defined as separate resources will be attached to
the subscription. The creation_plan block can ONLY be used for provisioning new
subscriptions, the block will be ignored if you make any further changes or try importing the resource (e.g. `terraform import` ...).

## Example Usage

```hcl
data "rediscloud_payment_method" "card" {
card_type = "Visa"
}

resource "rediscloud_active_active_subscription" "subscription-resource" {
name = "subscription-name"
payment_method_id = data.rediscloud_payment_method.card.id
cloud_provider = "AWS"

creation_plan {
memory_limit_in_gb = 1
quantity = 1
region {
region = "us-east-1"
networking_deployment_cidr = "192.168.0.0/24"
write_operations_per_second = 1000
read_operations_per_second = 1000
}
region {
region = "us-east-2"
networking_deployment_cidr = "10.0.1.0/24"
write_operations_per_second = 1000
read_operations_per_second = 1000
}
}
}
```

## Argument Reference

The following arguments are supported:

* `name` - (Required) A meaningful name to identify the subscription
* `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'
* `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
* `cloud_provider` - (Optional) The cloud provider to use with the subscription, (either `AWS` or `GCP`). Default: ‘AWS’
* `creation_plan` - (Required) A creation plan object, documented below

The `creation_plan` block supports:

* `memory_limit_in_gb` - (Required) Maximum memory usage that will be used for your largest planned database, including replication and other overhead
* `quantity` - (Required) The planned number of databases in the subscription.

The creation_plan `region` block supports:

* `region` - (Required) Deployment region as defined by cloud provider
* `networking_deployment_cidr` - (Required) Deployment CIDR mask. The total number of bits must be 24 (x.x.x.x/24)
* `write_operations_per_second` - (Required) Throughput measurement for an active-active subscription
* `read_operations_per_second` - (Required) Throughput measurement for an active-active subscription

~> **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.


### Timeouts

The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:

* `create` - (Defaults to 30 mins) Used when creating the subscription
* `update` - (Defaults to 30 mins) Used when updating the subscription
* `delete` - (Defaults to 10 mins) Used when destroying the subscription

## Import

`rediscloud_active_active_subscription` can be imported using the ID of the subscription, e.g.

```
$ terraform import rediscloud_active_active_subscription.subscription-resource 12345678
```

~> **Note:** the creation_plan block will be ignored during imports.
133 changes: 133 additions & 0 deletions docs/resources/rediscloud_active_active_subscription_database.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
---
layout: "rediscloud"
page_title: "Redis Cloud: rediscloud_active_active_subscription_database"
description: |-
Database resource for Active-Active Subscriptions in the Terraform provider Redis Cloud.
---

# Resource: rediscloud_active_active_subscription_database

Creates a Database within a specified Active-Active Subscription in your Redis Enterprise Cloud Account.

## Example Usage

```hcl
data "rediscloud_payment_method" "card" {
card_type = "Visa"
}

resource "rediscloud_active_active_subscription" "subscription-resource" {
name = "subscription-name"
payment_method_id = data.rediscloud_payment_method.card.id
cloud_provider = "AWS"

creation_plan {
memory_limit_in_gb = 1
quantity = 1
region {
region = "us-east-1"
networking_deployment_cidr = "192.168.0.0/24"
write_operations_per_second = 1000
read_operations_per_second = 1000
}
region {
region = "us-east-2"
networking_deployment_cidr = "10.0.1.0/24"
write_operations_per_second = 1000
read_operations_per_second = 2000
}
}
}

resource "rediscloud_active_active_subscription_database" "database-resource" {
subscription_id = rediscloud_active_active_subscription.subscription-resource.id
name = "database-name"
memory_limit_in_gb = 1
global_data_persistence = "aof-every-1-second"
global_password = "some-random-pass-2"
global_source_ips = ["192.168.0.0/16"]
global_alert {
name = "dataset-size"
value = 40
}

override_region {
name = "us-east-2"
override_global_source_ips = ["192.10.0.0/16"]
}

override_region {
name = "us-east-1"
override_global_data_persistence = "none"
override_global_password = "region-specific-password"
override_global_alert {
name = "dataset-size"
value = 60
}
}
}

output "us-east-1-public-endpoints" {
value = rediscloud_active_active_subscription_database.database-resource.public_endpoint.us-east-1
}

output "us-east-2-private-endpoints" {
value = rediscloud_active_active_subscription_database.database-resource.private_endpoint.us-east-1
}
```

## Argument Reference

The following arguments are supported:
* `subscription_id`: (Required) The ID of the Active-Active subscription to create the database in
* `name` - (Required) A meaningful name to identify the database
* `memory_limit_in_gb` - (Required) Maximum memory usage for this specific database, including replication and other overhead
* `support_oss_cluster_api` - (Optional) Support Redis open-source (OSS) Cluster API. Default: ‘false’
* `external_endpoint_for_oss_cluster_api` - (Optional) Should use the external endpoint for open-source (OSS) Cluster API.
Can only be enabled if OSS Cluster API support is enabled. Default: 'false'
* `enable_tls` - (Optional) Use TLS for authentication. Default: ‘false’
* `client_ssl_certificate` - (Optional) SSL certificate to authenticate user connections.
* `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')
* `global_data_persistence` - (Optional) Global rate of database data persistence (in persistent storage) of regions that dont override global settings. Default: 'none'
* `global_password` - (Optional) Password to access the database of regions that dont override global settings. If left empty, the password will be generated automatically
* `global_alert` - (Optional) A block defining Redis database alert of regions that dont override global settings, documented below, can be specified multiple times
* `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'])
* `override_region` - (Optional) Override region specific configuration, documented below


The `override_region` block supports:

* `name` - (Required) Region name.
* `override_global_alert` - (Optional) A block defining Redis regional instance of an Active-Active database alert, documented below, can be specified multiple times
* `override_global_password` - (Optional) If specified, this regional instance of an Active-Active database password will be used to access the database
* `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'] )
* `override_global_data_persistence` - (Optional) Regional instance of an Active-Active database data persistence rate (in persistent storage)

The `override_global_alert` block supports:

* `name` - (Required) Alert name
* `value` - (Required) Alert value

### Timeouts

The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions:

* `create` - (Defaults to 30 mins) Used when creating the database
* `update` - (Defaults to 30 mins) Used when updating the database
* `delete` - (Defaults to 10 mins) Used when destroying the database

## Attribute reference

* `db_id` - Identifier of the database created
* `public_endpoint` - A map of which public endpoints can to access the database per region, uses region name as key.
* `private_endpoint` - A map of which private endpoints can to access the database per region, uses region name as key.

## Import
`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.

```
$ terraform import rediscloud_active_active_subscription_database.database-resource 123456/12345678
```

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.

Loading