@Override public void execute(Context context) throws Exception { String vpcId = resource.remoteVPC.getVpcId(); logger.info("delete vpc, vpcId={}", vpcId); AWS.vpc.ec2.deleteVpc(new DeleteVpcRequest(vpcId)); context.output("vpc/" + resource.id, "deletedVPCId=" + vpcId); }
/** * delete VPC. * * @param vpcId the vpc id * @return true if delete. */ protected final boolean deleteVpc(final String vpcId) { DeleteVpcRequest req = new DeleteVpcRequest(); req.setVpcId(vpcId); DeleteVpcResult result = amazonEC2Client.deleteVpc(req); if (result != null) { return true; } return false; }
@Override public void deleteVpc(DeleteVpcRequest deleteVpcRequest) throws AmazonServiceException, AmazonClientException { throw new UnsupportedOperationException("Not supported in mock"); }
/** * Delete the specified VPC */ public void deleteVPC(String vpcId) { DeleteVpcRequest req = new DeleteVpcRequest().withVpcId(vpcId); this.client.deleteVpc(req); }
/** * Delete a VPC */ public static void deleteVPC(AmazonEC2AsyncClient client, String vpcId) { client.deleteVpc(new DeleteVpcRequest().withVpcId(vpcId)); }
@Override public void delete(DeleteVpcRequest request) { delete(request, null); }
@Override public void delete(DeleteVpcRequest request, ResultCapture<Void> extractor) { resource.performAction("Delete", request, extractor); }
@Override public void delete(ResultCapture<Void> extractor) { DeleteVpcRequest request = new DeleteVpcRequest(); delete(request, extractor); }
/** * Performs the <code>Delete</code> action. * * <p> * The following request parameters will be populated from the data of this * <code>Vpc</code> resource, and any conflicting parameter value set in the * request will be overridden: * <ul> * <li> * <b><code>VpcId</code></b> * - mapped from the <code>Id</code> identifier. * </li> * </ul> * * <p> * * @see DeleteVpcRequest */ void delete(DeleteVpcRequest request);
/** * Performs the <code>Delete</code> action and use a ResultCapture to * retrieve the low-level client response. * * <p> * The following request parameters will be populated from the data of this * <code>Vpc</code> resource, and any conflicting parameter value set in the * request will be overridden: * <ul> * <li> * <b><code>VpcId</code></b> * - mapped from the <code>Id</code> identifier. * </li> * </ul> * * <p> * * @see DeleteVpcRequest */ void delete(DeleteVpcRequest request, ResultCapture<Void> extractor);