

# Using service-linked roles for License Manager
<a name="using-service-linked-roles"></a>

AWS License Manager uses AWS Identity and Access Management (IAM)[ service-linked roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-service-linked-role). A service-linked role is a unique type of IAM role that is linked directly to License Manager. Service-linked roles are predefined by License Manager and include all the permissions that the service requires to call other AWS services on your behalf. 

A service-linked role makes setting up License Manager easier because you don’t have to manually add the necessary permissions. License Manager defines the permissions of its service-linked roles, and unless defined otherwise, only License Manager can assume its roles. The defined permissions include the trust policy and the permissions policy, and that permissions policy cannot be attached to any other IAM entity.

You can delete a service-linked role only after first deleting the related resources. This protects your License Manager resources because you can't inadvertently remove permissions to access the resources.

License Manager actions depend on three service-linked roles, as described in the following sections.

**Topics**
+ [Core role](license-manager-role-core.md)
+ [Management account role](management-role.md)
+ [Member account role](member-role.md)
+ [User-based subscription role](user-based-subscription-role.md)
+ [Linux subscriptions role](linux-subscriptions-role.md)

# License Manager – Core role
<a name="license-manager-role-core"></a>

License Manager requires a service-linked role to manage licenses on your behalf.

## Permissions for the core role
<a name="slr-permissions-core-role"></a>

The service-linked role named `AWSServiceRoleForAWSLicenseManagerRole` allows License Manager access to AWS resources to manage licenses on your behalf.

The `AWSServiceRoleForAWSLicenseManagerRole` service-linked role trusts the `license-manager.amazonaws.com` service to assume the role.

