-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCfgAws.pm
86 lines (62 loc) · 2.86 KB
/
CfgAws.pm
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#====================================================================
#
# Filename: CfgAws.pm
# Author: Ozan Akcin
# Created: 02-12-2016
# Purpose: key parameter-argument couplings for AWS servers connectivity
# References: http://docs.aws.amazon.com/cli/latest/reference/ec2/start-instances.html
# http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html
# http://docs.aws.amazon.com/cli/latest/reference/ec2/stop-instances.html
#====================================================================
package FsData::CfgAws; #---modify to match target lib path in your env
use strict;
use warnings;
use Carp;
my %awsCfg =
(
'awsGlobalVars' => {
accountNum => ""
, configFile => "$ENV{HOME}/.aws/config"
, credFile => "$ENV{HOME}/.aws/credentials"
, ipFile => "$ENV{HOME}/.aws/pubDNS_INSTANCE"
},
'awsReturnValues' => {
0 => "pending"
, 16 => "running"
, 32 => "shutting-down"
, 48 => "terminated"
, 64 => "stopping"
, 80 => "stopped"
},
'instances' => {
'dev' => {
ami => "" #---amazon machine image
, description => ""
, instanceId => ""
, instanceType => "" #---e.g. 't2.micro', etc.
, keyPairFile => "" #---path to AWS *.pem file (generally under ~/.ssh)
, keyPairName => "" #---file name of key pair given during ssh-keygen process
, secGroupId => "" #---security group id (from AWS instance description)
, vpcId => "" #---virtual private cloud
},
'prod' => {
},
}
);
#===============================================================================
sub new
{
my( $class )=@_;
my $self = {};
bless $self, $class;
$self->_init;
return $self;
}
#===============================================================================
#===============================================================================
sub _init
{
my ( $self ) = @_;
$self->{awsCfgVars} = \%awsCfg;
}
#===============================================================================