Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add persistence_iam_identity to Redis Instance #2323

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .changelog/3805.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:enhancement
redis: added `persistence_iam_identity` output field to `google_redis_instance`
```
```release-note:note
redis: explicitly noted in `google_redis_instance` documentation that `"REDIS_5_0"` is supported
```
16 changes: 16 additions & 0 deletions google-beta/resource_redis_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locat
Description: `The version of Redis software. If not provided, latest supported
version will be used. Currently, the supported values are:

- REDIS_5_0 for Redis 5.0 compatibility
- REDIS_4_0 for Redis 4.0 compatibility
- REDIS_3_2 for Redis 3.2 compatibility`,
},
Expand Down Expand Up @@ -174,6 +175,14 @@ and can change after a failover event.`,
Computed: true,
Description: `Hostname or IP address of the exposed Redis endpoint used by clients
to connect to the service.`,
},
"persistence_iam_identity": {
Type: schema.TypeString,
Computed: true,
Description: `Output only. Cloud IAM identity used by import / export operations
to transfer data to/from Cloud Storage. Format is "serviceAccount:".
The value may change over time for a given instance so should be
checked before each import/export operation.`,
},
"port": {
Type: schema.TypeInt,
Expand Down Expand Up @@ -390,6 +399,9 @@ func resourceRedisInstanceRead(d *schema.ResourceData, meta interface{}) error {
if err := d.Set("port", flattenRedisInstancePort(res["port"], d, config)); err != nil {
return fmt.Errorf("Error reading Instance: %s", err)
}
if err := d.Set("persistence_iam_identity", flattenRedisInstancePersistenceIamIdentity(res["persistenceIamIdentity"], d, config)); err != nil {
return fmt.Errorf("Error reading Instance: %s", err)
}
if err := d.Set("redis_version", flattenRedisInstanceRedisVersion(res["redisVersion"], d, config)); err != nil {
return fmt.Errorf("Error reading Instance: %s", err)
}
Expand Down Expand Up @@ -623,6 +635,10 @@ func flattenRedisInstancePort(v interface{}, d *schema.ResourceData, config *Con
return v // let terraform core handle it otherwise
}

func flattenRedisInstancePersistenceIamIdentity(v interface{}, d *schema.ResourceData, config *Config) interface{} {
return v
}

func flattenRedisInstanceRedisVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} {
return v
}
Expand Down
6 changes: 3 additions & 3 deletions google-beta/resource_redis_instance_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ resource "google_redis_instance" "cache" {

authorized_network = data.google_compute_network.redis-network.id

redis_version = "REDIS_3_2"
redis_version = "REDIS_4_0"
display_name = "Terraform Test Instance"
reserved_ip_range = "192.168.0.0/29"

Expand Down Expand Up @@ -175,10 +175,10 @@ resource "google_redis_instance" "cache" {
authorized_network = google_compute_network.network.id
connect_mode = "PRIVATE_SERVICE_ACCESS"

redis_version = "REDIS_3_2"
redis_version = "REDIS_4_0"
display_name = "Terraform Test Instance"

depends_on = [ google_service_networking_connection.private_service_connection ]
depends_on = [google_service_networking_connection.private_service_connection]

}
`, context)
Expand Down
13 changes: 10 additions & 3 deletions website/docs/r/redis_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ resource "google_redis_instance" "cache" {

authorized_network = data.google_compute_network.redis-network.id

redis_version = "REDIS_3_2"
redis_version = "REDIS_4_0"
display_name = "Terraform Test Instance"
reserved_ip_range = "192.168.0.0/29"

Expand Down Expand Up @@ -124,10 +124,10 @@ resource "google_redis_instance" "cache" {
authorized_network = google_compute_network.network.id
connect_mode = "PRIVATE_SERVICE_ACCESS"

redis_version = "REDIS_3_2"
redis_version = "REDIS_4_0"
display_name = "Terraform Test Instance"

depends_on = [ google_service_networking_connection.private_service_connection ]
depends_on = [google_service_networking_connection.private_service_connection]

}
```
Expand Down Expand Up @@ -198,6 +198,7 @@ The following arguments are supported:
(Optional)
The version of Redis software. If not provided, latest supported
version will be used. Currently, the supported values are:
- REDIS_5_0 for Redis 5.0 compatibility
- REDIS_4_0 for Redis 4.0 compatibility
- REDIS_3_2 for Redis 3.2 compatibility

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

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


## Timeouts

Expand Down