

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

# 使用 接受或拒絕帳戶邀請 AWS Organizations
<a name="orgs_manage_accounts_accept-decline-invite"></a>

如果您收到加入組織的邀請，您可以接受或拒絕邀請。

## 考量事項
<a name="orgs_manage_accounts_accept-decline-invite-considerations"></a>

**組織帳戶的狀態會影響可看見的成本和用量資料**

如果成員帳戶離開組織而成為獨立帳戶，則帳戶一旦是組織之成員就無法再存取時間範圍內的成本和用量資料。帳戶只能存取做為獨立帳戶時所產生的資料。

如果成員帳戶離開組織 A 而加入組織 B，則此帳戶就無法再存取其做為組織 A 成員之時間範圍內來自組織 A 的成本和用量資料。帳戶只能存取做為組織 B 成員時所產生的資料。

如果帳戶重新加入先前所屬的組織，此帳戶會重新獲得對其過去成本與使用狀況資料的存取權。

**只有成員帳戶和獨立帳戶可以接受或拒絕邀請**

只有成員帳戶和獨立帳戶可接受或拒絕加入組織的邀請。如果邀請傳送到已屬於組織的管理帳戶，則該帳戶將無法檢視邀請，直到他們[從組織中移除所有成員帳戶](orgs_manage_accounts_remove.md)並[刪除組織](orgs_manage_org_delete.md)為止。

**CloudTrail 記錄會在採取 動作的帳戶中進行 **

如果成員帳戶或獨立帳戶接受或拒絕帳戶邀請，則該動作會記錄在動作帳戶的 CloudTrail 日誌中。如果代理帳戶是成員帳戶，則該動作將不會記錄在管理帳戶的 CloudTrail 日誌中。這與相關案例中的 CloudTrail 記錄一致 （例如 離開組織的成員帳戶將記錄在成員帳戶追蹤中，移除成員帳戶的管理帳戶將記錄在管理帳戶追蹤中）。

## 接受或拒絕帳戶邀請
<a name="orgs_manage_accounts_accept-decline-invite-steps"></a>

若要接受或拒絕邀請，請完成下列步驟。

**最低許可**  
若要接受或拒絕加入 組織的邀請，您必須擁有以下許可：  
`organizations:ListHandshakesForAccount` – 在 AWS Organizations 主控台中查看邀請清單時需要。
`organizations:AcceptHandshake`.
`organizations:DeclineHandshake`.
`organizations:LeaveOrganization` – 只有在您的帳戶已經是組織的成員時，才需要接受邀請。
`iam:CreateServiceLinkedRole` – 只有在接受邀請需要在成員帳戶中建立服務連結角色以支援與其他 整合時才需要 AWS 服務。如需詳細資訊，請參閱[AWS Organizations 和服務連結角色](orgs_integrate_services.md#orgs_integrate_services-using_slrs)。

------
#### [ AWS 管理主控台 ]

**接受或拒絕邀請**

1. 加入組織的邀請會傳送到帳戶擁有者的電子郵件地址。如果您是帳戶擁有者，而且您收到邀請電子郵件訊息，請依照電子郵件邀請中的指示，或前往您的瀏覽器中的 [AWS Organizations 主控台](https://console.aws.amazon.com/organizations/v2)，然後選擇 **Invitations** (邀請)，或直接前往**[成員帳戶的邀請](https://console.aws.amazon.com/organizations/v2/home/invitations)**頁面。

1. 如果提示，請以擔任 IAM 角色的 IAM 使用者身分登入或以帳戶的根使用者身分登入 ([不建議](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials)) 獲邀請的帳戶。

1. **[會員帳戶的邀請](https://console.aws.amazon.com/organizations/v2/home/invitations)**頁面顯示您的帳戶加入組織的未結邀請。

   選擇 **Accept invitation** (接受邀請) 或 **Decline invitation** (拒絕邀請)。
   + 如果您在之前的步驟中選擇 **Accept invitation** (接受邀請)，主控台會將您重新導向至 [Organization 概觀](https://console.aws.amazon.com/organizations/v2/home/dashboard)頁面，其中含有您的帳戶現在為其成員的組織的詳細資訊。您可以檢視組織的 ID 和擁有者的電子郵件地址。
**注意**  
已接受的邀請會繼續在清單中顯示 30 天。之後便會刪除它們，不再顯示在清單中。

     AWS Organizations 會在新成員帳戶中自動建立服務連結角色，以支援 AWS Organizations 和其他 之間的整合 AWS 服務。如需詳細資訊，請參閱[AWS Organizations 和服務連結角色](orgs_integrate_services.md#orgs_integrate_services-using_slrs)。

     AWS 會傳送電子郵件訊息給組織的管理帳戶的擁有者，說明您已接受邀請。它還會傳送一封電子郵件訊息給帳戶擁有者，說明帳戶現在為組織的成員。
   + 如果您在前面的步驟中選擇 **Decline** (拒絕)，則您的帳戶會維持在列出任何其他等待中邀請的**[成員帳戶邀請](https://console.aws.amazon.com/organizations/v2/home/invitations)**頁面上。

     AWS 會傳送電子郵件訊息給組織的管理帳戶擁有者，說明您拒絕邀請。
**注意**  
已拒絕的邀請會繼續在清單中顯示 30 天。之後便會刪除它們，不再顯示在清單中。

------
#### [ AWS CLI & AWS SDKs ]

**接受或拒絕邀請**  
您可以使用以下命令來接受或拒絕邀請：
+ AWS CLI: [accept-handshake](https://docs.aws.amazon.com/cli/latest/reference/organizations/accept-handshake.html), [decline-handshake](https://docs.aws.amazon.com/cli/latest/reference/organizations/decline-handshake.html) 

  下列範例顯示如何接受對加入組織的邀請。

  ```
  $ aws organizations accept-handshake --handshake-id h-examplehandshakeid111
  {
      "Handshake": {
          "Action": "INVITE",
          "Arn": "arn:aws:organizations::111111111111:handshake/o-exampleorgid/invite/h-examplehandshakeid111",
          "RequestedTimestamp": 1481656459.257,
          "ExpirationTimestamp": 1482952459.257,
          "Id": "h-examplehandshakeid111",
          "Parties": [
              {
                  "Id": "o-exampleorgid",
                  "Type": "ORGANIZATION"
              },
              {
                  "Id": "juan@example.com",
                  "Type": "EMAIL"
              }
          ],
          "Resources": [
              {
                  "Resources": [
                      {
                          "Type": "MASTER_EMAIL",
                          "Value": "bill@amazon.com"
                      },
                      {
                          "Type": "MASTER_NAME",
                          "Value": "Management Account"
                      },
                      {
                          "Type": "ORGANIZATION_FEATURE_SET",
                           "Value": "ALL"
                      }
                  ],
                  "Type": "ORGANIZATION",
                  "Value": "o-exampleorgid"
              },
              {
                  "Type": "EMAIL",
                  "Value": "juan@example.com"
              }
          ],
          "State": "ACCEPTED"
      }
  }
  ```

  下列範例顯示如何拒絕對加入組織的邀請。
+ AWS SDKs：[AcceptHandshake](https://docs.aws.amazon.com/organizations/latest/APIReference/API_AcceptHandshake.html)、[DeclineHandshake](https://docs.aws.amazon.com/organizations/latest/APIReference/API_DeclineHandshake.html)

------