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

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

Introduction

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

Prototype

public DeleteVpcRequest() 

Source Link

Document

Default constructor for DeleteVpcRequest object.

Usage

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);
}