Skip to content

Commit

Permalink
fix import error for orgpolicy (GoogleCloudPlatform#8291)
Browse files Browse the repository at this point in the history
Co-authored-by: Edward Sun <sunedward@google.com>
  • Loading branch information
2 people authored and hao-nan-li committed Jul 27, 2023
1 parent e46c3fd commit bcf53a6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tpgtools/handwritten/orgpolicy_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ func ResourceOrgPolicyPolicyCustomImport(d *schema.ResourceData, meta interface{
if err != nil {
return fmt.Errorf("Error constructing id: %s", err)
}

// reset name to match the one from resourceOrgPolicyPolicyRead
if err := d.Set("name", id); err != nil {
return fmt.Errorf("Error setting name: %s", err)
}
d.SetId(id)

return nil
Expand Down

0 comments on commit bcf53a6

Please sign in to comment.