Skip to content

Commit e12c700

Browse files
Merge pull request #665 from RedisLabs/feat/OPCR-19-disable-default-user-aa
OPCR-19 default user field aa
2 parents 20f4b4e + d725a7b commit e12c700

20 files changed

+359
-234
lines changed
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
layout: "rediscloud"
3-
page_title: "Redis Cloud: rediscloud_private_link"
3+
page_title: "Redis Cloud: rediscloud_active_active_private_link"
44
description: |-
5-
PrivateLink data source for Pro Subscription in the Redis Cloud Terraform provider.
5+
PrivateLink data source for Active-Active subscriptions in the Redis Cloud Terraform provider.
66
---
77

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

1111
## Example Usage
1212

1313
```hcl
1414
data "rediscloud_active_active_private_link" "example" {
1515
subscription_id = "1234"
16-
region_id = 1
16+
region_id = 1
1717
}
1818
1919
output "rediscloud_private_link_principals" {
@@ -23,31 +23,31 @@ output "rediscloud_private_link_principals" {
2323

2424
## Argument Reference
2525

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

29-
## Attribute reference
29+
## Attribute Reference
3030

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

38-
The `principals` object is a list, with these attributes:
38+
The `principals` object is a list with these attributes:
3939
* `principal` - The principal attached to this PrivateLink.
40-
* `principal_type` - The principal type.
41-
* `principal_alias` - The friendly name to refer to the principal.
42-
43-
The `connections` object is a list, with these attributes:
44-
* `association_id` - Association ID of the PrivateLink connection.
45-
* `connection_id` - Connection ID of the PrivateLink connection
46-
* `connection_type` - The PrivateLink connection type.
47-
* `owner_id` - Owner ID of the connection.
48-
* `association_date` - Date the connection was associated.
49-
50-
The `databases` object is a list, with these attributes:
51-
* `database_id` - ID of the database.
52-
* `port` - The port which the database is available on.
40+
* `principal_type` - The type of principal.
41+
* `principal_alias` - A friendly name for the principal.
42+
43+
The `connections` object is a list with these attributes:
44+
* `association_id` - The association ID of the PrivateLink connection.
45+
* `connection_id` - The connection ID of the PrivateLink connection.
46+
* `connection_type` - The type of the PrivateLink connection.
47+
* `owner_id` - The owner ID of the connection.
48+
* `association_date` - The date the connection was associated.
49+
50+
The `databases` object is a list with these attributes:
51+
* `database_id` - The ID of the database.
52+
* `port` - The port the database is available on.
5353
* `resource_link_endpoint` - The resource link endpoint for the database.

docs/data-sources/rediscloud_private_link.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: |-
66
---
77

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

1111
## Example Usage
1212

@@ -24,29 +24,28 @@ output "rediscloud_private_link_principals" {
2424

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

27-
## Attribute reference
27+
## Attribute Reference
2828

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

36-
37-
The `principals` object is a list, with these attributes:
36+
The `principals` object supports the following attributes:
3837
* `principal` - The principal attached to this PrivateLink.
39-
* `principal_type` - The principal type.
40-
* `principal_alias` - The friendly name to refer to the principal.
41-
42-
The `connections` object is a list, with these attributes:
43-
* `association_id` - Association ID of the PrivateLink connection.
44-
* `connection_id` - Connection ID of the PrivateLink connection
45-
* `connection_type` - The PrivateLink connection type.
46-
* `owner_id` - Owner ID of the connection.
47-
* `association_date` - Date the connection was associated.
48-
49-
The `databases` object is a list, with these attributes:
50-
* `database_id` - ID of the database.
51-
* `port` - The port which the database is available on.
38+
* `principal_type` - The type of principal.
39+
* `principal_alias` - A friendly name for the principal.
40+
41+
The `connections` object supports the following attributes:
42+
* `association_id` - The association ID of the PrivateLink connection.
43+
* `connection_id` - The connection ID of the PrivateLink connection.
44+
* `connection_type` - The type of the PrivateLink connection.
45+
* `owner_id` - The owner ID of the connection.
46+
* `association_date` - The date the connection was associated.
47+
48+
The `databases` object supports the following attributes:
49+
* `database_id` - The ID of the database.
50+
* `port` - The port the database is available on.
5251
* `resource_link_endpoint` - The resource link endpoint for the database.

docs/resources/rediscloud_active_active_private_link.md

Lines changed: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
layout: "rediscloud"
33
page_title: "Redis Cloud: rediscloud_active_active_private_link"
44
description: |-
5-
PrivateLink resource for Active Active Subscription in the Redis Cloud Terraform provider.
5+
PrivateLink resource for an Active-Active Subscription in the Redis Cloud Terraform provider.
66
---
77

88
# Resource: rediscloud_active_active_private_link
99

10-
Manages a PrivateLink to a Active Active Subscription in your Redis Enterprise Cloud Account.
10+
Manages a PrivateLink to an Active-Active Subscription in your Redis Enterprise Cloud Account.
11+
12+
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.
1113

1214
## Example Usage
1315

@@ -30,41 +32,48 @@ data "rediscloud_cloud_account" "account" {
3032
name = local.rediscloud_cloud_account
3133
}
3234
33-
resource "rediscloud_active_active_subscription" "subscription" {
35+
resource "rediscloud_active_active_subscription" "aa_subscription" {
3436
name = local.rediscloud_subscription_name
37+
payment_method = "credit-card"
3538
payment_method_id = data.rediscloud_payment_method.card.id
39+
cloud_provider = "AWS"
3640
37-
cloud_provider {
38-
provider = data.rediscloud_cloud_account.account.provider_type
39-
cloud_account_id = data.rediscloud_cloud_account.account.id
41+
creation_plan {
42+
memory_limit_in_gb = 1
43+
quantity = 1
4044
region {
41-
region = "eu-west-1"
42-
networking_deployment_cidr = "10.0.0.0/24"
43-
preferred_availability_zones = ["eu-west-1a"]
45+
region = "eu-west-1"
46+
networking_deployment_cidr = "192.168.0.0/24"
47+
write_operations_per_second = 1000
48+
read_operations_per_second = 1000
49+
}
50+
region {
51+
region = "eu-west-2"
52+
networking_deployment_cidr = "10.0.1.0/24"
53+
write_operations_per_second = 1000
54+
read_operations_per_second = 1000
4455
}
45-
}
46-
47-
creation_plan {
48-
dataset_size_in_gb = 15
49-
quantity = 1
50-
replication = true
51-
throughput_measurement_by = "operations-per-second"
52-
throughput_measurement_value = 20000
5356
}
5457
}
5558
56-
resource "rediscloud_active_active_subscription_database" "database_resource" {
57-
subscription_id = rediscloud_active_active_subscription.subscription.id
59+
resource "rediscloud_active_active_subscription_database" "aa_database" {
60+
subscription_id = rediscloud_active_active_subscription.aa_subscription.id
5861
name = "db"
5962
memory_limit_in_gb = 1
6063
global_data_persistence = "aof-every-1-second"
6164
global_password = local.rediscloud_database_password
6265
}
6366
67+
data "rediscloud_active_active_subscription_regions" "aa_regions_info" {
68+
subscription_name = rediscloud_active_active_subscription.aa_subscription.name
69+
depends_on = [rediscloud_active_active_subscription_database.aa_database]
70+
}
71+
6472
65-
resource "rediscloud_private_link" "private_link" {
66-
subscription_id = rediscloud_subscription.subscription.id
67-
share_name = local.rediscloud_private_link_share_name
73+
resource "rediscloud_active_active_private_link" "private_link" {
74+
subscription_id = rediscloud_active_active_subscription.aa_subscription.id
75+
region_id = data.rediscloud_active_active_subscription_regions.aa_regions_info.regions[0].region_id
76+
share_name = local.rediscloud_private_link_share_name
6877
6978
principal {
7079
principal = "123456789012"
@@ -82,8 +91,8 @@ resource "rediscloud_private_link" "private_link" {
8291

8392
## Argument Reference
8493

85-
* `subscription_id` - (Required) The ID of the Active Active Subscription to link to. **Modifying this attribute will force creation of a new resource.**
86-
* `region_id` - (Required)
94+
* `subscription_id` - (Required) The ID of the Active-Active Subscription to link to. **Modifying this attribute will force creation of a new resource.**
95+
* `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.**
8796
* `share_name` - (Required) The share name of the PrivateLink.
8897
* `principal` - (Required) The principal(s) attached to the PrivateLink.
8998

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

