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

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

Introduction

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

Prototype

public CreateVpcRequest() 

Source Link

Document

Default constructor for CreateVpcRequest object.

Usage

From source file:com.urbancode.terraform.tasks.aws.helpers.AWSHelper.java

License:Apache License

/**
 *
 * @param cidr/*  w  ww . j a va2  s  .  c o  m*/
 * @param ec2Client
 * @return
 */
public String createVpc(String cidr, AmazonEC2 ec2Client) {
    CreateVpcRequest request = new CreateVpcRequest().withCidrBlock(cidr);
    CreateVpcResult result = ec2Client.createVpc(request);
    String vpcId = result.getVpc().getVpcId();

    return vpcId;
}

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

From source file:web.component.impl.aws.AWSEC2Impl.java

@Override
public CreateVpcResult createVpc(String cidrBlock, String tenancy) {

    return createVpc(new CreateVpcRequest().withCidrBlock(cidrBlock).withInstanceTenancy(tenancy));
}