Skip to content

Commit

Permalink
fix: read after create (#2718)
Browse files Browse the repository at this point in the history
SNOW-1003311 
Fixes: Not invoking Read after Create/Update (e.g.
[#2252](https://github.com/Snowflake-Labs/terraform-provider-snowflake/pull/2252/files#diff-840246f685e775bcf2dee809f30f112848676899dd47e5ef076598dd9e8536b3L220))

## Test Plan
<!-- detail ways in which this PR has been tested or needs to be tested
-->
* [ ] acceptance tests
<!-- add more below if you think they are relevant -->
* [ ] …
  • Loading branch information
sfc-gh-swinkler authored Apr 22, 2024
1 parent 6974e25 commit 2e9b68f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/resources/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/account_password_policy_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/failover_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/object_parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 1 addition & 4 deletions pkg/resources/resource_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/table_column_masking_policy_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2e9b68f

Please sign in to comment.