Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for new metadata, importsource tweak #12

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions library/Aws/AwsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,21 @@ public function getEc2Instances()
'hypervisor' => 'Hypervisor',
'virt_type' => 'VirtualizationType',
), array(
'vpc_id' => 'VpcId',
'root_device_type' => 'RootDeviceType',
'root_device_name' => 'RootDeviceName',
'public_ip' => 'PublicIpAddress',
'public_dns' => 'PublicDnsName',
'private_ip' => 'PrivateIpAddress',
'private_dns' => 'PrivateDnsName',
));
// no point in monitoring nodes that are not in ready state
// make sure sync rule maps disabled column to disabled property
if ($entry['State']['Name'] == 'running') {
$object->disabled = FALSE;
} else {
$object->disabled = TRUE;
}

$object->monitoring_state = $entry['Monitoring']['State'];

Expand Down Expand Up @@ -164,6 +172,9 @@ protected function extractTags($entry, $result)

foreach ($entry['Tags'] as $t) {
$result->tags->{$t['Key']} = $t['Value'];
// so we can use these tags in the expected way in import filters via tags.attribute
$result->{'tags.'.$t['Key']} = $t['Value'];

}
}

Expand Down
2 changes: 2 additions & 0 deletions library/Aws/ProvidedHook/Director/ImportSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ public function listColumns()
'root_device_name',
'hypervisor',
'virt_type',
'vpc_id',
'public_ip',
'public_dns',
'private_ip',
'private_dns',
'disabled',
'monitoring_state',
'tags',
'tags.Name',
Expand Down