List of usage examples for com.amazonaws.services.ec2.model DeleteInternetGatewayRequest DeleteInternetGatewayRequest
DeleteInternetGatewayRequest
From source file:com.urbancode.terraform.tasks.aws.helpers.AWSHelper.java
License:Apache License
/** * Deletes the given internetGateway. Does not detach the gateway if it is attached. * * @param gatewayId//from w w w. java 2 s . c o m * @param ec2Client */ public void deleteInternetGateway(String gatewayId, AmazonEC2 ec2Client) { try { DeleteInternetGatewayRequest request = new DeleteInternetGatewayRequest() .withInternetGatewayId(gatewayId); ec2Client.deleteInternetGateway(request); } catch (AmazonServiceException e) { log.error("Failed to delete Internet Gateway", e); if (!"InvalidInternetGatewayID.NotFound".equalsIgnoreCase(e.getErrorCode())) { // swallow the exception only if the gateway id was not found throw e; } } }
From source file:com.vmware.photon.controller.model.adapters.awsadapter.AWSNetworkService.java
License:Open Source License
public void deleteInternetGateway(String resourceID, AmazonEC2AsyncClient client) { DeleteInternetGatewayRequest req = new DeleteInternetGatewayRequest().withInternetGatewayId(resourceID); client.deleteInternetGateway(req);//from w ww.j a va2 s. c o m }