

# Inventory search in License Manager
<a name="inventory"></a>

License Manager allows you to discover on-premises applications using [Systems Manager inventory](https://aws.amazon.com/systems-manager/faq/), and then to attach licensing rules to them. After licensing rules are attached to these servers, you can track them along with your AWS servers in the License Manager dashboard.

For organizations using License asset groups, inventory search results can be consolidated across multiple AWS regions and accounts within your AWS Organizations, providing a unified view of discovered resources regardless of which regions or accounts they reside in.

License Manager cannot, however, validate licensing rules for these servers at launch or termination time. To keep information about non AWS servers up-to-date, you must periodically refresh the inventory information using the **Inventory search** section of the License Manager console.

Systems Manager stores data in its Inventory data for 30 days. During this period, License Manager counts a managed instance as active even if it is not pingable. After inventory data has been purged from Systems Manager, License Manager marks the instance as inactive and updates local inventory data. To keep managed instance counts accurate, we recommend manually deregistering instances in Systems Manager so that License Manager can run cleanup operations. 

Querying Systems Manager inventory requires a Resource Data Sync to store inventory in an Amazon S3 bucket, Amazon Athena to aggregate inventory data from organizational accounts, and AWS Glue to provide a fast query experience. For more information, see [Using service-linked roles for License Manager](using-service-linked-roles.md).

Resource inventory tracking is also useful if your organization does not restrict AWS users from creating AMI-derived instances or installing additional software on running instances. License Manager provides you with a mechanism to easily discover these instances and applications using inventory search. You can attach rules to these discovered resources and track and validate them the same as instances created from managed AMIs.

**Topics**
+ [Work with inventory search in License Manager](discovery.md)
+ [Automated discovery of inventory in License Manager](automated-discovery.md)

# Work with inventory search in License Manager
<a name="discovery"></a>

License Manager uses [Systems Manager inventory](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-inventory.html) to discover software usage on premises. After you associate a self-managed license with on-premises servers, License Manager periodically collects software inventory, updates licensing information, and refreshes its dashboards to report usage.

**Topics**
+ [Set up for inventory search](#discovery-setup)
+ [Use inventory search](#using-discovery)
+ [Add automated discovery rules to a self-managed license](#add-discovery-rule)
+ [Associate a self-managed license with inventory search](#discovered)
+ [Disassociate a self-managed license and a resource](#disassociate)

## Set up for inventory search
<a name="discovery-setup"></a>

Complete the following requirements before using resource inventory search:
+ Enable cross-account inventory discovery by integrating License Manager with your AWS Organizations account. For more information, see [Settings in License Manager](settings.md).
+ Create self-managed licenses for the servers and applications to manage. For example, create a self-managed license that reflects the terms of your licensing agreement with Microsoft for SQL Server Enterprise.

## Use inventory search
<a name="using-discovery"></a>

Complete the following steps to search your resource inventory. You can search for applications by name (for example, names that begin with "SQL Server") and the type of license included (for example, a license that is not for "SQL Server Web").

**Search your resource inventory**

1. Open the License Manager console at [https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/).

1. In the navigation pane, choose **Inventory search**.

1. (Optional) You can specify filter options to streamline search results as follows.  
**Amazon EC2 resources**    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/license-manager/latest/userguide/discovery.html)  
**Amazon RDS resources**    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/license-manager/latest/userguide/discovery.html)

   For more information about Amazon RDS database product licenses, see [RDS for Oracle licensing options](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Oracle.Concepts.Licensing.html), or [RDS for Db2 licensing options](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/db2-licensing.html) in the *Amazon RDS User Guide*.

## Add automated discovery rules to a self-managed license
<a name="add-discovery-rule"></a>

After you add product information to your self-managed license, License Manager can track license usage for the instances that have those products installed. For more information, see [Automated discovery of inventory in License Manager](automated-discovery.md).

**To add automated discovery rules to a self-managed license**

1. Open the License Manager console at [https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/).

1. Open the **Inventory search** page.

1. Select the resource and choose **Add automated discovery rules**.

1. For **Self-managed license**, select a self-managed license.

1. Specify the products to discover and track.

1. (Optional) Select **Stop tracking instances when software is uninstalled** to make the license available for reuse after License Manager detects that the software was uninstalled and any license affinity period has elapsed.

1. (Optional) To exclude resources from automated discovery select **Add exclusion rule**.
**Note**  
Exclusion rules do not apply to Amazon RDS products (such as RDS for Oracle and RDS for Db2).

   1. Choose a **Property** to filter on, currently **Account ID**, and **Tag** are supported.

   1. Enter the information to identify that property. For an **Account ID** specify the 12 digit AWS Account ID as the value. For **Tags** enter a key/value pair.

   1. Repeat step 7 to add additional rules.

1. Choose **Add**.

## Associate a self-managed license with inventory search
<a name="discovered"></a>

After you have identified the unmanaged resources that you need to manage, you can manually associate them with a self-managed license, instead of using automated discovery.

**To associate a self-managed license with a resource**

1. Open the License Manager console at [https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/).

1. Open the **Inventory search** page.

1. Select the resource and choose **Associate self-managed license**.

1. For **self-managed license name**, select a self-managed license.

1. (Optional) Select **Share self-managed license with all my member accounts**.

1. Choose **Associate**.

## Disassociate a self-managed license and a resource
<a name="disassociate"></a>

If the licensing terms from your software vendors change, you can disassociate resources that were associated manually and then delete the self-managed license.

**To disassociate a self-managed license and a resource**

1. Open the License Manager console at [https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/).

1. In the left navigation pane, choose **self-managed license**.

1. Choose the name of the self-managed license.

1. Choose **Resources**.

1. Select each of the resources to disassociate from the self-managed license and then choose **Disassociate resource**.

# Automated discovery of inventory in License Manager
<a name="automated-discovery"></a>

License Manager uses [Systems Manager inventory](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-inventory.html) to discover software usage on Amazon EC2 instances and on-premises instances. You can add product information to your self-managed license, and License Manager will track the instances that have those products installed. Additionally, you can specify exclusion rules based on your licensing agreement to decide which instances to exclude. You can exclude instances belonging to AWS account IDs or associated with resource tags from being considered for automated discovery

Automated discovery can be added to a new license set, to an existing self-managed license, or resources in your inventory. Rules for automated discovery can be edited at any time through the CLI using the [UpdateLicenseConfiguration](https://docs.aws.amazon.com/license-manager/latest/APIReference/API_UpdateLicenseConfiguration.html) API command. To edit rules in the console, you must delete the existing self-managed license and create a new one.

To use automated discovery, you must add product information to your self-managed license. You can do so when you create the self-managed license using **Inventory search**.

You cannot manually disassociate instances tracked by automated discovery. By default, automated discovery does not disassociate tracked instances after the software is uninstalled. You can configure automated discovery to stop tracking instances when the software is uninstalled.

After you configure automated discovery, you can track license usage through the License Manager dashboard.

**Prerequisites**
+ Enable cross-account inventory search by integrating License Manager with your AWS Organizations account. For more information, see [Settings in License Manager](settings.md).
**Note**  
 Single accounts can set up automated discovery but cannot add exclusion rules.
+ Install Systems Manager inventory on your instances.

**To configure automated discovery when you create a self-managed license**  
You can configure automated discovery rules and exclusion rules when you create a self-managed license. For more information, see [Create a self-managed license in License Manager](create-license-configuration.md).

**To add automated discovery rules to an existing self-managed license**

 Use the process below to add automated discovery rules to existing self-managed licenses through the console, you can also do this from the **Inventory search** pane by selecting an resource ID and selecting **Add automated discovery rules**.

1. Open the License Manager console at [https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/).

1. In the left navigation pane, choose **Self-managed licenses**.

1. Choose the name of the self-managed license to open the license details page.

1. On the **Automated discovery rules** tab, choose **Add automated discovery rules**.

1. Specify the products to discover and track.
**Note**  
The following limitations apply to Amazon RDS database products (such as Amazon RDS for Oracle and Amazon RDS for Db2):  
A maximum of one rule specifying an Amazon RDS database product is supported.
Only one license configuration is allowed for each Amazon RDS database product.

1. (Optional) Select **Stop tracking instances when software is uninstalled** to make the license available for reuse after License Manager detects that the software was uninstalled and any license affinity period has elapsed.

1. (Optional) To define resources to exclude from automated discovery select **Add exclusion rule**.
**Note**  
Exclusion rules do not apply to RDS database products (such as Amazon RDS for Oracle and Amazon RDS for Db2).
Exclusion rules are only available if [Cross-account resource discovery](settings-managed-licenses.md#settings-resource-discovery) has been enabled.

   1. Choose a **Property** to filter on, currently **Account ID**, and **Tag** are supported.

   1. Enter the information to identify that property. For an **Account ID** specify the 12 digit AWS account ID as the value. For **Tags** enter a key/value pair.

   1. Repeat step 7 to add additional rules.

1. When you are finished choose **Add** to apply your automated discovery rule.