Skip to content

Commit 0995775

Browse files
Removed securitycenterv2 organizationsource set_computed_name post_create (#13645) (#22311)
[upstream:73cdd445647eaadf108aa38ae3bc7e7afacaad02] Signed-off-by: Modular Magician <[email protected]>
1 parent a878f0c commit 0995775

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

google/services/securitycenterv2/resource_scc_v2_organization_source.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,24 +148,6 @@ func resourceSecurityCenterV2OrganizationSourceCreate(d *schema.ResourceData, me
148148
}
149149
d.SetId(id)
150150

151-
// `name` is autogenerated from the api so needs to be set post-create
152-
name, ok := res["name"]
153-
if !ok {
154-
respBody, ok := res["response"]
155-
if !ok {
156-
return fmt.Errorf("Create response didn't contain critical fields. Create may not have succeeded.")
157-
}
158-
159-
name, ok = respBody.(map[string]interface{})["name"]
160-
if !ok {
161-
return fmt.Errorf("Create response didn't contain critical fields. Create may not have succeeded.")
162-
}
163-
}
164-
if err := d.Set("name", name.(string)); err != nil {
165-
return fmt.Errorf("Error setting name: %s", err)
166-
}
167-
d.SetId(name.(string))
168-
169151
log.Printf("[DEBUG] Finished creating OrganizationSource %q: %#v", d.Id(), res)
170152

171153
return resourceSecurityCenterV2OrganizationSourceRead(d, meta)

0 commit comments

Comments
 (0)