Example usage for com.amazonaws.services.ec2.model DisassociateRouteTableRequest DisassociateRouteTableRequest

List of usage examples for com.amazonaws.services.ec2.model DisassociateRouteTableRequest DisassociateRouteTableRequest

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model DisassociateRouteTableRequest DisassociateRouteTableRequest.

Prototype

DisassociateRouteTableRequest

Source Link

Usage

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

License:Apache License

/**
 *
 * @param associationId//  w w  w  . j av a  2 s .c o m
 * @param ec2Client
 */
public void disassociateRouteTableFromSubnet(String associationId, AmazonEC2 ec2Client) {
    try {
        DisassociateRouteTableRequest request = new DisassociateRouteTableRequest()
                .withAssociationId(associationId);
        ec2Client.disassociateRouteTable(request);
    } catch (AmazonServiceException e) {
        log.error("Failed to disassociate Route Table from Subnet", e);
        if (!"InvalidAssociationID.NotFound".equalsIgnoreCase(e.getErrorCode())) {
            throw e;
        }
    }
}