

# Amazon Application Migration Service (Application Migration Service) and Amazon Organizations
<a name="services-that-can-integrate-application-migration"></a>

Amazon Application Migration Service simplifies, expedites, and reduces the cost of migrating applications to Amazon. By integrating with Organizations, you can use the global view feature to manage large-scale migrations across multiple accounts. For more information see [ Setting up your Amazon Organizations](https://docs.amazonaws.cn/mgn/latest/ug/setting-up-organizations.html) in the *Application Migration Service user guide*. 

Use the following information to help you integrate Amazon Application Migration Service with Amazon Organizations.



## Service-linked roles created when you enable integration
<a name="integrate-enable-slr-application-migration"></a>

The following [service-linked role](https://docs.amazonaws.cn/IAM/latest/UserGuide/using-service-linked-roles.html) is automatically created in your organization's management account when you enable trusted access. This role allows Application Migration Service to perform supported operations within your organization's accounts in your organization.

You can delete or modify this role only if you disable trusted access between Application Migration Service and Organizations, or if you remove the member account from the organization.
+ `AWSServiceRoleForApplicationMigrationService `

## Service principals used by Application Migration Service
<a name="integrate-enable-svcprin-application-migration"></a>

The service-linked role in the previous section can be assumed only by the service principals authorized by the trust relationships defined for the role. The service-linked roles used by Application Migration Service grant access to the following service principals:
+ `mgn.amazonaws.com`

## Enabling trusted access with Application Migration Service
<a name="integrate-enable-ta-application-migration"></a>

When you enable trusted access with Application Migration Service you can use the global view feature, which allows you to manage large-scale migrations across multiple accounts. Global view provides visibility and the ability to perform specific actions on source servers, apps, and waves in different Amazon accounts. For more information, see [Setting up your Amazon Organizations](https://docs.amazonaws.cn/mgn/latest/ug/setting-up-organizations.html) in the *Amazon Application Migration Service user guide*.

For information about the permissions needed to enable trusted access, see [Permissions required to enable trusted access](orgs_integrate_services.md#orgs_trusted_access_perms).

You can enable trusted access using either the Amazon Application Migration Service console or the Amazon Organizations console.

**Important**  
We strongly recommend that whenever possible, you use the Amazon Application Migration Service console or tools to enable integration with Organizations. This lets Amazon Application Migration Service perform any configuration that it requires, such as creating resources needed by the service. Proceed with these steps only if you can’t enable integration using the tools provided by Amazon Application Migration Service. For more information, see [this note](orgs_integrate_services.md#important-note-about-integration).   
If you enable trusted access by using the Amazon Application Migration Service console or tools then you don’t need to complete these steps.

You can enable trusted access by using either the Amazon Organizations console, by running a Amazon CLI command, or by calling an API operation in one of the Amazon SDKs.

------
#### [ Amazon Web Services Management Console ]

**To enable trusted service access using the Organizations console**

1. Sign in to the [Amazon Organizations console](https://console.amazonaws.cn/organizations/v2). You must sign in as an IAM user, assume an IAM role, or sign in as the root user ([not recommended](https://docs.amazonaws.cn/IAM/latest/UserGuide/best-practices.html#lock-away-credentials)) in the organization’s management account.

1. In the navigation pane, choose **Services**.

1. Choose **Amazon Application Migration Service** in the list of services.

1. Choose **Enable trusted access**.

1. In the **Enable trusted access for Amazon Application Migration Service** dialog box, type **enable** to confirm, and then choose **Enable trusted access**.

1. If you are the administrator of only Amazon Organizations, tell the administrator of Amazon Application Migration Service that they can now enable that service to work with Amazon Organizations from the service console .

------
#### [ Amazon CLI, Amazon API ]

**To enable trusted service access using the OrganizationsCLI/SDK**  
Use the following Amazon CLI commands or API operations to enable trusted service access:
+ Amazon CLI: [enable-aws-service-access](https://docs.amazonaws.cn/cli/latest/reference/organizations/enable-aws-service-access.html)

  Run the following command to enable Amazon Application Migration Service as a trusted service with Organizations.

  ```
  $ aws organizations enable-aws-service-access \ 
      --service-principal mgn.amazonaws.com
  ```

  This command produces no output when successful.
+ Amazon API: [EnableAWSServiceAccess](https://docs.amazonaws.cn/organizations/latest/APIReference/API_EnableAWSServiceAccess.html)

------

## Disabling trusted access with Application Migration Service
<a name="integrate-disable-ta-application-migration"></a>

Only an administrator in the Organizations management account can disable trusted access with Application Migration Service. 

You can disable trusted access using either the Amazon Application Migration Service or the Amazon Organizations tools.

**Important**  
We strongly recommend that whenever possible, you use the Amazon Application Migration Service console or tools to disable integration with Organizations. This lets Amazon Application Migration Service perform any clean up that it requires, such as deleting resources or access roles that are no longer needed by the service. Proceed with these steps only if you can’t disable integration using the tools provided by Amazon Application Migration Service.  
If you disable trusted access by using the Amazon Application Migration Service console or tools then you don’t need to complete these steps.

You can disable trusted access by using either the Amazon Organizations console, by running an Organizations Amazon CLI command, or by calling an Organizations API operation in one of the Amazon SDKs.

------
#### [ Amazon Web Services Management Console ]

**To disable trusted service access using the Organizations console**

1. Sign in to the [Amazon Organizations console](https://console.amazonaws.cn/organizations/v2). You must sign in as an IAM user, assume an IAM role, or sign in as the root user ([not recommended](https://docs.amazonaws.cn/IAM/latest/UserGuide/best-practices.html#lock-away-credentials)) in the organization’s management account.

1. In the navigation pane, choose **Services**.

1. Choose **Amazon Application Migration Service** in the list of services.

1. Choose **Disable trusted access**.

1. In the **Disable trusted access for Amazon Application Migration Service** dialog box, type **disable** to confirm, and then choose **Disable trusted access**.

1. If you are the administrator of only Amazon Organizations, tell the administrator of Amazon Application Migration Service that they can now disable that service from working with Amazon Organizations using the service console or tools .

------
#### [ Amazon CLI, Amazon API ]

**To disable trusted service access using the Organizations CLI/SDK**  
You can use the following Amazon CLI commands or API operations to disable trusted service access:
+ Amazon CLI: [disable-aws-service-access](https://docs.amazonaws.cn/cli/latest/reference/organizations/disable-aws-service-access.html)

  Run the following command to disable Amazon Application Migration Service as a trusted service with Organizations.

  ```
  $ aws organizations disable-aws-service-access \
      --service-principal mgn.amazonaws.com
  ```

  This command produces no output when successful.
+ Amazon API: [DisableAWSServiceAccess](https://docs.amazonaws.cn/organizations/latest/APIReference/API_DisableAWSServiceAccess.html)

------

## Enabling a delegated administrator account for Application Migration Service
<a name="integrate-enable-da-application-migration"></a>

When you designate a member account as a delegated administrator for the organization, users and roles from that account can perform administrative actions for Application Migration Service that otherwise can be performed only by users or roles in the organization's management account. This helps you to separate management of the organization from management of Application Migration Service. For more information see [ Setting up your Amazon Organizations](https://docs.amazonaws.cn/mgn/latest/ug/setting-up-organizations.html) in the *Application Migration Service user guide*. 

**Minimum permissions**  
Only a user or role in the Organizations management account can configure a member account as a delegated administrator for Application Migration Service in the organization

------
#### [ Amazon CLI, Amazon API ]

If you want to configure a delegated administrator account using the Amazon CLI or one of the Amazon SDKs, you can use the following commands:
+ Amazon CLI: 

  ```
  $ aws organizations register-delegated-administrator \
      --account-id 123456789012 \
      --service-principal mgn.amazonaws.com
  ```
+ Amazon SDK: Call the Organizations `RegisterDelegatedAdministrator` operation and the member account's ID number and identify the account service `mgn.amazonaws.com` as parameters. 

------

## Disabling a delegated administrator for Application Migration Service
<a name="integrate-disable-da-application-migration"></a>

 Only an administrator in the Organizations management account can remove a delegated administrator for Application Migration Service. You can remove the delegated administrator using the Organizations `DeregisterDelegatedAdministrator` CLI or SDK operation. 