From 0ee7394378523b18dd490fee395b3b8808b3a62d Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Thu, 19 Aug 2021 20:53:45 +0000 Subject: [PATCH] fixed a BUILT_IN (#5095) * fixed a BUILT_IN * add import errors Signed-off-by: Modular Magician --- .changelog/5095.txt | 3 +++ google/resource_sql_user.go | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .changelog/5095.txt diff --git a/.changelog/5095.txt b/.changelog/5095.txt new file mode 100644 index 00000000000..02da7ac009a --- /dev/null +++ b/.changelog/5095.txt @@ -0,0 +1,3 @@ +```release-note:bug +sql: fixed a permadiff bug for `type` when BUILT_IN on `google_sql_user` +``` diff --git a/google/resource_sql_user.go b/google/resource_sql_user.go index 17659f10376..dfeb747c952 100644 --- a/google/resource_sql_user.go +++ b/google/resource_sql_user.go @@ -75,9 +75,10 @@ func resourceSqlUser() *schema.Resource { }, "type": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + DiffSuppressFunc: emptyOrDefaultStringSuppress("BUILT_IN"), Description: `The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. Flags include "BUILT_IN", "CLOUD_IAM_USER", or "CLOUD_IAM_SERVICE_ACCOUNT".`, ValidateFunc: validation.StringInSlice([]string{"BUILT_IN", "CLOUD_IAM_USER", "CLOUD_IAM_SERVICE_ACCOUNT", ""}, false),