예제 #1
0
    echo 'php index.php ec2 delete ' . PHP_EOL;
    echo 'php index.php ec2 describe_images ' . PHP_EOL;
    echo 'php index.php rds create ' . PHP_EOL;
    echo 'php index.php rds update ' . PHP_EOL;
    echo 'php index.php rds delete ' . PHP_EOL;
    echo 'php index.php iam create ' . PHP_EOL;
    echo 'php index.php iam update ' . PHP_EOL;
    echo 'php index.php iam delete ' . PHP_EOL;
    echo 'php index.php iam create_group ' . PHP_EOL;
    echo 'php index.php iam add_to_group ' . PHP_EOL;
} elseif (!empty($service) && !empty($action)) {
    //instantiate ec2 service and perform required actions
    if ($service == "ec2") {
        $ec2 = new EC2('ec2');
        if ($action == 'create') {
            $ret_val = $ec2->createInstance();
        } elseif ($action == 'update') {
            $ret_val = $ec2->updateInstance();
        } elseif ($action == 'delete') {
            $ret_val = $ec2->deleteInstance();
        } elseif ($action == 'describe_images') {
            $ret_val = $ec2->describeImages();
            print_r($ret_val);
        }
    } else {
        if ($service == "rds") {
            $rds = new RDS('rds');
            if ($action == 'create') {
                $ret_val = $rds->createInstance();
            } elseif ($action == 'update') {
                $ret_val = $rds->updateInstance();