From 625cb94124ef53624d6ab47e485dcd7d7e828432 Mon Sep 17 00:00:00 2001 From: Scott Winkler Date: Tue, 16 Apr 2024 17:06:58 -0700 Subject: [PATCH] read after create --- pkg/resources/account.go | 2 +- pkg/resources/account_password_policy_attachment.go | 2 +- pkg/resources/failover_group.go | 2 +- pkg/resources/object_parameter.go | 2 +- pkg/resources/resource_monitor.go | 5 +---- pkg/resources/role.go | 2 +- pkg/resources/table_column_masking_policy_application.go | 2 +- 7 files changed, 7 insertions(+), 10 deletions(-) diff --git a/pkg/resources/account.go b/pkg/resources/account.go index b4ee7cb16d..d17a220b35 100644 --- a/pkg/resources/account.go +++ b/pkg/resources/account.go @@ -304,7 +304,7 @@ func CreateAccount(d *schema.ResourceData, meta interface{}) error { } d.SetId(helpers.EncodeSnowflakeID(account.AccountLocator)) - return nil + return ReadAccount(d, meta) } // ReadAccount implements schema.ReadFunc. diff --git a/pkg/resources/account_password_policy_attachment.go b/pkg/resources/account_password_policy_attachment.go index cfea0891b5..f06718bbdd 100644 --- a/pkg/resources/account_password_policy_attachment.go +++ b/pkg/resources/account_password_policy_attachment.go @@ -58,7 +58,7 @@ func CreateAccountPasswordPolicyAttachment(d *schema.ResourceData, meta interfac d.SetId(helpers.EncodeSnowflakeID(passwordPolicy)) - return nil + return ReadAccountPasswordPolicyAttachment(d, meta) } func ReadAccountPasswordPolicyAttachment(d *schema.ResourceData, meta interface{}) error { diff --git a/pkg/resources/failover_group.go b/pkg/resources/failover_group.go index 792f0b7167..be045fdb1a 100644 --- a/pkg/resources/failover_group.go +++ b/pkg/resources/failover_group.go @@ -259,7 +259,7 @@ func CreateFailoverGroup(d *schema.ResourceData, meta interface{}) error { } d.SetId(name) - return nil + return ReadFailoverGroup(d, meta) } // ReadFailoverGroup implements schema.ReadFunc. diff --git a/pkg/resources/object_parameter.go b/pkg/resources/object_parameter.go index d7b767cd2f..f4870dcd43 100644 --- a/pkg/resources/object_parameter.go +++ b/pkg/resources/object_parameter.go @@ -134,7 +134,7 @@ func CreateObjectParameter(d *schema.ResourceData, meta interface{}) error { if err != nil { return err } - return nil + return ReadObjectParameter(d, meta) } // ReadObjectParameter implements schema.ReadFunc. diff --git a/pkg/resources/resource_monitor.go b/pkg/resources/resource_monitor.go index 072a62f166..8e33f43710 100644 --- a/pkg/resources/resource_monitor.go +++ b/pkg/resources/resource_monitor.go @@ -223,10 +223,7 @@ func CreateResourceMonitor(d *schema.ResourceData, meta interface{}) error { } } - if err := ReadResourceMonitor(d, meta); err != nil { - return err - } - return nil + return ReadResourceMonitor(d, meta) } // ReadResourceMonitor implements schema.ReadFunc. diff --git a/pkg/resources/role.go b/pkg/resources/role.go index 856b6806ac..2e58d97abd 100644 --- a/pkg/resources/role.go +++ b/pkg/resources/role.go @@ -217,7 +217,7 @@ func UpdateAccountRole(ctx context.Context, d *schema.ResourceData, meta any) di d.SetId(helpers.EncodeSnowflakeID(newId)) } - return nil + return ReadAccountRole(ctx, d, meta) } func DeleteAccountRole(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { diff --git a/pkg/resources/table_column_masking_policy_application.go b/pkg/resources/table_column_masking_policy_application.go index dc46112c97..71b722f2ad 100644 --- a/pkg/resources/table_column_masking_policy_application.go +++ b/pkg/resources/table_column_masking_policy_application.go @@ -67,7 +67,7 @@ func CreateTableColumnMaskingPolicyApplication(d *schema.ResourceData, meta inte d.SetId(TableColumnMaskingPolicyApplicationID(&input.TableColumnMaskingPolicyApplication)) - return nil + return ReadTableColumnMaskingPolicyApplication(d, meta) } // ReadTableColumnMaskingPolicyApplication implements schema.ReadFunc.