Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ae54e89
Updates the service_attachments to reduce from 40 to 1
trentrosenbaum May 2, 2025
c8637dd
test: updating tests and docs to reflect fewer provider endpoints
burythehammer May 6, 2025
7df01ef
Merge pull request #611 from RedisLabs/fix/adjust-service-attachments
burythehammer May 15, 2025
bad0b71
feat: adding in support for query performance factors on affected res…
burythehammer Mar 19, 2025
a626de8
fix: missing schema for pro sub creation plan
burythehammer Mar 24, 2025
b55c2d8
Update TestAccDataSourceRedisCloudProDatabase_basic config with RediS…
trentrosenbaum Mar 25, 2025
13a88a5
Updates datasource_rediscloud_pro_database_test to use a QPF of 2x
trentrosenbaum Mar 25, 2025
e4d3eec
Reverts AA subs to not use query_performance_factor as not supported
trentrosenbaum Mar 25, 2025
2511465
Reverts AA DB to not use query_performance_factor as not supported
trentrosenbaum Mar 25, 2025
141de6f
initial updates for the query_performance_factor
trentrosenbaum Mar 25, 2025
28ad59c
Updates pro sub and DB with QPF CustomDiff validation
trentrosenbaum Mar 27, 2025
3208bb9
New QPF based test
trentrosenbaum Apr 1, 2025
4c8c2dc
expands qpf test
trentrosenbaum Apr 1, 2025
ad66022
Reverts the resource_rediscloud_pro_database_test to focus on non qpf…
trentrosenbaum Apr 3, 2025
1302048
Updates datasource and resources to handle QPF
trentrosenbaum Apr 3, 2025
ddf2459
Updates to use rediscloud-go-api v0.23.0
trentrosenbaum Apr 3, 2025
f723df5
Introduces pro subscription test covering QPF
trentrosenbaum Apr 4, 2025
fde6675
Updates to pro sub and db for tests
trentrosenbaum Apr 4, 2025
350da73
Reducing the TEST_PARALLELISM from 6 to 2 to locate test failure
trentrosenbaum Apr 8, 2025
7c1eac6
set TEST_PARALLELISM to 1
trentrosenbaum Apr 8, 2025
79bd458
Updates to check that the QPF is within 2x to 16x range
trentrosenbaum Apr 9, 2025
7de8e74
Udpates to validate QPF range value
trentrosenbaum Apr 9, 2025
ef2c0f1
Refined the QPF range to be 2x - 8x to match swagger api response
trentrosenbaum Apr 9, 2025
694367e
Restores the TEST_PARALLELISM to a value of 6
trentrosenbaum Apr 29, 2025
99d584a
test: renaming qpf tests so that smoke tests can pick out qpf
burythehammer May 15, 2025
5b65d5d
chore: changing pr workflow to include qpf tests
burythehammer May 15, 2025
2bd68a6
fix: regex for qpf workflow is wrong
burythehammer May 15, 2025
3c69143
fix: nil check on query performance factor
burythehammer May 16, 2025
d38579a
Merge pull request #599 from RedisLabs/feat/query_performance_factors
burythehammer May 16, 2025
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
13 changes: 13 additions & 0 deletions .github/workflows/terraform_provider_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,19 @@ jobs:
go-version-file: go.mod
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloud(PrivateServiceConnect_CRUDI|AclRule_CRUDI)"'

# TODO: remove this after release
# qpf = query performance factor
go_test_smoke_qpf:
name: go test smoke qpf
needs: [ go_build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudProDatabase_qpf.*"'

tfproviderlint:
name: tfproviderlint
needs: [go_build]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The `endpoints` object has these attributes:
* `gcp_vpc_subnet_name` - The GCP Subnet name
* `endpoint_connection_name` - The endpoint connection name
* `status` - The endpoint status
* `service_attachments` - The 40 service attachments that are created for the Private Service Connect endpoint, documented below
* `service_attachments` - The service attachments that are created for the Private Service Connect endpoint, documented below

The `service_attachments` object has these attributes:

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/migration-guide-v1.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ resource "rediscloud_subscription" "example" {

alert {
name = "dataset-size"
value = 40
value = 1
}
}
}
Expand Down Expand Up @@ -132,7 +132,7 @@ To use the latest schema, you need to modify the `rediscloud_subscription` resou

