BundleTask::designateType PHP Method

designateType() public method

It sets the type of bundle task to ec2.ebs-hvm to bundle in AWS way according to the OS version
public designateType ( string $platform, string $family, string $generation = null, string $version = '' )
$platform string The name of the cloud platform
$family string OS family
$generation string optional OS generation. If generation is not provided it will use version instead.
$version string optional OS version. If generation is not provided it will use version instead.
    public function designateType($platform, $family, $generation = null, $version = '')
    {
        if ($platform == SERVER_PLATFORMS::EC2) {
            switch (true) {
                case in_array($family, ['redhat', 'oel', 'scientific']):
                case $family == 'centos' && ($generation == '7' || strpos($version, '7') === 0):
                case $family == 'debian' && ($generation == '8' || strpos($version, '8') === 0):
                case $family == 'amazon' && ($generation == '2014.09' || $version == '2014.09'):
                    $this->bundleType = SERVER_SNAPSHOT_CREATION_TYPE::EC2_EBS_HVM;
                    break;
            }
        }
    }