Skip to content

Commit

Permalink
Only attempt to update the default outbound route if it already exist…
Browse files Browse the repository at this point in the history
…s; if not, go ahead and create it (#1459)
  • Loading branch information
bbbco authored Jan 14, 2025
1 parent 0410c86 commit de4afac
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,10 @@ func createSiteOutboundRoute(ctx context.Context, d *schema.ResourceData, meta i
// so instead of trying to create a new outbound route, we will just update the existing one
if *site.MediaModel == "Cloud" {
siteId, outboundRouteId, _, _, err := proxy.getSiteOutboundRouteByName(ctx, siteId, "Default Outbound Route")
if err != nil {
return util.BuildAPIDiagnosticError(ResourceType, fmt.Sprintf("failed to get outbound route %s for site %s: %s", outboundRouteName, siteId, err), nil)
if siteId != "" && outboundRouteId != "" && err == nil {
d.SetId(buildSiteAndOutboundRouteId(siteId, outboundRouteId))
return updateSiteOutboundRoute(ctx, d, meta)
}
d.SetId(buildSiteAndOutboundRouteId(siteId, outboundRouteId))
return updateSiteOutboundRoute(ctx, d, meta)
}
}
}
Expand Down

0 comments on commit de4afac

Please sign in to comment.