Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: ziyeqf <51212351+ziyeqf@users.noreply.github.com>
  • Loading branch information
ziyeqf committed Sep 20, 2023
1 parent 84e066a commit 09ff91a
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions internal/services/loganalytics/log_analytics_solution_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,23 @@ func resourceLogAnalyticsSolutionCreateUpdate(d *pluginsdk.ResourceData, meta in
Tags: expandTags(d.Get("tags").(map[string]interface{})),
}

err = client.CreateOrUpdateThenPoll(ctx, id, parameters)
if err != nil {
return fmt.Errorf("creating/updating %s: %+v", id, err)
}
if d.IsNewResource() {
err = client.CreateOrUpdateThenPoll(ctx, id, parameters)
if err != nil {
return fmt.Errorf("creating %s: %+v", id, err)
}

d.SetId(id.ID())
d.SetId(id.ID())
} else {
patch := solution.SolutionPatch{
Tags: expandTags(d.Get("tags").(map[string]interface{})),
}

err = client.UpdateThenPoll(ctx, id, patch)
if err != nil {
return fmt.Errorf("updating %s: %+v", id, err)
}
}

return resourceLogAnalyticsSolutionRead(d, meta)
}
Expand Down

0 comments on commit 09ff91a

Please sign in to comment.