From 40bd46d0451ef5ce274efc4c5a3f618fd43a22da Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 25 Aug 2020 08:45:01 -0700 Subject: [PATCH] fixed data_source_secret_manager_secret_version on its id (#3904) (#7098) Co-authored-by: Edward Sun Signed-off-by: Modular Magician Co-authored-by: Edward Sun --- .changelog/3904.txt | 3 +++ google/data_source_secret_manager_secret_version.go | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .changelog/3904.txt diff --git a/.changelog/3904.txt b/.changelog/3904.txt new file mode 100644 index 00000000000..0b09b50c630 --- /dev/null +++ b/.changelog/3904.txt @@ -0,0 +1,3 @@ +```release-note:bug +fixed data_source_secret_manager_secret_version on its id value +``` diff --git a/google/data_source_secret_manager_secret_version.go b/google/data_source_secret_manager_secret_version.go index 2cad1eba93f..1ea11a44e39 100644 --- a/google/data_source_secret_manager_secret_version.go +++ b/google/data_source_secret_manager_secret_version.go @@ -5,7 +5,6 @@ import ( "fmt" "log" "regexp" - "time" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -121,6 +120,6 @@ func dataSourceSecretManagerSecretVersionRead(d *schema.ResourceData, meta inter } d.Set("secret_data", string(secretData)) - d.SetId(time.Now().UTC().String()) + d.SetId(version["name"].(string)) return nil }