List of usage examples for com.amazonaws.services.ec2 AmazonEC2 deleteSubnet
DeleteSubnetResult deleteSubnet(DeleteSubnetRequest deleteSubnetRequest);
Deletes the specified subnet.
From source file:com.urbancode.terraform.tasks.aws.helpers.AWSHelper.java
License:Apache License
/** * * @param subnetId// w ww . j ava2 s . c o m * @param ec2Client */ public void deleteSubnet(String subnetId, AmazonEC2 ec2Client) { try { log.info("Deleting Subnet (" + subnetId + ")"); DeleteSubnetRequest request = new DeleteSubnetRequest().withSubnetId(subnetId); ec2Client.deleteSubnet(request); } catch (AmazonServiceException e) { log.error("Failed to delete Subnet", e); if (!"InvalidSubnetId.NotFound".equals(e.getErrorCode())) { throw e; } } }