Skip to content

Commit

Permalink
Merge pull request #585 from RedisLabs/add-module-docs
Browse files Browse the repository at this point in the history
Add documentation on usage of Redis Private Service module
  • Loading branch information
matpimenta authored Feb 6, 2025
2 parents 832e8da + 2102941 commit 9e32874
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)

# 2.1.1 (6th Feb 2025)

### Added

- Documentation related to using the [Redis Cloud Private Service Connect Module](https://github.com/RedisLabs/terraform-rediscloud-private-service-connect)
to simplify the Terraform configuration.

# 2.1.0 (6th Feb 2025)

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,98 @@ resource "rediscloud_active_active_private_service_connect_endpoint_accepter" "a
```

## Example Usage with Redis Private Service Connect Module

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).
We recommend using the module as it simplifies the Terraform configuration.

```hcl
data "rediscloud_payment_method" "card" {
card_type = "Visa"
}
resource "rediscloud_active_active_subscription" "subscription" {
name = "subscription-name"
payment_method_id = data.rediscloud_payment_method.card.id
cloud_provider = "GCP"
creation_plan {
memory_limit_in_gb = 1
quantity = 1
region {
region = "us-central1"
networking_deployment_cidr = "192.168.0.0/24"
write_operations_per_second = 1000
read_operations_per_second = 1000
}
region {
region = "europe-west1"
networking_deployment_cidr = "10.0.1.0/24"
write_operations_per_second = 1000
read_operations_per_second = 1000
}
}
}
resource "rediscloud_active_active_subscription_database" "database" {
subscription_id = rediscloud_active_active_subscription.subscription.id
name = "db"
memory_limit_in_gb = 1
global_data_persistence = "aof-every-1-second"
global_password = "some-password"
}
resource "rediscloud_active_active_subscription_regions" "regions" {
subscription_id = rediscloud_active_active_subscription.subscription.id
region {
region = "us-central1"
networking_deployment_cidr = "192.168.0.0/24"
database {
database_id = rediscloud_active_active_subscription_database.database.db_id
database_name = rediscloud_active_active_subscription_database.database.name
local_write_operations_per_second = 1000
local_read_operations_per_second = 1000
}
}
region {
region = "europe-west1"
networking_deployment_cidr = "10.0.1.0/24"
database {
database_id = rediscloud_active_active_subscription_database.database.db_id
database_name = rediscloud_active_active_subscription_database.database.name
local_write_operations_per_second = 1000
local_read_operations_per_second = 1000
}
}
}
locals {
region_id = one([for r in rediscloud_active_active_subscription_regions.regions.region : r.region_id if r.region == var.gcp_region])
}
module "private_service_connect" {
source = "RedisLabs/private-service-connect/rediscloud"
rediscloud_subscription_type = "active-active"
rediscloud_subscription_id = rediscloud_active_active_subscription.subscription.id
rediscloud_region_id = local.region_id
gcp_region = var.gcp_region
endpoints = [
{
gcp_project_id = var.gcp_project_id
gcp_vpc_name = var.gcp_vpc_name
gcp_vpc_subnetwork_name = var.gcp_subnet_name
gcp_response_policy_name = var.gcp_response_policy_name
}
]
}
```

## Argument Reference

* `subscription_id` - (Required) The ID of the Pro subscription to attach **Modifying this attribute will force creation of a new resource.**
Expand Down
51 changes: 51 additions & 0 deletions docs/resources/rediscloud_private_service_connect_endpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,57 @@ resource "rediscloud_private_service_connect_endpoint_accepter" "accepter" {
```

## Example Usage with Redis Private Service Connect Module

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).
We recommend using the module as it simplifies the Terraform configuration.

```hcl
data "rediscloud_payment_method" "card" {
card_type = "Visa"
}
resource "rediscloud_subscription" "subscription" {
name = "subscription-name"
payment_method_id = data.rediscloud_payment_method.card.id
cloud_provider {
provider = "GCP"
region {
region = var.gcp_region
networking_deployment_cidr = "10.0.1.0/24"
}
}
creation_plan {
dataset_size_in_gb = 15
quantity = 1
replication = true
throughput_measurement_by = "operations-per-second"
throughput_measurement_value = 20000
}
}
module "private_service_connect" {
source = "RedisLabs/private-service-connect/rediscloud"
rediscloud_subscription_type = "pro"
rediscloud_subscription_id = rediscloud_subscription.subscription.id
gcp_region = var.gcp_region
endpoints = [
{
gcp_project_id = var.gcp_project_id
gcp_vpc_name = var.gcp_vpc_name
gcp_vpc_subnetwork_name = var.gcp_subnet_name
gcp_response_policy_name = var.gcp_response_policy_name
}
]
}
```

## Argument Reference

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

0 comments on commit 9e32874

Please sign in to comment.