cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Automating AWS Instances to a location

bmaudlin
By Level 9 Champion
Level 9 Champion

Hi Guys,

I hope you are well, I am looking to automate the manual process we currently carry out by mapping AWS instances to a location. 

My initial thought was to use Instance Region / Instance Availability Zone, and map that to a location via a Business adapter. 

However in the Business Adapter - I don't think this field is exposable from what I can tell?  

 

2022-07-25_08-54-27.png

Any thoughts are welcome 🙂

Ben

(5) Replies

@bmaudlin - Data that appears on the Cloud Service Provider Inventory view (imported from AWS and Azure) cannot be linked to a "Location".

However, once an AWS/Azure instance has been linked to a live Inventory Device, you could then use the Instance Region to assign a Location to the linked Inventory Device.

ChrisG
By Community Manager Community Manager
Community Manager

That's an interesting challenge. On the assumption that your source data includes an AWS instance ID & region, I can't think of a straightforward way to use the business adapter data model to do that.

This could probably be done using a direct SQL query in a business adapter if you're running FlexNet Manager Suite on premises. You would need to look up a cloud instance record using the instance ID, join to the related computer (inventory device) record and then update the location on the computer record.

This is untested (i.e. treat is a pseudo-code rather than actual code), but it might look something like:

UPDATE cc
SET LocationID = <some expression identifying the location based on source.AWSRegion>
FROM #ECMImport_YourImportName source
    JOIN dbo.CloudServiceInstance csi ON csi.InstanceCloudID = source.InstanceCloudID
    JOIN dbo.ComplianceComputer cc ON cc.ComplianceComputerID = csi.ComplianceComputerID

 

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)

A similar direct sql query that @ChrisG mentioned is what we use to set the device location once we determine what needs to be set.  The business adapter uses an excel workbook as a data source. 

Our solution involves some Excel pre-work that identifies all of the ec2 instance ID's, cross references the instanceID to the device serial number (could also use ComplianceComputerID), and determines if the LocationID is already set and set correctly.  Devices already set correctly are filtered out.  We then save the filtered list of devices requiring an update in a location picked up by the business adapter.

We run this same process to set Location, Account, CorpUnit, Hosted In, Role, and Status for all of our ec2 instances.  It's not exactly pretty but it runs daily as a scheduled task without human intervention.  

Hello @darren_haehnel & @ChrisG,

Thanks for the information, as we are using the Flexera cloud / ITAM I don't have any direct access to the SQL backend unfortunately. 

@bmaudlin - You can try using the new REPORT REST API to extract the data needed for a Business Adapter.

1) Create a new Custom Report.
2) Start with the Cloud Instance object to pull the columns you want that appear on the Cloud Service Provider Inventory view.
3) You can then add the Inventory Device object and include the computer name and serial number.
4) Verify the report and Save it.

You can then use the REPORT REST API to pull the results of this report, convert to CSV and use an import file to a Business Adapter to update the Location of the Inventory Device that is linked to a Cloud Instance.