95104
## Attribute Reference
96105

97-
* `resource_configuration_id` - Configuration I
98-
* `resource_configuration_arn`
99-
* `share_arn`
100-
* `connections` (block)
101-
* `databases` (block)
106+
* `resource_configuration_id` - ID of the resource configuration to attach to this PrivateLink
107+
* `resource_configuration_arn` - ARN of the resource configuration to attach to this PrivateLink
108+
* `share_arn` - Share ARN of this PrivateLink.
109+
* `connections` - List of connections associated with the PrivateLink.
110+
* `databases` - List of databases associated with the PrivateLink.
111+
112+
The `connections` object has these attributes:
113+
114+
* `association_id` - Association ID of the PrivateLink connection.
115+
* `connection_id` - Connection ID of the PrivateLink connection.
116+
* `connection_type` - Type of the PrivateLink connection.
117+
* `owner_id` - Owner ID of the connection.
118+
* `association_date` - Date the connection was associated.
119+
120+
The `databases` object has these attributes:
121+
* `database_id` - ID of the database.
122+
* `port` - The port which the database is available on.
123+
* `resource_link_endpoint` - The resource link endpoint for the database.
102124

103125
## Import
104-
`rediscloud_active_active_private_link` can be imported using the ID of the subscription and the region id, e.g.
126+
`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.
105127

106128
```
107129
$ terraform import rediscloud_active_active_private_link.id 123456/1

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.24.0
55
toolchain go1.24.1
66