alert {
name = "dataset-size"
value = 40
value = 1
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ resource "rediscloud_active_active_subscription_regions" "regions" {
}

locals {
service_attachment_count = 40 # Each rediscloud_active_active_private_service_connect_endpoint will have exactly 40 service attachments
service_attachment_count = 1 # Each rediscloud_active_active_private_service_connect_endpoint will have exactly 1 service attachment
region_id = one([for r in rediscloud_active_active_subscription_regions.regions.region : r.region_id if r.region == var.gcp_region])
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ resource "rediscloud_active_active_subscription_database" "database-resource" {
global_source_ips = ["192.168.0.0/16"]
global_alert {
name = "dataset-size"
value = 40
value = 1
}

global_modules = ["RedisJSON"]
Expand Down Expand Up @@ -161,4 +161,4 @@ To update an existing configuration for a database which uses the `memory_limit_
$ terraform state rm rediscloud_active_active_subscription_database.database-resource
(Update the configuration to use `dataset_size_in_gb` instead of `memory_limit_in_gb`)
$ terraform import rediscloud_active_active_subscription_database.database-resource 123456/12345678
```
```
4 changes: 2 additions & 2 deletions docs/resources/rediscloud_private_service_connect_endpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ resource "rediscloud_subscription" "subscription" {
}

locals {
service_attachment_count = 40 # Each rediscloud_private_service_connect_endpoint will have exactly 40 service attachments
service_attachment_count = 1 # Each rediscloud_private_service_connect_endpoint will have exactly 1 service attachment
}

resource "rediscloud_private_service_connect" "service" {
Expand Down Expand Up @@ -195,7 +195,7 @@ module "private_service_connect" {
## Attribute Reference

* `private_service_connect_endpoint_id` - The ID of the Private Service Connect Endpoint
* `service_attachments` - The 40 service attachments that are created for the Private Service Connect endpoint, documented below
* `service_attachments` - The service attachment that is created for the Private Service Connect endpoint, documented below

The `service_attachments` object has these attributes:

Expand Down
4 changes: 2 additions & 2 deletions docs/resources/rediscloud_subscription_database.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ resource "rediscloud_subscription_database" "database-resource" {

alert {
name = "dataset-size"
value = 40
value = 1
}

tags = {
Expand Down Expand Up @@ -171,4 +171,4 @@ To update an existing configuration for a database which uses the `memory_limit_
$ terraform state rm rediscloud_subscription_database.database-resource
(Update the configuration to use `dataset_size_in_gb` instead of `memory_limit_in_gb`)
$ terraform import rediscloud_subscription_database.database-resource 123456/12345678
```
```
9 changes: 9 additions & 0 deletions provider/datasource_rediscloud_pro_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ func dataSourceRedisCloudProDatabase() *schema.Resource {
Type: schema.TypeFloat,
Computed: true,
},
"query_performance_factor": {
Description: "Query performance factor for this specific database",
Type: schema.TypeString,
Computed: true,
},
"support_oss_cluster_api": {
Description: "Supports the Redis open-source (OSS) Cluster API",
Type: schema.TypeBool,
Expand Down Expand Up @@ -476,6 +481,10 @@ func dataSourceRedisCloudProDatabaseRead(ctx context.Context, d *schema.Resource
return diag.FromErr(err)
}

if err := d.Set("query_performance_factor", redis.String(*db.QueryPerformanceFactor)); err != nil {
return diag.FromErr(err)
}

return diags
}

Expand Down
10 changes: 10 additions & 0 deletions provider/datasource_rediscloud_pro_database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func TestAccDataSourceRedisCloudProDatabase_basic(t *testing.T) {
resource.TestCheckResourceAttrSet(dataSourceById, "public_endpoint"),
resource.TestCheckResourceAttrSet(dataSourceById, "private_endpoint"),
resource.TestCheckResourceAttr(dataSourceById, "enable_default_user", "true"),
resource.TestCheckResourceAttr(dataSourceById, "query_performance_factor", "2x"),

resource.TestCheckResourceAttr(dataSourceByName, "name", "tf-database"),
resource.TestCheckResourceAttr(dataSourceByName, "protocol", "redis"),
Expand All @@ -59,6 +60,7 @@ func TestAccDataSourceRedisCloudProDatabase_basic(t *testing.T) {
resource.TestCheckResourceAttrSet(dataSourceByName, "public_endpoint"),
resource.TestCheckResourceAttrSet(dataSourceByName, "private_endpoint"),
resource.TestCheckResourceAttr(dataSourceByName, "enable_default_user", "true"),
resource.TestCheckResourceAttr(dataSourceByName, "query_performance_factor", "2x"),
),
},
},
Expand Down Expand Up @@ -94,6 +96,8 @@ resource "rediscloud_subscription" "example" {
support_oss_cluster_api=true
throughput_measurement_by = "operations-per-second"
throughput_measurement_value = 1000
query_performance_factor = "2x"
modules = ["RediSearch"]
}
}
resource "rediscloud_subscription_database" "example" {
Expand All @@ -108,6 +112,12 @@ resource "rediscloud_subscription_database" "example" {
support_oss_cluster_api = true
replication = false
enable_default_user = true
query_performance_factor = "2x"
modules = [
{
name: "RediSearch"
}
]
}

data "rediscloud_database" "example-by-id" {
Expand Down
2 changes: 1 addition & 1 deletion provider/datasource_rediscloud_pro_subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ resource "rediscloud_active_active_subscription_database" "example" {
global_source_ips = ["192.168.0.0/16", "192.170.0.0/16"]
global_alert {
name = "dataset-size"
value = 40
value = 1
}
override_region {
name = "us-east-1"
Expand Down
8 changes: 4 additions & 4 deletions provider/rediscloud_active_active_database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestAccResourceRedisCloudActiveActiveDatabase_CRUDI(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "data_eviction", "volatile-lru"),
resource.TestCheckResourceAttr(resourceName, "global_alert.#", "1"),
resource.TestCheckResourceAttr(resourceName, "global_alert.0.name", "dataset-size"),
resource.TestCheckResourceAttr(resourceName, "global_alert.0.value", "40"),
resource.TestCheckResourceAttr(resourceName, "global_alert.0.value", "1"),
resource.TestCheckResourceAttr(resourceName, "global_modules.#", "1"),
resource.TestCheckResourceAttr(resourceName, "global_modules.0", "RedisJSON"),
resource.TestCheckResourceAttr(resourceName, "global_source_ips.#", "2"),
Expand Down Expand Up @@ -294,7 +294,7 @@ resource "rediscloud_active_active_subscription_database" "example" {
global_source_ips = ["192.168.0.0/16", "192.170.0.0/16"]
global_alert {
name = "dataset-size"
value = 40
value = 1
}
global_modules = ["RedisJSON"]
override_region {
Expand Down Expand Up @@ -433,7 +433,7 @@ resource "rediscloud_active_active_subscription_database" "example" {
global_source_ips = ["192.168.0.0/16", "192.170.0.0/16"]
global_alert {
name = "dataset-size"
value = 40
value = 1
}
override_region {
name = "us-east-1"
Expand Down Expand Up @@ -466,7 +466,7 @@ resource "rediscloud_active_active_subscription_database" "example" {
global_source_ips = ["192.168.0.0/16", "192.170.0.0/16"]
global_alert {
name = "dataset-size"
value = 40
value = 1
}
override_region {
name = "us-east-1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ resource "google_compute_subnetwork" "subnet" {
}

locals {
service_attachment_count = 40
service_attachment_count = 1
}

resource "google_compute_address" "default" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestAccResourceRedisCloudActiveActivePrivateServiceConnectEndpoint_CRUDI(t
}
return nil
}),
resource.TestCheckResourceAttr(datasourceName, "endpoints.0.service_attachments.#", "40"),
resource.TestCheckResourceAttr(datasourceName, "endpoints.0.service_attachments.#", "1"),
),
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ resource "google_compute_subnetwork" "subnet" {
}

locals {
service_attachment_count = 40
service_attachment_count = 1
}

resource "google_compute_address" "default" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestAccResourceRedisCloudPrivateServiceConnectEndpoint_CRUDI(t *testing.T)
}
return nil
}),
resource.TestCheckResourceAttr(datasourceName, "endpoints.0.service_attachments.#", "40"),
resource.TestCheckResourceAttr(datasourceName, "endpoints.0.service_attachments.#", "1"),
),
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ package provider

import (
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"os"
"regexp"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccResourceRedisCloudActiveActiveSubscriptionPeering_aws(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ resource "rediscloud_active_active_subscription_database" "example" {
global_password = "%s"
global_alert {
name = "dataset-size"
value = 40
value = 1
}
}

Expand Down
Loading
Loading