Skip to content

Commit 9e32874

Browse files
authored
Merge pull request #585 from RedisLabs/add-module-docs
Add documentation on usage of Redis Private Service module
2 parents 832e8da + 2102941 commit 9e32874

File tree

3 files changed

+150
-0
lines changed

3 files changed

+150
-0
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
All notable changes to this project will be documented in this file.
44
See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)
55

6+
# 2.1.1 (6th Feb 2025)
7+
8+
### Added
9+
10+
- Documentation related to using the [Redis Cloud Private Service Connect Module](https://github.com/RedisLabs/terraform-rediscloud-private-service-connect)
11+
to simplify the Terraform configuration.
12+
613
# 2.1.0 (6th Feb 2025)
714

815
### Added

docs/resources/rediscloud_active_active_private_service_connect_endpoint.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,98 @@ resource "rediscloud_active_active_private_service_connect_endpoint_accepter" "a
172172
173173
```
174174

175+
## Example Usage with Redis Private Service Connect Module
176+
177+
The example below creates a Private Service Connect Endpoint in an Active-Active subscription using the [Redis Cloud PSC Terraform module](https://registry.terraform.io/modules/RedisLabs/private-service-connect/rediscloud/latest).
178+
We recommend using the module as it simplifies the Terraform configuration.
179+
180+
```hcl
181+
data "rediscloud_payment_method" "card" {
182+
card_type = "Visa"
183+
}
184+
185+
resource "rediscloud_active_active_subscription" "subscription" {
186+
name = "subscription-name"
187+
payment_method_id = data.rediscloud_payment_method.card.id
188+
cloud_provider = "GCP"
189+
190+
creation_plan {
191+
memory_limit_in_gb = 1
192+
quantity = 1
193+
region {
194+
region = "us-central1"
195+
networking_deployment_cidr = "192.168.0.0/24"
196+
write_operations_per_second = 1000
197+
read_operations_per_second = 1000
198+
}
199+
region {
200+
region = "europe-west1"
201+
networking_deployment_cidr = "10.0.1.0/24"
202+
write_operations_per_second = 1000
203+
read_operations_per_second = 1000
204+
}
205+
}
206+
}
207+
208+
resource "rediscloud_active_active_subscription_database" "database" {
209+
subscription_id = rediscloud_active_active_subscription.subscription.id
210+
name = "db"
211+
memory_limit_in_gb = 1
212+
global_data_persistence = "aof-every-1-second"
213+
global_password = "some-password"
214+
}
215+
216+
resource "rediscloud_active_active_subscription_regions" "regions" {
217+
subscription_id = rediscloud_active_active_subscription.subscription.id
218+
219+
region {
220+
region = "us-central1"
221+
networking_deployment_cidr = "192.168.0.0/24"
222+
database {
223+
database_id = rediscloud_active_active_subscription_database.database.db_id
224+
database_name = rediscloud_active_active_subscription_database.database.name
225+
local_write_operations_per_second = 1000
226+
local_read_operations_per_second = 1000
227+
}
228+
}
229+
230+
region {
231+
region = "europe-west1"
232+
networking_deployment_cidr = "10.0.1.0/24"
233+
database {
234+
database_id = rediscloud_active_active_subscription_database.database.db_id
235+
database_name = rediscloud_active_active_subscription_database.database.name
236+
local_write_operations_per_second = 1000
237+
local_read_operations_per_second = 1000
238+
}
239+
}
240+
}
241+
242+
locals {
243+
region_id = one([for r in rediscloud_active_active_subscription_regions.regions.region : r.region_id if r.region == var.gcp_region])
244+
}
245+
246+
module "private_service_connect" {
247+
source = "RedisLabs/private-service-connect/rediscloud"
248+
249+
rediscloud_subscription_type = "active-active"
250+
rediscloud_subscription_id = rediscloud_active_active_subscription.subscription.id
251+
rediscloud_region_id = local.region_id
252+
253+
gcp_region = var.gcp_region
254+
255+
endpoints = [
256+
{
257+
gcp_project_id = var.gcp_project_id
258+
gcp_vpc_name = var.gcp_vpc_name
259+
gcp_vpc_subnetwork_name = var.gcp_subnet_name
260+
gcp_response_policy_name = var.gcp_response_policy_name
261+
}
262+
]
263+
}
264+
265+
```
266+
175267
## Argument Reference
176268

177269
* `subscription_id` - (Required) The ID of the Pro subscription to attach **Modifying this attribute will force creation of a new resource.**

docs/resources/rediscloud_private_service_connect_endpoint.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,57 @@ resource "rediscloud_private_service_connect_endpoint_accepter" "accepter" {
132132
133133
```
134134

135+
## Example Usage with Redis Private Service Connect Module
136+
137+
The example below creates a Private Service Connect Endpoint in a Pro subscription using the [Redis Cloud PSC Terraform module](https://registry.terraform.io/modules/RedisLabs/private-service-connect/rediscloud/latest).
138+
We recommend using the module as it simplifies the Terraform configuration.
139+
140+
```hcl
141+
data "rediscloud_payment_method" "card" {
142+
card_type = "Visa"
143+
}
144+
145+
resource "rediscloud_subscription" "subscription" {
146+
name = "subscription-name"
147+
payment_method_id = data.rediscloud_payment_method.card.id
148+
149+
cloud_provider {
150+
provider = "GCP"
151+
region {
152+
region = var.gcp_region
153+
networking_deployment_cidr = "10.0.1.0/24"
154+
}
155+
}
156+
157+
creation_plan {
158+
dataset_size_in_gb = 15
159+
quantity = 1
160+
replication = true
161+
throughput_measurement_by = "operations-per-second"
162+
throughput_measurement_value = 20000
163+
}
164+
}
165+
166+
module "private_service_connect" {
167+
source = "RedisLabs/private-service-connect/rediscloud"
168+
169+
rediscloud_subscription_type = "pro"
170+
rediscloud_subscription_id = rediscloud_subscription.subscription.id
171+
172+
gcp_region = var.gcp_region
173+
174+
endpoints = [
175+
{
176+
gcp_project_id = var.gcp_project_id
177+
gcp_vpc_name = var.gcp_vpc_name
178+
gcp_vpc_subnetwork_name = var.gcp_subnet_name
179+
gcp_response_policy_name = var.gcp_response_policy_name
180+
}
181+
]
182+
}
183+
184+
```
185+
135186
## Argument Reference
136187

137188
* `subscription_id` - (Required) The ID of the Pro subscription to attach **Modifying this attribute will force creation of a new resource.**

0 commit comments

Comments
 (0)