Skip to content

Commit 087f7b4

Browse files
Add persistence_iam_identity to Redis Instance (#3805) (#2323)
Signed-off-by: Modular Magician <[email protected]>
1 parent 9c03ed8 commit 087f7b4

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

.changelog/3805.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```release-note:enhancement
2+
redis: added `persistence_iam_identity` output field to `google_redis_instance`
3+
```
4+
```release-note:note
5+
redis: explicitly noted in `google_redis_instance` documentation that `"REDIS_5_0"` is supported
6+
```

google-beta/resource_redis_instance.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locat
122122
Description: `The version of Redis software. If not provided, latest supported
123123
version will be used. Currently, the supported values are:
124124
125+
- REDIS_5_0 for Redis 5.0 compatibility
125126
- REDIS_4_0 for Redis 4.0 compatibility
126127
- REDIS_3_2 for Redis 3.2 compatibility`,
127128
},
@@ -174,6 +175,14 @@ and can change after a failover event.`,
174175
Computed: true,
175176
Description: `Hostname or IP address of the exposed Redis endpoint used by clients
176177
to connect to the service.`,
178+
},
179+
"persistence_iam_identity": {
180+
Type: schema.TypeString,
181+
Computed: true,
182+
Description: `Output only. Cloud IAM identity used by import / export operations
183+
to transfer data to/from Cloud Storage. Format is "serviceAccount:".
184+
The value may change over time for a given instance so should be
185+
checked before each import/export operation.`,
177186
},
178187
"port": {
179188
Type: schema.TypeInt,
@@ -390,6 +399,9 @@ func resourceRedisInstanceRead(d *schema.ResourceData, meta interface{}) error {
390399
if err := d.Set("port", flattenRedisInstancePort(res["port"], d, config)); err != nil {
391400
return fmt.Errorf("Error reading Instance: %s", err)
392401
}
402+
if err := d.Set("persistence_iam_identity", flattenRedisInstancePersistenceIamIdentity(res["persistenceIamIdentity"], d, config)); err != nil {
403+
return fmt.Errorf("Error reading Instance: %s", err)
404+
}
393405
if err := d.Set("redis_version", flattenRedisInstanceRedisVersion(res["redisVersion"], d, config)); err != nil {
394406
return fmt.Errorf("Error reading Instance: %s", err)
395407
}
@@ -623,6 +635,10 @@ func flattenRedisInstancePort(v interface{}, d *schema.ResourceData, config *Con
623635
return v // let terraform core handle it otherwise
624636
}
625637

638+
func flattenRedisInstancePersistenceIamIdentity(v interface{}, d *schema.ResourceData, config *Config) interface{} {
639+
return v
640+
}
641+
626642
func flattenRedisInstanceRedisVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} {
627643
return v
628644
}

google-beta/resource_redis_instance_generated_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ resource "google_redis_instance" "cache" {
9595
9696
authorized_network = data.google_compute_network.redis-network.id
9797
98-
redis_version = "REDIS_3_2"
98+
redis_version = "REDIS_4_0"
9999
display_name = "Terraform Test Instance"
100100
reserved_ip_range = "192.168.0.0/29"
101101
@@ -175,10 +175,10 @@ resource "google_redis_instance" "cache" {
175175
authorized_network = google_compute_network.network.id
176176
connect_mode = "PRIVATE_SERVICE_ACCESS"
177177
178-
redis_version = "REDIS_3_2"
178+
redis_version = "REDIS_4_0"
179179
display_name = "Terraform Test Instance"
180180
181-
depends_on = [ google_service_networking_connection.private_service_connection ]
181+
depends_on = [google_service_networking_connection.private_service_connection]
182182
183183
}
184184
`, context)

website/docs/r/redis_instance.html.markdown

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ resource "google_redis_instance" "cache" {
6464
6565
authorized_network = data.google_compute_network.redis-network.id
6666
67-
redis_version = "REDIS_3_2"
67+
redis_version = "REDIS_4_0"
6868
display_name = "Terraform Test Instance"
6969
reserved_ip_range = "192.168.0.0/29"
7070
@@ -124,10 +124,10 @@ resource "google_redis_instance" "cache" {
124124
authorized_network = google_compute_network.network.id
125125
connect_mode = "PRIVATE_SERVICE_ACCESS"
126126
127-
redis_version = "REDIS_3_2"
127+
redis_version = "REDIS_4_0"
128128
display_name = "Terraform Test Instance"
129129
130-
depends_on = [ google_service_networking_connection.private_service_connection ]
130+
depends_on = [google_service_networking_connection.private_service_connection]
131131
132132
}
133133
```
@@ -198,6 +198,7 @@ The following arguments are supported:
198198
(Optional)
199199
The version of Redis software. If not provided, latest supported
200200
version will be used. Currently, the supported values are:
201+
- REDIS_5_0 for Redis 5.0 compatibility
201202
- REDIS_4_0 for Redis 4.0 compatibility
202203
- REDIS_3_2 for Redis 3.2 compatibility
203204

@@ -253,6 +254,12 @@ In addition to the arguments listed above, the following computed attributes are
253254
* `port` -
254255
The port number of the exposed Redis endpoint.
255256

257+
* `persistence_iam_identity` -
258+
Output only. Cloud IAM identity used by import / export operations
259+
to transfer data to/from Cloud Storage. Format is "serviceAccount:".
260+
The value may change over time for a given instance so should be
261+
checked before each import/export operation.
262+
256263

257264
## Timeouts
258265

0 commit comments

Comments
 (0)