Subject: | describe_tags cannot handle tags without a value |
If you attach a tag without a value to an instance (so its just the
key), describe_tags returns an error (debug output):
GENERATED QUERY URL: http://eu-west-1.ec2.amazonaws.com
$VAR1 = {
'xmlns' => 'http://ec2.amazonaws.com/doc/2011-01-01/',
'requestId' => '69c94a5a-3d0a-4b13-af9a-b078bc26ed4d',
'tagSet' => {
'item' => [
{
'resourceType' => 'instance',
'value' => {},
'resourceId' => 'i-8090b2c9',
'key' => 'BLA'
}
]
}
};
Attribute (value) does not pass the type constraint because: Validation
failed for 'Maybe[Str]' with value HASH(0x2fd86a4) at
C:/Perl/site/lib/Net/Amazon/EC2.pm line 2613
Net::Amazon::EC2::describe_tags(undef, 'Filter.Name', 'key',
'Filter.Value', 'BLA') called at
P:/advantage_platform/cframe/prototype/ec2/ami-creation/createAmiPerl.pl
line 103
main::findServerByTag('BLA') called at
P:/advantage_platform/cframe/prototype/ec2/ami-creation/createAmiPerl.pl
line 125
The problem is that 'value' is defined as a required attribute for ctor
of Net::Amazon::EC2::DescribeTags class and cannot be empty as it is in
this case. This is nasty, especially if you try to fetch all tags in
your account.