Example usage for com.amazonaws.services.ec2 AmazonEC2 deleteRouteTable

List of usage examples for com.amazonaws.services.ec2 AmazonEC2 deleteRouteTable

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2 AmazonEC2 deleteRouteTable.

Prototype

DeleteRouteTableResult deleteRouteTable(DeleteRouteTableRequest deleteRouteTableRequest);

Source Link

Document

Deletes the specified route table.

Usage

From source file:com.urbancode.terraform.tasks.aws.helpers.AWSHelper.java

License:Apache License

/**
 *
 * @param routeTableId//from www.ja  va  2  s  .com
 * @param ec2Client
 */
public void deleteRouteTable(String routeTableId, AmazonEC2 ec2Client) {
    try {
        DeleteRouteTableRequest request = new DeleteRouteTableRequest().withRouteTableId(routeTableId);
        ec2Client.deleteRouteTable(request);
    } catch (AmazonServiceException e) {
        log.error("Failed to delete subnet", e);
        if (!"InvalidSubnetID.NotFound".equals(e.getErrorCode())
                && !"InvalidRouteTableID.NotFound".equals(e.getErrorCode())) {
            // swallow the exception if the subnet id was not found
            throw e;
        }
    }
}