List of usage examples for com.amazonaws.services.ec2.model DeleteVpcRequest DeleteVpcRequest
public DeleteVpcRequest()
From source file:com.urbancode.terraform.tasks.aws.helpers.AWSHelper.java
License:Apache License
/** * * @param vpcId// ww w. j ava2s . c o m * @param ec2Client */ public void deleteVpc(String vpcId, AmazonEC2 ec2Client) { try { log.info("Deleting Vpc (" + vpcId + ")"); DeleteVpcRequest request = new DeleteVpcRequest().withVpcId(vpcId); ec2Client.deleteVpc(request); } catch (AmazonServiceException e) { log.error("Failed to delete Vpc", e); if (!"InvalidVpcID.NotFound".equalsIgnoreCase(e.getErrorCode())) { throw e; } } }
From source file:com.vmware.photon.controller.model.adapters.awsadapter.AWSNetworkService.java
License:Open Source License
public void deleteVPC(String vpcID, AmazonEC2AsyncClient client) { DeleteVpcRequest req = new DeleteVpcRequest().withVpcId(vpcID); client.deleteVpc(req); }