-
Notifications
You must be signed in to change notification settings - Fork 0
/
ezvpc
executable file
·37 lines (30 loc) · 905 Bytes
/
ezvpc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env php
<?php
require __DIR__.'/vendor/autoload.php';
require __DIR__.'/init.php';
use Aws\Ec2\Ec2Client;
use Symfony\Component\Console\Application;
/**
* Init app and auto-register all the available commands
*/
$application = new Application('EZ VPC', '1.0.0');
$application->aws = (object) [
'_config' => [
'version' => 'latest',
'region' => getenv('AWS_REGION'),
'credentials' => [
'key' => getenv('AWS_ACCESS_KEY_ID'),
'secret' => getenv('AWS_SECRET_ACCESS_KEY'),
],
],
];
$application->aws->ec2 = new Ec2Client($application->aws->_config);
$application->aws->_testMode = getenv('AWS_TEST_MODE') !== '0';
/**
* Registering all the available commands
*/
while (count($commandsClasses)) {
$commandClass = array_shift($commandsClasses);
$application->add(new $commandClass);
}
$application->run();