From 422899f352273d7e1adc5412a2e3d3860465a9fa Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Mon, 3 Aug 2020 17:08:50 +0000 Subject: [PATCH] Add persistence_iam_identity to Redis Instance (#3805) Signed-off-by: Modular Magician --- .changelog/3805.txt | 6 ++++++ google-beta/resource_redis_instance.go | 16 ++++++++++++++++ .../resource_redis_instance_generated_test.go | 6 +++--- website/docs/r/redis_instance.html.markdown | 13 ++++++++++--- 4 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 .changelog/3805.txt diff --git a/.changelog/3805.txt b/.changelog/3805.txt new file mode 100644 index 0000000000..527cd4874b --- /dev/null +++ b/.changelog/3805.txt @@ -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 +``` diff --git a/google-beta/resource_redis_instance.go b/google-beta/resource_redis_instance.go index 45e4264810..6b6839cb51 100644 --- a/google-beta/resource_redis_instance.go +++ b/google-beta/resource_redis_instance.go @@ -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`, }, @@ -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, @@ -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) } @@ -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 } diff --git a/google-beta/resource_redis_instance_generated_test.go b/google-beta/resource_redis_instance_generated_test.go index 7cc45bb357..aebf50d283 100644 --- a/google-beta/resource_redis_instance_generated_test.go +++ b/google-beta/resource_redis_instance_generated_test.go @@ -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" @@ -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) diff --git a/website/docs/r/redis_instance.html.markdown b/website/docs/r/redis_instance.html.markdown index 8feb142b14..472f70f490 100644 --- a/website/docs/r/redis_instance.html.markdown +++ b/website/docs/r/redis_instance.html.markdown @@ -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" @@ -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] } ``` @@ -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 @@ -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