Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
54 changes: 27 additions & 27 deletions docs/data-sources/rediscloud_active_active_private_link.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
layout: "rediscloud"
page_title: "Redis Cloud: rediscloud_private_link"
page_title: "Redis Cloud: rediscloud_active_active_private_link"
description: |-
PrivateLink data source for Pro Subscription in the Redis Cloud Terraform provider.
PrivateLink data source for Active-Active subscriptions in the Redis Cloud Terraform provider.
---

# Data Source: rediscloud_active_active_private_link
The PrivateLink data source allows the user to retrieve information about an existing PrivateLink for an Active Active Subscription in the provider.
Retrieves information about an existing PrivateLink for an Active-Active subscription region.

## Example Usage

```hcl
data "rediscloud_active_active_private_link" "example" {
subscription_id = "1234"
region_id = 1
region_id = 1
}

output "rediscloud_private_link_principals" {
Expand All @@ -23,31 +23,31 @@ output "rediscloud_private_link_principals" {

## Argument Reference

* `subscription_id` - (Required) The ID of the Active Active Subscription the PrivateLink is attached to.
* `region_id` - (Required) The region ID within the Active Active subscription that the PrivateLink is attached to.
* `subscription_id` - (Required) The ID of the Active-Active subscription the PrivateLink is attached to.
* `region_id` - (Required) The region ID within the Active-Active subscription that the PrivateLink is attached to.

## Attribute reference
## Attribute Reference

* `principals` - The principal(s) attached to the PrivateLink.
* `resource_configuration_id` - ID of the resource configuration to attach to this PrivateLink
* `resource_configuration_arn` - ARN of the resource configuration to attach to this PrivateLink
* `share_arn` - Share ARN of this PrivateLink.
* `connections` - List of connections associated with the PrivateLink.
* `databases` - List of databases associated with the PrivateLink.
* `principals` - A list of principals attached to the PrivateLink.
* `resource_configuration_id` - The ID of the resource configuration attached to this PrivateLink.
* `resource_configuration_arn` - The ARN of the resource configuration attached to this PrivateLink.
* `share_arn` - The share ARN of this PrivateLink.
* `connections` - A list of connections associated with the PrivateLink.
* `databases` - A list of databases associated with the PrivateLink.

The `principals` object is a list, with these attributes:
The `principals` object is a list with these attributes:
* `principal` - The principal attached to this PrivateLink.
* `principal_type` - The principal type.
* `principal_alias` - The friendly name to refer to the principal.

The `connections` object is a list, with these attributes:
* `association_id` - Association ID of the PrivateLink connection.
* `connection_id` - Connection ID of the PrivateLink connection
* `connection_type` - The PrivateLink connection type.
* `owner_id` - Owner ID of the connection.
* `association_date` - Date the connection was associated.

The `databases` object is a list, with these attributes:
* `database_id` - ID of the database.
* `port` - The port which the database is available on.
* `principal_type` - The type of principal.
* `principal_alias` - A friendly name for the principal.

The `connections` object is a list with these attributes:
* `association_id` - The association ID of the PrivateLink connection.
* `connection_id` - The connection ID of the PrivateLink connection.
* `connection_type` - The type of the PrivateLink connection.
* `owner_id` - The owner ID of the connection.
* `association_date` - The date the connection was associated.

The `databases` object is a list with these attributes:
* `database_id` - The ID of the database.
* `port` - The port the database is available on.
* `resource_link_endpoint` - The resource link endpoint for the database.
45 changes: 22 additions & 23 deletions docs/data-sources/rediscloud_private_link.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: |-
---

# Data Source: rediscloud_private_link
The PrivateLink data source allows the user to retrieve information about an existing PrivateLink in the provider.
Retrieves details of an existing PrivateLink for a Pro Subscription.

## Example Usage

Expand All @@ -24,29 +24,28 @@ output "rediscloud_private_link_principals" {

* `subscription_id` - (Required) The ID of the Pro Subscription the PrivateLink is attached to.

## Attribute reference
## Attribute Reference

* `principals` - The principal(s) attached to the PrivateLink.
* `resource_configuration_id` - ID of the resource configuration to attach to this PrivateLink
* `resource_configuration_arn` - ARN of the resource configuration to attach to this PrivateLink
* `share_arn` - Share ARN of this PrivateLink.
* `connections` - List of connections associated with the PrivateLink.
* `databases` - List of databases associated with the PrivateLink.
* `principals` - A list of principals attached to the PrivateLink.
* `resource_configuration_id` - The ID of the resource configuration attached to this PrivateLink.
* `resource_configuration_arn` - The ARN of the resource configuration attached to this PrivateLink.
* `share_arn` - The share ARN of this PrivateLink.
* `connections` - A list of connections associated with the PrivateLink.
* `databases` - A list of databases associated with the PrivateLink.


The `principals` object is a list, with these attributes:
The `principals` object supports the following attributes:
* `principal` - The principal attached to this PrivateLink.
* `principal_type` - The principal type.
* `principal_alias` - The friendly name to refer to the principal.

The `connections` object is a list, with these attributes:
* `association_id` - Association ID of the PrivateLink connection.
* `connection_id` - Connection ID of the PrivateLink connection
* `connection_type` - The PrivateLink connection type.
* `owner_id` - Owner ID of the connection.
* `association_date` - Date the connection was associated.

The `databases` object is a list, with these attributes:
* `database_id` - ID of the database.
* `port` - The port which the database is available on.
* `principal_type` - The type of principal.
* `principal_alias` - A friendly name for the principal.

The `connections` object supports the following attributes:
* `association_id` - The association ID of the PrivateLink connection.
* `connection_id` - The connection ID of the PrivateLink connection.
* `connection_type` - The type of the PrivateLink connection.
* `owner_id` - The owner ID of the connection.
* `association_date` - The date the connection was associated.

The `databases` object supports the following attributes:
* `database_id` - The ID of the database.
* `port` - The port the database is available on.
* `resource_link_endpoint` - The resource link endpoint for the database.
82 changes: 52 additions & 30 deletions docs/resources/rediscloud_active_active_private_link.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
layout: "rediscloud"
page_title: "Redis Cloud: rediscloud_active_active_private_link"
description: |-
PrivateLink resource for Active Active Subscription in the Redis Cloud Terraform provider.
PrivateLink resource for an Active-Active Subscription in the Redis Cloud Terraform provider.
---

# Resource: rediscloud_active_active_private_link

Manages a PrivateLink to a Active Active Subscription in your Redis Enterprise Cloud Account.
Manages a PrivateLink to an Active-Active Subscription in your Redis Enterprise Cloud Account.

Note the forced dependency on the Active-Active database. Currently, you require a database to be attached to your subscription in order for a `region_id` to be assigned.

## Example Usage

Expand All @@ -30,41 +32,48 @@ data "rediscloud_cloud_account" "account" {
name = local.rediscloud_cloud_account
}

resource "rediscloud_active_active_subscription" "subscription" {
resource "rediscloud_active_active_subscription" "aa_subscription" {
name = local.rediscloud_subscription_name
payment_method = "credit-card"
payment_method_id = data.rediscloud_payment_method.card.id
cloud_provider = "AWS"

cloud_provider {
provider = data.rediscloud_cloud_account.account.provider_type
cloud_account_id = data.rediscloud_cloud_account.account.id
creation_plan {
memory_limit_in_gb = 1
quantity = 1
region {
region = "eu-west-1"
networking_deployment_cidr = "10.0.0.0/24"
preferred_availability_zones = ["eu-west-1a"]
region = "eu-west-1"
networking_deployment_cidr = "192.168.0.0/24"
write_operations_per_second = 1000
read_operations_per_second = 1000
}
region {
region = "eu-west-2"
networking_deployment_cidr = "10.0.1.0/24"
write_operations_per_second = 1000
read_operations_per_second = 1000
}
}

creation_plan {
dataset_size_in_gb = 15
quantity = 1
replication = true
throughput_measurement_by = "operations-per-second"
throughput_measurement_value = 20000
}
}

resource "rediscloud_active_active_subscription_database" "database_resource" {
subscription_id = rediscloud_active_active_subscription.subscription.id
resource "rediscloud_active_active_subscription_database" "aa_database" {
subscription_id = rediscloud_active_active_subscription.aa_subscription.id
name = "db"
memory_limit_in_gb = 1
global_data_persistence = "aof-every-1-second"
global_password = local.rediscloud_database_password
}

data "rediscloud_active_active_subscription_regions" "aa_regions_info" {
subscription_name = rediscloud_active_active_subscription.aa_subscription.name
depends_on = [rediscloud_active_active_subscription_database.aa_database]
}


resource "rediscloud_private_link" "private_link" {
subscription_id = rediscloud_subscription.subscription.id
share_name = local.rediscloud_private_link_share_name
resource "rediscloud_active_active_private_link" "private_link" {
subscription_id = rediscloud_active_active_subscription.aa_subscription.id
region_id = data.rediscloud_active_active_subscription_regions.aa_regions_info.regions[0].region_id
share_name = local.rediscloud_private_link_share_name

principal {
principal = "123456789012"
Expand All @@ -82,8 +91,8 @@ resource "rediscloud_private_link" "private_link" {

## Argument Reference

* `subscription_id` - (Required) The ID of the Active Active Subscription to link to. **Modifying this attribute will force creation of a new resource.**
* `region_id` - (Required)
* `subscription_id` - (Required) The ID of the Active-Active Subscription to link to. **Modifying this attribute will force creation of a new resource.**
* `region_id` - (Required) The region ID within the Active-Active subscription that the PrivateLink is attached to. **Modifying this attribute will force creation of a new resource.**
* `share_name` - (Required) The share name of the PrivateLink.
* `principal` - (Required) The principal(s) attached to the PrivateLink.

Expand All @@ -94,14 +103,27 @@ The `principal` block supports:

## Attribute Reference

* `resource_configuration_id` - Configuration I
* `resource_configuration_arn`
* `share_arn`
* `connections` (block)
* `databases` (block)
* `resource_configuration_id` - ID of the resource configuration to attach to this PrivateLink
* `resource_configuration_arn` - ARN of the resource configuration to attach to this PrivateLink
* `share_arn` - Share ARN of this PrivateLink.
* `connections` - List of connections associated with the PrivateLink.
* `databases` - List of databases associated with the PrivateLink.

The `connections` object has these attributes:

* `association_id` - Association ID of the PrivateLink connection.
* `connection_id` - Connection ID of the PrivateLink connection.
* `connection_type` - Type of the PrivateLink connection.
* `owner_id` - Owner ID of the connection.
* `association_date` - Date the connection was associated.

The `databases` object has these attributes:
* `database_id` - ID of the database.
* `port` - The port which the database is available on.
* `resource_link_endpoint` - The resource link endpoint for the database.

## Import
`rediscloud_active_active_private_link` can be imported using the ID of the subscription and the region id, e.g.
`rediscloud_active_active_private_link` can be imported using the ID of the subscription and the region id in the format SUB_ID/REGION_ID, e.g.

```
$ terraform import rediscloud_active_active_private_link.id 123456/1
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.24.0
toolchain go1.24.1

