List of usage examples for com.amazonaws.services.ec2 AmazonEC2 deleteRoute
DeleteRouteResult deleteRoute(DeleteRouteRequest deleteRouteRequest);
Deletes the specified route from the specified route table.
From source file:com.urbancode.terraform.tasks.aws.helpers.AWSHelper.java
License:Apache License
/** * Deletes the route corresponding to the given info * * @param routeTableId//from w ww . j a v a2 s . c o m * @param destCidr * @param ec2Client */ public void deleteRoute(String routeTableId, String destCidr, AmazonEC2 ec2Client) { try { DeleteRouteRequest request = new DeleteRouteRequest().withDestinationCidrBlock(destCidr) .withRouteTableId(routeTableId); ec2Client.deleteRoute(request); } catch (AmazonServiceException e) { log.error("Failed to delete Route: " + "\n\tRouteTableId: " + routeTableId + "\n\tDestination CIDR: " + destCidr, e); if (!"InvalidRouteTableID.NotFound".equals(e.getErrorCode())) { throw e; } } }