Skip to content

Commit 757cfc2

Browse files
authored
Updated docs, reintroduced some very short delays before Waiting and removed redisearch/throughput validation (#560)
1 parent 2d7e7d5 commit 757cfc2

5 files changed

+8
-101
lines changed

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Use the navigation to the left to read about the available provider resources an
1313

1414
## Configure Redis Enterprise Cloud Programmatic Access
1515

16-
In order to setup authentication with the Redis Enterprise Cloud provider a programmatic API key must be generated for Redis Enterprise Cloud. The [Redis Enterprise Cloud documentation](https://docs.redislabs.com/latest/rc/api/how-to/enable-your-account-to-use-api/) contains the most up-to-date instructions for creating and managing your key(s) and IP access.
16+
In order to setup authentication with the Redis Enterprise Cloud provider a programmatic API key must be generated for Redis Enterprise Cloud. The [Redis Enterprise Cloud documentation](https://redis.io/docs/latest/integrate/terraform-provider-for-redis-cloud/) contains the most up-to-date instructions for creating and managing your key(s) and IP access.
1717

1818
## Example Usage
1919

docs/resources/rediscloud_active_active_subscription_database.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ The following arguments are supported:
9090
* `external_endpoint_for_oss_cluster_api` - (Optional) Should use the external endpoint for open-source (OSS) Cluster API.
9191
Can only be enabled if OSS Cluster API support is enabled. Default: 'false'
9292
* `enable_tls` - (Optional) Use TLS for authentication. Default: ‘false’
93-
* `client_ssl_certificate` - (Optional) SSL certificate to authenticate user connections.
93+
`client_ssl_certificate` - (Optional) SSL certificate to authenticate user connections, conflicts with `client_tls_certificates`
94+
* `client_tls_certificates` - (Optional) A list of TLS certificates to authenticate user connections, conflicts with `client_ssl_certificate`
9495
* `data_eviction` - (Optional) The data items eviction policy (either: 'allkeys-lru', 'allkeys-lfu', 'allkeys-random', 'volatile-lru', 'volatile-lfu', 'volatile-random', 'volatile-ttl' or 'noeviction'. Default: 'volatile-lru')
9596
* `global_data_persistence` - (Optional) Global rate of database data persistence (in persistent storage) of regions that dont override global settings. Default: 'none'
9697
* `global_password` - (Optional) Password to access the database of regions that don't override global settings. If left empty, the password will be generated automatically

docs/resources/rediscloud_subscription_database.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ The following arguments are supported:
8484
* `resp_version` - (Optional) Either `resp2` or `resp3`. Database's RESP version. Must be compatible with the Redis version.
8585
* `external_endpoint_for_oss_cluster_api` - (Optional) Should use the external endpoint for open-source (OSS) Cluster API.
8686
Can only be enabled if OSS Cluster API support is enabled. Default: 'false'
87-
* `client_ssl_certificate` - (Optional) SSL certificate to authenticate user connections
87+
* `client_ssl_certificate` - (Optional) SSL certificate to authenticate user connections, conflicts with `client_tls_certificates`
88+
* `client_tls_certificates` - (Optional) A list of TLS certificates to authenticate user connections, conflicts with `client_ssl_certificate`
8889
* `periodic_backup_path` - (Optional) Path that will be used to store database backup files. **Deprecated: Use `remote_backup` block instead**
8990
* `replica_of` - (Optional) Set of Redis database URIs, in the format `redis://user:password@host:port`, that this
9091
database will be a replica of. If the URI provided is Redis Labs Cloud instance, only host and port should be provided.

provider/resource_rediscloud_pro_subscription.go

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -794,25 +794,6 @@ func buildSubscriptionCreatePlanDatabases(memoryStorage string, planMap map[stri
794794
}
795795
}
796796

797-
// Check if one of the modules is RedisSearch
798-
containsSearch := false
799-
for _, module := range planModules {
800-
if *module == "RediSearch" {
801-
containsSearch = true
802-
break
803-
}
804-
}
805-
// if RediSearch is in the modules, throughput may not be operations-per-second
806-
if containsSearch && throughputMeasurementBy == "operations-per-second" {
807-
errDiag := diag.Diagnostic{
808-
Severity: diag.Error,
809-
Summary: "subscription could not be created: throughput may not be measured by `operations-per-second` while the `RediSearch` module is active",
810-
Detail: "throughput may not be measured by `operations-per-second` while the `RediSearch` module is active. use an alternative measurement like `number-of-shards`",
811-
}
812-
// Short-circuit here, this is an unrecoverable situation
813-
return nil, append(diags, errDiag)
814-
}
815-
816797
// Check if one of the modules is RedisGraph
817798
containsGraph := false
818799
for _, module := range planModules {
@@ -895,6 +876,7 @@ func waitForSubscriptionToBeActive(ctx context.Context, id int, api *apiClient)
895876
Pending: []string{subscriptions.SubscriptionStatusPending},
896877
Target: []string{subscriptions.SubscriptionStatusActive},
897878
Timeout: safetyTimeout,
879+
Delay: 10 * time.Second,
898880
PollInterval: 30 * time.Second,
899881

900882
Refresh: func() (result interface{}, state string, err error) {
@@ -920,6 +902,7 @@ func waitForSubscriptionToBeDeleted(ctx context.Context, id int, api *apiClient)
920902
Pending: []string{subscriptions.SubscriptionStatusDeleting},
921903
Target: []string{"deleted"},
922904
Timeout: safetyTimeout,
905+
Delay: 10 * time.Second,
923906
PollInterval: 30 * time.Second,
924907

925908
Refresh: func() (result interface{}, state string, err error) {
@@ -958,6 +941,7 @@ func waitForDatabaseToBeActive(ctx context.Context, subId, id int, api *apiClien
958941
},
959942
Target: []string{databases.StatusActive},
960943
Timeout: safetyTimeout,
944+
Delay: 10 * time.Second,
961945
PollInterval: 30 * time.Second,
962946

963947
Refresh: func() (result interface{}, state string, err error) {

provider/resource_rediscloud_pro_subscription_test.go

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -222,23 +222,6 @@ func TestAccResourceRedisCloudProSubscription_createUpdateMarketplacePayment(t *
222222
})
223223
}
224224

225-
func TestAccResourceRedisCloudProSubscription_SearchModuleIncompatibleWithOperationsPerSecond(t *testing.T) {
226-
name := acctest.RandomWithPrefix(testResourcePrefix)
227-
testCloudAccountName := os.Getenv("AWS_TEST_CLOUD_ACCOUNT_NAME")
228-
229-
resource.ParallelTest(t, resource.TestCase{
230-
PreCheck: func() { testAccPreCheck(t); testAccAwsPreExistingCloudAccountPreCheck(t) },
231-
ProviderFactories: providerFactories,
232-
CheckDestroy: testAccCheckProSubscriptionDestroy,
233-
Steps: []resource.TestStep{
234-
{
235-
Config: fmt.Sprintf(testAccResourceRedisCloudProSubscriptionWithSearch, testCloudAccountName, name),
236-
ExpectError: regexp.MustCompile("subscription could not be created: throughput may not be measured by `operations-per-second` while the `RediSearch` module is active"),
237-
},
238-
},
239-
})
240-
}
241-
242225
func TestAccResourceRedisCloudProSubscription_RedisVersion(t *testing.T) {
243226
name := acctest.RandomWithPrefix(testResourcePrefix)
244227
testCloudAccountName := os.Getenv("AWS_TEST_CLOUD_ACCOUNT_NAME")
@@ -626,24 +609,6 @@ func TestFlexSubRediSearchThroughputMeasurementWhenReplicationIsTrue(t *testing.
626609
assert.Equal(t, 2, *createDb.ThroughputMeasurement.Value)
627610
}
628611

629-
func TestFlexSubRediSearchIncompatibleWithOperationsPerSec(t *testing.T) {
630-
planMap := map[string]interface{}{
631-
"average_item_size_in_bytes": 0,
632-
"memory_limit_in_gb": float64(1),
633-
"modules": []interface{}{"RediSearch"},
634-
"quantity": 2,
635-
"replication": true,
636-
"support_oss_cluster_api": false,
637-
"throughput_measurement_by": "operations-per-second",
638-
"throughput_measurement_value": 12000,
639-
}
640-
createDbs, diags := buildSubscriptionCreatePlanDatabases(databases.MemoryStorageRam, planMap)
641-
assert.Nil(t, createDbs)
642-
assert.NotEmpty(t, diags)
643-
assert.Len(t, diags, 1, "Error should be reported when using search with throughput_measurement_by=operations-per-second")
644-
assert.Equal(t, diag.Error, diags[0].Severity)
645-
}
646-
647612
func TestFlexSubRedisGraphThroughputMeasurementWhenReplicationIsFalse(t *testing.T) {
648613
planMap := map[string]interface{}{
649614
"average_item_size_in_bytes": 0,
@@ -755,50 +720,6 @@ resource "rediscloud_subscription" "example" {
755720
}
756721
`
757722

758-
const testAccResourceRedisCloudProSubscriptionWithSearch = `
759-
data "rediscloud_payment_method" "card" {
760-
card_type = "Visa"
761-
}
762-
763-
data "rediscloud_cloud_account" "account" {
764-
exclude_internal_account = true
765-
provider_type = "AWS"
766-
name = "%s"
767-
}
768-
769-
resource "rediscloud_subscription" "example" {
770-
771-
name = "%s"
772-
payment_method_id = data.rediscloud_payment_method.card.id
773-
memory_storage = "ram"
774-
775-
allowlist {
776-
cidrs = ["192.168.0.0/16"]
777-
security_group_ids = []
778-
}
779-
780-
cloud_provider {
781-
provider = data.rediscloud_cloud_account.account.provider_type
782-
cloud_account_id = data.rediscloud_cloud_account.account.id
783-
region {
784-
region = "eu-west-1"
785-
networking_deployment_cidr = "10.0.0.0/24"
786-
preferred_availability_zones = ["eu-west-1a"]
787-
}
788-
}
789-
790-
creation_plan {
791-
memory_limit_in_gb = 1
792-
quantity = 1
793-
replication=false
794-
support_oss_cluster_api=false
795-
throughput_measurement_by = "operations-per-second"
796-
throughput_measurement_value = 10000
797-
modules = ["RedisJSON", "RedisBloom", "RediSearch"]
798-
}
799-
}
800-
`
801-
802723
const testAccResourceRedisCloudProSubscriptionWithRedisVersion = `
803724
data "rediscloud_payment_method" "card" {
804725
card_type = "Visa"

0 commit comments

Comments
 (0)