Skip to content

Commit a155f92

Browse files
committed
feat: adding redis_version to AA datasources
1 parent 7fa9670 commit a155f92

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

go.mod

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

77
require (
8-
github.com/RedisLabs/rediscloud-go-api v0.33.1
8+
github.com/RedisLabs/rediscloud-go-api v0.34.0
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
@@ -68,3 +68,6 @@ require (
6868
google.golang.org/protobuf v1.36.6 // indirect
6969
gopkg.in/yaml.v3 v3.0.1 // indirect
7070
)
71+
72+
// for local development, uncomment this
73+
//replace github.com/RedisLabs/rediscloud-go-api => ../rediscloud-go-api

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.33.1 h1:sOCGvkvgY4jnH/mMQcA6XO8p1YQ2HfFvtbiblkA1Z/c=
8-
github.com/RedisLabs/rediscloud-go-api v0.33.1/go.mod h1:3/oVb71rv2OstFRYEc65QCIbfwnJTgZeQhtPCcdHook=
7+
github.com/RedisLabs/rediscloud-go-api v0.34.0 h1:TjiABMGCa7SXfwdlqAEj53GX0ipC/b6MOagQc7wIo7g=
8+
github.com/RedisLabs/rediscloud-go-api v0.34.0/go.mod h1:3/oVb71rv2OstFRYEc65QCIbfwnJTgZeQhtPCcdHook=
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=

provider/datasource_rediscloud_active_active_database.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ func dataSourceRedisCloudActiveActiveDatabase() *schema.Resource {
4343
Type: schema.TypeFloat,
4444
Computed: true,
4545
},
46+
"redis_version": {
47+
Description: "The redis version of the database",
48+
Type: schema.TypeString,
49+
Computed: true,
50+
},
4651
"support_oss_cluster_api": {
4752
Description: "Support Redis open-source (OSS) Cluster API",
4853
Type: schema.TypeBool,
@@ -298,6 +303,11 @@ func dataSourceRedisCloudActiveActiveDatabaseRead(ctx context.Context, d *schema
298303
if err := d.Set("dataset_size_in_gb", redis.Float64(*db.CrdbDatabases[0].DatasetSizeInGB)); err != nil {
299304
return diag.FromErr(err)
300305
}
306+
307+
if err := d.Set("redis_version", redis.String(*db.RedisVersion)); err != nil {
308+
return diag.FromErr(err)
309+
}
310+
301311
if err := d.Set("support_oss_cluster_api", redis.BoolValue(db.SupportOSSClusterAPI)); err != nil {
302312
return diag.FromErr(err)
303313
}

provider/rediscloud_active_active_database_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ func TestAccResourceRedisCloudActiveActiveDatabase_CRUDI(t *testing.T) {
161161
// Test datasource
162162
resource.TestCheckResourceAttr(datasourceName, "dataset_size_in_gb", "1"),
163163
resource.TestCheckResourceAttr(datasourceName, "support_oss_cluster_api", "true"),
164+
resource.TestCheckResourceAttr(datasourceName, "redis_version", "7.4"),
164165
resource.TestCheckResourceAttr(datasourceName, "external_endpoint_for_oss_cluster_api", "true"),
165166
),
166167
},
@@ -327,8 +328,8 @@ resource "rediscloud_active_active_subscription_database" "example" {
327328
"priority" = "code-2"
328329
}
329330
330-
}
331-
//
331+
}
332+
332333
data "rediscloud_active_active_subscription_database" "example" {
333334
subscription_id = rediscloud_active_active_subscription.example.id
334335
name = rediscloud_active_active_subscription_database.example.name

0 commit comments

Comments
 (0)