77
require (
8-
github.com/RedisLabs/rediscloud-go-api v0.36.3
8+
github.com/RedisLabs/rediscloud-go-api v0.36.4
99
github.com/bflad/tfproviderlint v0.31.0
1010
github.com/hashicorp/go-cty v1.5.0
1111
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo
44
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
55
github.com/ProtonMail/go-crypto v1.1.6 h1:ZcV+Ropw6Qn0AX9brlQLAUXfqLBc7Bl+f/DmNxpLfdw=
66
github.com/ProtonMail/go-crypto v1.1.6/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE=
7-
github.com/RedisLabs/rediscloud-go-api v0.36.3 h1:HEMJ6h+HbVj42bB1wabqTi9wgHjGcS0NIhxuJBvFFns=
8-
github.com/RedisLabs/rediscloud-go-api v0.36.3/go.mod h1:Hkh3i/EsHnyfgV0ijednbofz/EmZC3sFnSNNruF3G6I=
7+
github.com/RedisLabs/rediscloud-go-api v0.36.4 h1:EBoyJ3SyvfX4MjTB5MNs5s+hhYTVSVzjdhNtPJDcfMw=
8+
github.com/RedisLabs/rediscloud-go-api v0.36.4/go.mod h1:Hkh3i/EsHnyfgV0ijednbofz/EmZC3sFnSNNruF3G6I=
99
github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE=
1010
github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
1111
github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec=
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
locals {
2+
rediscloud_subscription_name = "%s"
3+
}
4+
5+
data "rediscloud_payment_method" "card" {
6+
card_type = "Visa"
7+
last_four_numbers = "5556"
8+
}
9+
10+
resource "rediscloud_active_active_subscription" "example" {
11+
name = local.rediscloud_subscription_name
12+
payment_method_id = data.rediscloud_payment_method.card.id
13+
cloud_provider = "AWS"
14+
15+
creation_plan {
16+
memory_limit_in_gb = 1
17+
modules = ["RedisJSON"]
18+
quantity = 1
19+
region {
20+
region = "us-east-1"
21+
networking_deployment_cidr = "192.168.0.0/24"
22+
write_operations_per_second = 1000
23+
read_operations_per_second = 1000
24+
}
25+
region {
26+
region = "us-east-2"
27+
networking_deployment_cidr = "10.0.1.0/24"
28+
write_operations_per_second = 1000
29+
read_operations_per_second = 1000
30+
}
31+
}
32+
33+
maintenance_windows {
34+
mode = "manual"
35+
window {
36+
start_hour = 22
37+
duration_in_hours = 8
38+
days = ["Monday", "Thursday"]
39+
}
40+
window {
41+
start_hour = 12
42+
duration_in_hours = 6
43+
days = ["Friday", "Saturday", "Sunday"]
44+
}
45+
}
46+
}
47+
48+
resource "rediscloud_active_active_subscription_database" "example" {
49+
subscription_id = rediscloud_active_active_subscription.example.id
50+
name = local.rediscloud_subscription_name
51+
dataset_size_in_gb = 1
52+
global_data_persistence = "aof-every-1-second"
53+
global_password = "some-random-pass-2"
54+
global_source_ips = ["192.168.0.0/16"]
55+
global_alert {
56+
name = "dataset-size"
57+
value = 40
58+
}
59+
60+
global_modules = ["RedisJSON"]
61+
62+
63+
64+
override_region {
65+
name = "us-east-2"
66+
enable_default_user = true
67+
override_global_source_ips = ["192.10.0.0/16"]
68+
}
69+
70+
override_region {
71+
name = "us-east-1"
72+
override_global_data_persistence = "none"
73+
override_global_password = "region-specific-password"
74+
override_global_alert {
75+
name = "dataset-size"
76+
value = 60
77+
}
78+
}
79+
80+
tags = {
81+
"environment" = "production"
82+
"cost_center" = "0700"
83+
}
84+
}
85+
86+
87+
data "rediscloud_active_active_subscription" "example" {
88+
name = rediscloud_active_active_subscription.example.name
89+
}
90+
91+
data "rediscloud_active_active_subscription_regions" "example" {
92+
subscription_name = rediscloud_active_active_subscription.example.name
93+
}
94+

0 commit comments

Comments
 (0)