require (
github.com/RedisLabs/rediscloud-go-api v0.36.3
github.com/RedisLabs/rediscloud-go-api v0.36.4
github.com/bflad/tfproviderlint v0.31.0
github.com/hashicorp/go-cty v1.5.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/ProtonMail/go-crypto v1.1.6 h1:ZcV+Ropw6Qn0AX9brlQLAUXfqLBc7Bl+f/DmNxpLfdw=
github.com/ProtonMail/go-crypto v1.1.6/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE=
github.com/RedisLabs/rediscloud-go-api v0.36.3 h1:HEMJ6h+HbVj42bB1wabqTi9wgHjGcS0NIhxuJBvFFns=
github.com/RedisLabs/rediscloud-go-api v0.36.3/go.mod h1:Hkh3i/EsHnyfgV0ijednbofz/EmZC3sFnSNNruF3G6I=
github.com/RedisLabs/rediscloud-go-api v0.36.4 h1:EBoyJ3SyvfX4MjTB5MNs5s+hhYTVSVzjdhNtPJDcfMw=
github.com/RedisLabs/rediscloud-go-api v0.36.4/go.mod h1:Hkh3i/EsHnyfgV0ijednbofz/EmZC3sFnSNNruF3G6I=
github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE=
github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec=
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
locals {
rediscloud_subscription_name = "%s"
}

data "rediscloud_payment_method" "card" {
card_type = "Visa"
last_four_numbers = "5556"
}

resource "rediscloud_active_active_subscription" "example" {
name = local.rediscloud_subscription_name
payment_method_id = data.rediscloud_payment_method.card.id
cloud_provider = "AWS"

creation_plan {
memory_limit_in_gb = 1
modules = ["RedisJSON"]
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
}
}

maintenance_windows {
mode = "manual"
window {
start_hour = 22
duration_in_hours = 8
days = ["Monday", "Thursday"]
}
window {
start_hour = 12
duration_in_hours = 6
days = ["Friday", "Saturday", "Sunday"]
}
}
}

resource "rediscloud_active_active_subscription_database" "example" {
subscription_id = rediscloud_active_active_subscription.example.id
name = local.rediscloud_subscription_name
dataset_size_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
}

global_modules = ["RedisJSON"]



override_region {
name = "us-east-2"
enable_default_user = true
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
}
}

tags = {
"environment" = "production"
"cost_center" = "0700"
}
}


data "rediscloud_active_active_subscription" "example" {
name = rediscloud_active_active_subscription.example.name
}

data "rediscloud_active_active_subscription_regions" "example" {
subscription_name = rediscloud_active_active_subscription.example.name
}

Loading
Loading