Skip to content

Commit

Permalink
dropped checking for hvn route existance
Browse files Browse the repository at this point in the history
  • Loading branch information
smaant committed May 20, 2021
1 parent 0c9c24e commit 67c3270
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions internal/provider/resource_hvn_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,6 @@ func resourceHvnRouteCreate(ctx context.Context, d *schema.ResourceData, meta in

log.Printf("[INFO] HVN (%s) found, proceeding with HVN route create", hvnLink.ID)

// Check if HVN route already exists.
_, err = clients.ListHVNRoutes(ctx, client, hvnLink.ID, destination, "", "", loc)
if err != nil {
if !clients.IsResponseCodeNotFound(err) {
return diag.Errorf("unable to check for presence of an existing route for HVN (%s) with the destination CIDR of %s: %v", hvnLink.ID, destination, err)
}

return diag.Errorf("an HVN route with destination=%s, hvn_id=%s and project_id=%s already exists - to be managed via Terraform this resource needs to be imported into the state. Please see the resource documentation for hcp_hvn_route for more information", destination, hvnLink.ID, loc.ProjectID)
} else {
log.Printf("[INFO] HVN route with destination CIDR of %s for HVN (%s) not found, proceeding with HVN route create", destination, hvnLink.ID)
}

targetLink.Location.Region = retrievedHvn.Location.Region

// Create HVN route
Expand Down

0 comments on commit 67c3270

Please sign in to comment.