Example usage for com.amazonaws.services.ec2 AmazonEC2AsyncClient createVpc

List of usage examples for com.amazonaws.services.ec2 AmazonEC2AsyncClient createVpc

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2 AmazonEC2AsyncClient createVpc.

Prototype

CreateVpcResult createVpc(CreateVpcRequest createVpcRequest);

Source Link

Document

Creates a VPC with the specified IPv4 CIDR block.

Usage

From source file:com.vmware.photon.controller.model.adapters.awsadapter.AWSNetworkService.java

License:Open Source License

public String createVPC(String subnet, AmazonEC2AsyncClient client) {
    CreateVpcRequest req = new CreateVpcRequest().withCidrBlock(subnet);
    CreateVpcResult vpc = client.createVpc(req);

    return vpc.getVpc().getVpcId();
}