

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 在 License Manager 中共用自我管理的授權
<a name="share-license-configuration"></a>

您可以使用 與任何 AWS 帳戶或透過 AWS Resource Access Manager 共用自我管理的授權 AWS Organizations。如需詳細資訊，請參閱*AWS RAM 《 使用者指南*》中的[共用您的 AWS 資源](https://docs.aws.amazon.com/ram/latest/userguide/getting-started-sharing.html)。

## 與 AWS Organization 共用自我管理的授權
<a name="share-license-configuration-with-org"></a>

**先決條件**  
若要完成此程序，您必須將 AWS Organization 與 License Manager 連結。如需詳細資訊，請參閱[License Manager 中的受管授權設定](settings-managed-licenses.md)。

**共用您的授權**  
若要與 AWS Organization 共用自我管理授權，請遵循下列步驟：

1. 在 https：//[https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/) 開啟 License Manager 主控台。

1. 在左側導覽窗格中，選擇**自我管理授權**。

1. 選取自我管理的授權。

1. 從**動作**功能表中選擇**與 AWS 組織帳戶共用**。

## 支援的帳戶配額
<a name="share-license-configuration-quotas"></a>

如果您在 2023 年 10 月 14 AWS License Manager 日之前在 中啟用授權共用，則授權管理員在組織內支援的最大帳戶數量配額將小於新的預設上限。您可以使用下一節提供的 的 API 操作 AWS RAM 來增加此配額。如需 License Manager 預設配額的詳細資訊，請參閱 *AWS 一般參考 指南*中的[使用授權的配額](https://docs.aws.amazon.com/general/latest/gr/licensemanager.html#limits_license-manager)。

### 先決條件
<a name="share-license-configuration-quotas-prerequisites"></a>

若要完成下列程序，您必須以具有下列許可的組織管理帳戶中的委託人身分登入：
+ `ram:EnableSharingWithAwsOrganization`
+ `iam:CreateServiceLinkedRole`
+ `organizations:enableAWSServiceAccess`
+ `organizations:DescribeOrganization`

### 增加支援的帳戶配額
<a name="share-license-configuration-quotas-increase"></a>

下列程序會將 的目前配額增加`Number of accounts per organization for License Manager`為目前的預設最大值。

**增加 License Manager 支援的帳戶配額**

1. 使用 [https://docs.aws.amazon.com/cli/latest/reference/organizations/describe-organization.html](https://docs.aws.amazon.com/cli/latest/reference/organizations/describe-organization.html) AWS CLI 命令，透過 操作來判斷組織的 ARN：

   ```
   aws organizations describe-organization
   
   {
   	"Organization": {
   		"Id": "o-abcde12345",
   		"Arn": "arn:aws:organizations::111122223333:organization/o-abcde12345",
   		"FeatureSet": "ALL",
   		"MasterAccountArn": "arn:aws:organizations::111122223333:account/o-abcde12345/111122223333",
   		"MasterAccountId": "111122223333",
   		"MasterAccountEmail": "name+orgsidentifier@example.com",
   		"AvailablePolicyTypes": [
   				{
   					"Type": "SERVICE_CONTROL_POLICY",
   					"Status": "ENABLED"
   				}
   		]
   	}
   }
   ```

1. 使用 [https://docs.aws.amazon.com/cli/latest/reference/ram/get-resource-shares.html](https://docs.aws.amazon.com/cli/latest/reference/ram/get-resource-shares.html) AWS CLI 命令，透過 操作來判斷組織的 ARN：

   ```
   aws ram  get-resource-shares --resource-owner SELF --tag-filters tagKey=Service,tagValues=LicenseManager --region us-east-1
   
   {
   	"resourceShares": [
   		{
   				"resourceShareArn": "arn:aws:ram:us-east-1:111122223333:resource-share/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
   				"name": "licenseManagerResourceShare-111122223333",
   				"owningAccountId": "111122223333",
   				"allowExternalPrincipals": true,
   				"status": "ACTIVE",
   				"tags": [
   					{
   						"key": "Service",
   						"value": "LicenseManager"
   					}
   				],
   				"creationTime": "2023-10-04T12:52:10.021000-07:00",
   				"lastUpdatedTime": "2023-10-04T12:52:10.021000-07:00",
   				"featureSet": "STANDARD"
   		}
   	]
   }
   ```

1. 使用 [https://docs.aws.amazon.com/cli/latest/reference/ram/enable-sharing-with-aws-organization.html](https://docs.aws.amazon.com/cli/latest/reference/ram/enable-sharing-with-aws-organization.html) AWS CLI 命令來啟用資源共用 AWS RAM：

   ```
   aws ram enable-sharing-with-aws-organization
   
   {
   	"returnValue": true
   }
   ```

   您可以使用 [https://docs.aws.amazon.com/cli/latest/reference/organizations/list-aws-service-access-for-organization.html](https://docs.aws.amazon.com/cli/latest/reference/organizations/list-aws-service-access-for-organization.html) AWS CLI 命令來驗證已為 License Manager 啟用 Organizations 列出服務主體，以及 AWS RAM：

   ```
   aws organizations list-aws-service-access-for-organization
   
   {
   	"EnabledServicePrincipals": [
   		{
   				"ServicePrincipal": "license-manager.amazonaws.com",
   				"DateEnabled": "2023-10-04T12:50:59.814000-07:00"
   		},
   		{
   				"ServicePrincipal": "license-manager.member-account.amazonaws.com",
   				"DateEnabled": "2023-10-04T12:50:59.565000-07:00"
   		},
   		{
   				"ServicePrincipal": "ram.amazonaws.com",
   				"DateEnabled": "2023-10-04T13:06:34.771000-07:00"
   		}
   	]
   }
   ```
**重要**  
 最多可能需要六個小時， AWS RAM 才能為您的組織完成此操作。此程序必須先完成，您才能繼續。

1. 使用 [https://docs.aws.amazon.com/cli/latest/reference/ram/associate-resource-share.html](https://docs.aws.amazon.com/cli/latest/reference/ram/associate-resource-share.html) AWS CLI 命令將 License Manager 資源共用與組織建立關聯：

   ```
   aws ram associate-resource-share --resource-share-arn arn:aws:ram:us-east-1:111122223333:resource-share/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 --principals arn:aws:organizations::111122223333:organization/o-abcde12345 --region us-east-1
   
   {
   	"resourceShareAssociations": [
   		{
   				"resourceShareArn": "arn:aws:ram:us-east-1:111122223333:resource-share/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
   				"associatedEntity": "arn:aws:organizations::111122223333:organization/o-abcde12345",
   				"associationType": "PRINCIPAL",
   				"status": "ASSOCIATING",
   				"external": false
   		}
   	]
   }
   ```

   您可以使用 [https://docs.aws.amazon.com/cli/latest/reference/ram/get-resource-share-associations.html](https://docs.aws.amazon.com/cli/latest/reference/ram/get-resource-share-associations.html) AWS CLI 命令來驗證資源共享關聯的 `status`是 `ASSOCIATED`：

   ```
   aws ram get-resource-share-associations --association-type "PRINCIPAL" --principal arn:aws:organizations::111122223333:organization/o-abcde12345--resource-share-arns arn:aws:ram:us-east-1:111122223333:resource-share/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 --region us-east-1
   				
   {
   	"resourceShareAssociations": [
   		{
   				"resourceShareArn": "arn:aws:ram:us-east-1:111122223333:resource-share/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
   				"resourceShareName": "licenseManagerResourceShare-111122223333",
   				"associatedEntity": "arn:aws:organizations::111122223333:organization/o-abcde12345",
   				"associationType": "PRINCIPAL",
   				"status": "ASSOCIATED",
   				"creationTime": "2023-10-04T13:12:33.422000-07:00",
   				"lastUpdatedTime": "2023-10-04T13:12:34.663000-07:00",
   				"external": false
   		}
   	]
   }
   ```