To review permissions for the **AWSLicenseManagerServiceRolePolicy**, see [AWS managed policy: AWSLicenseManagerServiceRolePolicy](security-iam-awsmanpol.md#security-iam-AWSLicenseManagerServiceRolePolicy). To learn more about configuring permissions for a service-linked role, see [Service-Linked Role Permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#service-linked-role-permissions) in the *IAM User Guide*.

## Create a service-linked role for License Manager
<a name="create-slr-core"></a>

You don't need to manually create a service-linked role. When you complete the License Manager first-run experience form the first time that you visit the License Manager console, the service-linked role is automatically created for you. 

You can also use the IAM console, AWS CLI, or IAM API to create a service-linked role manually. For more information, see [Creating a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#create-service-linked-role) in the *IAM User Guide*. 

**Important**  
This service-linked role can appear in your account if you completed an action in another service that uses the features supported by this role. If you were using License Manager before January 1, 2017, when it began supporting service-linked roles, then License Manager created the `AWSServiceRoleForAWSLicenseManagerRole` role in your account. For more information, see [A New Role Appeared in My IAM Account](https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_roles.html#troubleshoot_roles_new-role-appeared).

You can use the License Manager console to create a service-linked role.

**To create the service-linked role**

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

1. Choose **Start using License Manager**.

1. In the **IAM Permissions (one-time-setup)** form, select **I grant AWS License Manager the required permissions**, then choose **Continue**.

You can also use the IAM console to create a service-linked role with the **License Manager** use case. Alternatively, in the AWS CLI or the AWS API, use IAM to create a service-linked role with the `license-manager.amazonaws.com` service name. For more information, see [Creating a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#create-service-linked-role) in the *IAM User Guide*. 

If you delete this service-linked role, you can use the same IAM process to create the role again.

## Edit a service-linked role for License Manager
<a name="edit-slr-core"></a>

License Manager doesn't allow you to edit the `AWSServiceRoleForAWSLicenseManagerRole` service-linked role. After you create a service-linked role, you cannot change the name of the role because various entities might reference the role. However, you can edit the description of the role using IAM. For more information, see [Editing a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#edit-service-linked-role) in the *IAM User Guide*.

## Delete a service-linked role for License Manager
<a name="delete-slr-core"></a>

If you no longer need to use a feature or service that requires a service-linked role, we recommend that you delete that role. That way, you only have entities that are actively monitored or maintained. However, you must clean up your service-linked role before you can manually delete it.

### Clean up a service-linked role
<a name="slr-review-before-delete-core"></a>

Before you can use IAM to delete a service-linked role, you must first delete all resources used by the role. This means disassociating any self-managed licenses from associated instances and AMIs, and then deleting the self-managed licenses.

**Note**  
If License Manager is using the role when you try to delete the resources, then the deletion might fail. If that happens, wait for a few minutes and try the action again.

**To delete License Manager resources used by the core role**

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 **Self-managed licenses**.

1. Choose a self-managed license for which you are the owner and disassociate all entries within the **Associated AMIs** and **Resources** tabs. Repeat this process for each license configuration.

1. While still on the self-managed license's page, choose **Actions**, then choose **Delete**.

1. Repeat the previous steps until all self-managed licenses have been deleted.

### Manually delete the service-linked role
<a name="slr-manual-delete-core"></a>

Use the IAM console, the AWS CLI, or the AWS API to delete the `AWSServiceRoleForAWSLicenseManagerRole` service-linked role. If you are also using [AWSServiceRoleForAWSLicenseManagerMasterAccountRole](management-role.md) and [AWSLicenseManagerMemberAccountRole](member-role.md), delete those roles first. For more information, see [Deleting a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#delete-service-linked-role) in the *IAM User Guide*. 

# License Manager – Management account role
<a name="management-role"></a>

License Manager requires a service-linked role to perform license management.

## Permissions for the management account role
<a name="slr-permissions-management-role"></a>

The service-linked role named `AWSServiceRoleForAWSLicenseManagerMasterAccountRole` allows License Manager access to AWS resources to manage license management actions for a central management account on your behalf.

The `AWSServiceRoleForAWSLicenseManagerMasterAccountRole` service-linked role trusts the `license-manager.master-account.amazonaws.com` service to assume the role.

To review permissions for the **AWSLicenseManagerMasterAccountRolePolicy**, see [AWS managed policy: AWSLicenseManagerMasterAccountRolePolicy](security-iam-awsmanpol.md#security-iam-AWSLicenseManagerMasterAccountRolePolicy). To learn more about configuring permissions for a service-linked role, see [Service-Linked Role Permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#service-linked-role-permissions) in the *IAM User Guide*.

## Create a management account service-linked role
<a name="create-slr-management"></a>

You don't need to manually create this service-linked role. When you configure cross-account license management in the AWS Management Console, License Manager creates the service-linked role for you. 

**Note**  
To make use of cross-account support in License Manager, you must be using AWS Organizations.

If you delete this service-linked role and then need to create it again, you can use the same process to recreate the role in your account.

You can also use the IAM console, AWS CLI, or IAM API to create a service-linked role manually. For more information, see [Creating a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#create-service-linked-role) in the *IAM User Guide*.

**Important**  
This service-linked role can appear in your account if you completed an action in another service that uses the features supported by this role. If you were using License Manager before January 1, 2017, when it began supporting service-linked roles, then License Manager created `AWSServiceRoleForAWSLicenseManagerMasterAccountRole` in your account. For more information, see [A New Role Appeared in My IAM Account](https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_roles.html#troubleshoot_roles_new-role-appeared).

You can use the License Manager console to create this service-linked role. 

**To create the service-linked role**

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

1. Choose **Settings**, **Edit**.

1. Choose **Link AWS Organizations accounts**.

1. Choose **Apply**.

You can also use the IAM console to create a service-linked role with the License Manager–Management account use case. Alternatively, in the AWS CLI or the AWS API, use IAM to create a service-linked role with the `license-manager.master-account.amazonaws.com` service name. For more information, see [Creating a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#create-service-linked-role) in the *IAM User Guide*. 

If you delete this service-linked role, you can use the same IAM process to create the role again.

## Edit a service-linked role for License Manager
<a name="edit-slr-management"></a>

License Manager does not allow you to edit the `AWSServiceRoleForAWSLicenseManagerMasterAccountRole` service-linked role. After you create a service-linked role, you cannot change the name of the role because various entities might reference the role. However, you can edit the description of the role using IAM. For more information, see [Editing a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#edit-service-linked-role) in the *IAM User Guide*.

## Delete a service-linked role for License Manager
<a name="delete-slr-management"></a>

If you no longer need to use a feature or service that requires a service-linked role, we recommend that you delete that role. That way, you only have entities that are actively monitored or maintained. However, you must clean up your service-linked role before you can manually delete it.

### Manually delete the service-linked role
<a name="slr-manual-delete-management"></a>

Use the IAM console, AWS CLI, or AWS API to delete the `AWSServiceRoleForAWSLicenseManagerMasterAccountRole` service-linked role. For more information, see [Deleting a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#delete-service-linked-role) in the *IAM User Guide*.

# License Manager – Member account role
<a name="member-role"></a>

License Manager requires a service-linked role that allows the management account to manage licenses.

## Permissions for the member account role
<a name="slr-permissions-member"></a>

The service-linked role named `AWSServiceRoleForAWSLicenseManagerMemberAccountRole` allows License Manager to access AWS resources for license management actions from a configured management account on your behalf.

The `AWSServiceRoleForAWSLicenseManagerMemberAccountRole` service-linked role trusts the `license-manager.member-account.amazonaws.com` service to assume the role.

To review permissions for the **AWSLicenseManagerMemberAccountRolePolicy**, see [AWS managed policy: AWSLicenseManagerMemberAccountRolePolicy](security-iam-awsmanpol.md#security-iam-AWSLicenseManagerMemberAccountRolePolicy). To learn more about configuring permissions for a service-linked role, see [Service-Linked Role Permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#service-linked-role-permissions) in the *IAM User Guide*.

## Create the service-linked role for License Manager
<a name="create-service-linked-role-member"></a>

You don't need to manually create the service-linked role. You can enable integration with AWS Organizations from the management account in the License Manager console on the **Settings** page. You can also do this using the AWS CLI (run `update-service-settings`) or the AWS API (call `UpdateServiceSettings`). When you do, License Manager creates the service-linked role for you in the Organizations member accounts.

If you delete this service-linked role and then need to create it again, you can use the same process to recreate the role in your account.

You can also use the IAM console, AWS CLI, or the AWS API to create a service-linked role manually. For more information, see [Creating a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#create-service-linked-role) in the *IAM User Guide*.

**Important**  
This service-linked role can appear in your account if you completed an action in another service that uses the features supported by this role. If you were using the License Manager service before January 1, 2017, when it began supporting service-linked roles, then License Manager created the `AWSServiceRoleForAWSLicenseManagerMemberAccountRole` role in your account. For more information, see [A New Role Appeared in My IAM Account](https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_roles.html#troubleshoot_roles_new-role-appeared).

You can use the License Manager console to create a service-linked role.

**To create the service-linked role**

1. Log in to your AWS Organizations management account.

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 **Settings**, and then choose **Edit**.

1. Choose **Link AWS Organizations accounts**.

1. Choose **Apply**. This creates the roles [AWSServiceRoleForAWSLicenseManagerRole](license-manager-role-core.md) and [AWSServiceRoleForAWSLicenseManagerMemberAccountRole](#member-role) in all child accounts.

You can also use the IAM console to create a service-linked role with the `License Manager - Member account` use case. Alternatively, in the AWS CLI or AWS API, create a service-linked role with the `license-manager.member-account.amazonaws.com` service name. For more information, see [Creating a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#create-service-linked-role) in the *IAM User Guide*. 

If you delete this service-linked role, you can use the same IAM process to create the role again.

## Edit a service-linked role for License Manager
<a name="edit-service-linked-role-member"></a>

License Manager does not allow you to edit the `AWSServiceRoleForAWSLicenseManagerMemberAccountRole` service-linked role. After you create a service-linked role, you cannot change the name of the role because various entities might reference the role. However, you can edit the description of the role using IAM. For more information, see [Editing a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#edit-service-linked-role) in the *IAM User Guide*.

## Delete a service-linked role for License Manager
<a name="delete-service-linked-role-member"></a>

If you no longer need to use a feature or service that requires a service-linked role, we recommend that you delete that role. That way, you only have entities that are actively monitored or maintained. However, you must clean up your service-linked role before you can manually delete it.

### Manually delete the service-linked role
<a name="slr-manual-delete-member"></a>

Use the IAM console, AWS CLI, or AWS API to delete the `AWSServiceRoleForAWSLicenseManagerMemberAccountRole` service-linked role. For more information, see [Deleting a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#delete-service-linked-role) in the *IAM User Guide*.

# License Manager – User-based subscription role
<a name="user-based-subscription-role"></a>

License Manager requires a service-linked role for managing AWS resources that will provide user-based subscriptions.

## Permissions for the user-based subscription role
<a name="user-based-subscription-role-permissions"></a>

The service-linked role named `AWSServiceRoleForAWSLicenseManagerUserSubscriptionsService` allows License Manager to utilize AWS Systems Manager and manage Amazon EC2 resources providing user-based subscriptions, as well as describe Directory Service resources.

To review permissions for the **AWSLicenseManagerUserSubscriptionsServiceRolePolicy**, see [AWS managed policy: AWSLicenseManagerUserSubscriptionsServiceRolePolicy](security-iam-awsmanpol.md#security-iam-AWSLicenseManagerUserSubscriptionsServiceRolePolicy). To learn more about configuring permissions for a service-linked role, see [Service-Linked Role Permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#service-linked-role-permissions) in the *IAM User Guide*.

## Create the service-linked role for License Manager
<a name="create-slr-user-based-subscription"></a>

You don't need to manually create the service-linked role as you will be prompted on the License Manager console **User-based subscriptions** pages to create the role.

If you delete this service-linked role and then need to create it again, you can use the same process to recreate the role in your account.

You can also use the IAM console, AWS CLI, or IAM API to create a service-linked role manually. For more information, see [Creating a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#create-service-linked-role) in the *IAM User Guide*.

You can use the License Manager console to create a service-linked role.

**To create the service-linked role**

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 **User Association** or **Products**.

1. Agree to the terms for License Manager to create the user-based subscription role.

1. Choose **Create**. This creates the role.

You can also use the IAM console to create a service-linked role with the `License Manager - User-based subscriptions` use case. Alternatively, in the AWS CLI or AWS API, create a service-linked role with the `license-manager-user-subscriptions.amazonaws.com` service name. For more information, see [Creating a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#create-service-linked-role) in the *IAM User Guide*. 

If you delete this service-linked role, you can use the same IAM process to create the role again.

## Edit a service-linked role for License Manager
<a name="edit-slr-user-based-subscription"></a>

License Manager does not allow you to edit the `AWSServiceRoleForAWSLicenseManagerUserSubscriptionsService` service-linked role. After you create a service-linked role, you cannot change the name of the role because various entities might reference the role. However, you can edit the description of the role using IAM. For more information, see [Editing a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#edit-service-linked-role) in the *IAM User Guide*.

## Delete a service-linked role for License Manager
<a name="delete-slr-user-based-subscription"></a>

If you no longer need to use a feature or service that requires a service-linked role, we recommend that you delete that role. That way, you only have entities that are actively monitored or maintained. However, you must clean up your service-linked role before you can manually delete it.

### Manually delete the service-linked role
<a name="slr-manual-delete-user-based-subscription"></a>

Use the IAM console, AWS CLI, or AWS API to delete the `AWSServiceRoleForAWSLicenseManagerUserSubscriptionsService` service-linked role. For more information, see [Deleting a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#delete-service-linked-role) in the *IAM User Guide*.

# License Manager – Linux subscriptions role
<a name="linux-subscriptions-role"></a>

License Manager requires a service-linked role to manage AWS resources that provide Linux subscriptions.

## Permissions for the Linux subscriptions role
<a name="linux-subscriptions-role-permissions"></a>

The service-linked role named `AWSServiceRoleForAWSLicenseManagerLinuxSubscriptionsService` allows License Manager to perform the following actions for Linux subscriptions.
+ Discover Amazon Elastic Compute Cloud and AWS Organizations resources.
+ Retrieve secrets tagged with `"LicenseManagerLinuxSubscriptions": "enabled"` from AWS Secrets Manager for access to third-party Linux subscription providers to get subscription information.
+ Use KMS keys tagged with `"LicenseManagerLinuxSubscriptions": "enabled"` to decrypt secrets.

To review permissions for the **AWSLicenseManagerLinuxSubscriptionsServiceRolePolicy**, see [AWS managed policy: AWSLicenseManagerLinuxSubscriptionsServiceRolePolicy](security-iam-awsmanpol.md#security-iam-AWSLicenseManagerLinuxSubscriptionsServiceRolePolicy). To learn more about configuring permissions for a service-linked role, see [Service-Linked Role Permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#service-linked-role-permissions) in the *IAM User Guide*.

## Create the service-linked role for License Manager
<a name="create-service-linked-role-linux-subscriptions"></a>

You don't need to manually create the service-linked role as you will be prompted on the License Manager console **Linux subscriptions** pages to create the role.

If you delete this service-linked role and then need to create it again, you can use the same process to recreate the role in your account.

You can also use the IAM console, AWS CLI, or IAM API to create a service-linked role manually. For more information, see [Creating a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#create-service-linked-role) in the *IAM User Guide*.

You can use the License Manager console to create a service-linked role.

**To create the service-linked role**

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 **Subscriptions** or **Instances**.

1. Agree to the terms for License Manager to create the Linux subscriptions role.

1. Choose **Create**. This creates the role.

You can also use the IAM console to create a service-linked role with the `License Manager - Linux subscriptions` use case. Alternatively, in the AWS CLI or AWS API, create a service-linked role with the `license-manager-linux-subscriptions.amazonaws.com` service name. For more information, see [Creating a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#create-service-linked-role) in the *IAM User Guide*. 

If you delete this service-linked role, you can use the same IAM process to create the role again.

## Edit a service-linked role for License Manager
<a name="edit-slr-linux-subscriptions"></a>

License Manager does not allow you to edit the `AWSServiceRoleForAWSLicenseManagerLinuxSubscriptionsService` service-linked role. After you create a service-linked role, you cannot change the name of the role because various entities might reference the role. However, you can edit the description of the role using IAM. For more information, see [Editing a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#edit-service-linked-role) in the *IAM User Guide*.

## Delete a service-linked role for License Manager
<a name="delete-slr-linux-subscriptions"></a>

If you no longer need to use a feature or service that requires a service-linked role, we recommend that you delete that role. That way, you only have entities that are actively monitored or maintained. However, you must clean up your service-linked role before you can manually delete it.

### Manually delete the service-linked role
<a name="slr-manual-delete-linux-subscriptions"></a>

Use the IAM console, AWS CLI, or AWS API to delete the `AWSServiceRoleForAWSLicenseManagerLinuxSubscriptionsService` service-linked role. For more information, see [Deleting a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#delete-service-linked-role) in the *IAM User Guide*.