-
Notifications
You must be signed in to change notification settings - Fork 0
/
story.bash
42 lines (32 loc) · 1.59 KB
/
story.bash
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
name=$(config name)
aws autoscaling describe-launch-configurations --launch-configuration-name $name | perl -n -MJSON -e '
$json.=$_;
END {
#print $json;
$data = decode_json($json);
$i = $data->{LaunchConfigurations}->[0] or die "launch configuration not found";
$name = $i->{LaunchConfigurationName};
$instance_monitoring = $i->{InstanceMonitoring}->{Enabled} ? "YES" : "NO";
$image_id = $i->{ImageId};
$time = (split /T/, $i->{CreatedTime})[0];
$in_type = $i->{InstanceType};
@sg = @{$i->{SecurityGroups}};
$key_name = $i->{KeyName};
write();
}
format STDOUT =
----------------------------------------------------------------------------------------------------------
Name / Instance / ImageID / Time / Instance / KeyName |
Monitoring Type |
----------------------------------------------------------------------------------------------------------
^<<<<<<<<<<< ^<<< ~ ^<<<<<<<<<<<<<<<< @<<<<<<<<<< @<<<<<<<<<<<<<<<< ^<<<<<<<<<<
$name, $instance_monitoring, $image_id, $time, $in_type, $key_name
^<<<<<<<<<<< ~ ^<<<<<<<<<<
$name, $key_name
----------------------------------------------------------------------------------------------------------
Securty Groups:
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
shift @sg
----------------------------------------------------------------------------------------------------------
.
'