/** * Creates the VPC and returns the VPC id */ public String createVPC(String subnetCidr) { CreateVpcRequest req = new CreateVpcRequest().withCidrBlock(subnetCidr); CreateVpcResult vpc = this.client.createVpc(req); return vpc.getVpc().getVpcId(); }
@Override public Vpc createVpc(CreateVpcRequest request, ResultCapture<CreateVpcResult> extractor) { ActionResult result = service.performAction("CreateVpc", request, extractor); if (result == null) return null; return new VpcImpl(result.getResource()); }
@Override public Vpc createVpc(String cidrBlock, ResultCapture<CreateVpcResult> extractor) { CreateVpcRequest request = new CreateVpcRequest() .withCidrBlock(cidrBlock); return createVpc(request, extractor); }
/** * Create VPC. * * @param cidrBlock the cidr block * @param instanceTenancy the instance tenancy * @return New vpc */ protected final Vpc createVpc(final String cidrBlock, final String instanceTenancy) { CreateVpcRequest req = new CreateVpcRequest(); req.setCidrBlock(cidrBlock); req.setInstanceTenancy(instanceTenancy); CreateVpcResult result = amazonEC2Client.createVpc(req); return result.getVpc(); }
@Override public CreateVpcResult createVpc(CreateVpcRequest createVpcRequest) throws AmazonServiceException, AmazonClientException { throw new UnsupportedOperationException("Not supported in mock"); }
@Override public Vpc createVpc(String cidrBlock) { return createVpc(cidrBlock, (ResultCapture<CreateVpcResult>)null); }
/** * Performs the <code>CreateVpc</code> action and use a ResultCapture to * retrieve the low-level client response. * * <p> * * @return The <code>Vpc</code> resource object associated with the result * of this action. * @see CreateVpcRequest */ com.amazonaws.resources.ec2.Vpc createVpc(CreateVpcRequest request, ResultCapture<CreateVpcResult> extractor);
/** * The convenient method form for the <code>CreateVpc</code> action. * * @see #createVpc(CreateVpcRequest, ResultCapture) */ com.amazonaws.resources.ec2.Vpc createVpc(String cidrBlock, ResultCapture<CreateVpcResult> extractor);