The Zurich release has arrived! Interested in new features and functionalities? Click here for more

sunilyadav
Tera Contributor

How to discover AWS resources not discovered by OOB discovery 

As most of the organizations are expanding their cloud footprint, the need to discover and manage cloud resource inventory has become imperial, I have been working on AWS discovery from sometime and thought to share my experience on how to build new pattern for AWS resources which are not discovered OOB.

I will be using AWS EMR Cluster as an example to explain the approach to successfully build the pattern from scratch.

Step 1: CMDB Data Model Assessment

As an when we try to bring new resources to CMDB determine whether you have exiting classes which can hold the type of resources you want to bring in or not and decide if you need to extend the data model to accommodate the new CI types.

Important points to remember:

  1. AWS Pattern will be of Application Type.
  2. Make sure the existing class or new class should be subclass of Application else you will not be able to use the class in the pattern.

 

Step 2: AWS Resource Access Enablement

Work with your AWS team to enable the read permission on the service accounts where you will be running the discovery for the particular resource in this case it will be AWS EMR Cluster resource.

 

Step 3: Identify the AWS API’s that will provide you the properties/attributes of the targeted resource

Amazon has done a great job on documenting the AWS resources, go to https://docs.aws.amazon.com/index.html and search for the resource type you are interested in.

Navigate to API Reference à Actions to see entire API’s available for the resource, look for the Get/List/Describe type of API’s, So for AWS EMR I used ListClusters Action to get all the EMR clusters on the particular datacenter.

 

Step 4: Develop the pattern (You should have pattern development experience in order to understand and apply the steps)

Important points to remember:

  1. Pattern type should be Application. 
  1. Operating System should be AWS Datacenter.

 find_real_file.png

  1. Your Identification section entry type can be any conventional entry point like HTTPS, TCP. If you try to use AWS Resource Name Endpoint the way OOB patterns do you won’t be able to open the pattern in debug mode unless you have service mapping application Installed.

 find_real_file.png

  1. Use Cloud REST – Add Response to Context or Cloud Rest Call pattern step to call the API determined in Step 3.

 find_real_file.png

  1. Parse the response coming out of API and load the data to respective classes.
Comments
Tim80
Tera Expert

Hello - 

I had a similar request come in but for the resource type: AWS::IAM::ROLE

Its probably very similar to the above but I do not have any experience in creating/modifying a pattern. 

Any chance you could walk me through the steps? 

HeatherC1
Tera Contributor

Hello- can you provide the step in which you set the variable $amazonQueryURL?

 

HeatherC1
Tera Contributor

elasticmapreduce.regionname.amazonaws.com

sunilyadav
Tera Contributor

You need to make the region dynamic, change your URL to use ldc table and point to the region attribute.

HeatherC1
Tera Contributor

Thanks. I did get past that. What steps did you take after getting the list of clusters? did you rely on any of the AWS libraries to parse through the data? 

 

sunilyadav
Tera Contributor

Use the Set Parameter step

Version history
Last update:
‎02-26-2021 12:50 PM
Updated by: