Skip to content

Commit

Permalink
fixed writing to state (#5186)
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardmedia authored Sep 15, 2021
1 parent 3abe7e7 commit 04905c2
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ func resourceGoogleOrganizationPolicy() *schema.Resource {
}

func resourceGoogleOrganizationPolicyCreate(d *schema.ResourceData, meta interface{}) error {
d.SetId(fmt.Sprintf("%s/%s", d.Get("org_id"), d.Get("constraint").(string)))

if isOrganizationPolicyUnset(d) {
return resourceGoogleOrganizationPolicyDelete(d, meta)
}
Expand All @@ -184,6 +182,7 @@ func resourceGoogleOrganizationPolicyCreate(d *schema.ResourceData, meta interfa
return err
}

d.SetId(fmt.Sprintf("%s/%s", d.Get("org_id"), d.Get("constraint").(string)))
return resourceGoogleOrganizationPolicyRead(d, meta)
}

Expand Down

0 comments on commit 04905c2

Please sign in to comment.