Scalr\Service\Aws\Ec2\V20140615\Ec2Api::createVpc PHP Method

createVpc() public method

Creates a VPC with the specified CIDR block. The smallest VPC you can create uses a /28 netmask (16 IP addresses), and the largest uses a /16 netmask (65,536 IP addresses). By default, each instance you launch in the VPC has the default DHCP options, which includes only a default DNS server that we provide (AmazonProvidedDNS)
public createVpc ( string $cidrBlock, string $instanceTenancy = null ) : Scalr\Service\Aws\Ec2\DataType\VpcData
$cidrBlock string The CIDR block you want the VPC to cover (for example, 10.0.0.0/16).
$instanceTenancy string optional The supported tenancy options for instances launched into the VPC. A value of default means that instances can be launched with any tenancy; a value of dedicated means all instances are launched as dedicated tenancy instances regardless of the tenancy assigned to the instance at launch. Setting the instance tenancy to dedicated runs your instance on single-tenant hardware.
return Scalr\Service\Aws\Ec2\DataType\VpcData Returns VpcData
    public function createVpc($cidrBlock, $instanceTenancy = null)
    {
        $result = null;
        $options = array('CidrBlock' => (string) $cidrBlock);
        if ($instanceTenancy != null) {
            $options['InstanceTenancy'] = (string) $instanceTenancy;
        }
        $action = ucfirst(__FUNCTION__);
        $response = $this->client->call($action, $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            $result = $this->_loadVpcData($sxml->vpc);
        }
        return $result;
    }
Ec2Api