add keyname tag in ec2 listinstance
This commit is contained in:
parent
c127ffcbb0
commit
dd6f32f7bf
|
@ -348,6 +348,7 @@ sub ec2_list_resources {
|
|||
InstanceType => $instance->{InstanceType},
|
||||
State => $instance->{State}->{Name},
|
||||
Tags => join(",", @instance_tags),
|
||||
KeyName => $instance->{KeyName},
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -54,8 +54,8 @@ sub run {
|
|||
$self->manage_selection(%options);
|
||||
foreach (@{$self->{instances}}) {
|
||||
next if ($_->{Type} !~ m/instance/);
|
||||
$self->{output}->output_add(long_msg => sprintf("[Id = %s][AvailabilityZone = %s][InstanceType = %s][State = %s][Tags = %s]",
|
||||
$_->{Name}, $_->{AvailabilityZone}, $_->{InstanceType}, $_->{State}, $_->{Tags}));
|
||||
$self->{output}->output_add(long_msg => sprintf("[Id = %s][AvailabilityZone = %s][InstanceType = %s][State = %s][Tags = %s][KeyName = %s]",
|
||||
$_->{Name}, $_->{AvailabilityZone}, $_->{InstanceType}, $_->{State}, $_->{Tags}, $_->{KeyName}));
|
||||
}
|
||||
|
||||
$self->{output}->output_add(severity => 'OK',
|
||||
|
@ -67,7 +67,7 @@ sub run {
|
|||
sub disco_format {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{output}->add_disco_format(elements => ['id', 'availabilityzone', 'instancetype', 'state', 'tags']);
|
||||
$self->{output}->add_disco_format(elements => ['id', 'availabilityzone', 'instancetype', 'state', 'tags', 'keyname']);
|
||||
}
|
||||
|
||||
sub disco_show {
|
||||
|
@ -82,6 +82,7 @@ sub disco_show {
|
|||
instancetype => $_->{InstanceType},
|
||||
state => $_->{State},
|
||||
tags => $_->{Tags},
|
||||
keyname => $_->{KeyName},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue