

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

# 更新現有帳戶
<a name="aft-update-account"></a>

**自動註冊相容性**  
如果您的組織使用自動註冊進行自動帳戶註冊，請注意，AFT 對匯入這些帳戶有限制。透過自動註冊註冊的帳戶缺少 AFT 匯入工作流程所需的 Service Catalog 佈建產品。  
**解決方法：**使用註冊 OU 功能為自動註冊的帳戶建立佈建產品。這可為 AFT 自訂啟用必要的生命週期事件。

 您可以編輯先前提交的帳戶請求並執行 ，以更新 AFT 佈建的帳戶`git push`。此命令會叫用帳戶佈建工作流程，並可處理帳戶更新請求。您可以更新 的輸入`ManagedOrganizationalUnit`，這是 所需值的一部分`control_tower_parameters`。

`ManagedOrganizationalUnit` 是可在所有 中更新的唯一參數`control_tower_parameters`。不過，屬於帳戶請求 Terraform 檔案的其他參數可以更新，例如 `custom_fields`。如需詳細資訊，請參閱[使用 AFT 佈建新帳戶](https://docs.aws.amazon.com/controltower/latest/userguide/aft-provision-account.html)。

例如，若要更新 AFT 帳戶的名稱或電子郵件地址，您可以定義帳戶`custom_fields`請求檔案中的詳細資訊。透過這樣做，您可以建立 SSM 參數，您可以在全域自訂期間傳入`aws_account_alternate_contact`資源。

```
resource "aws_account_alternate_contact" "operations" {

  alternate_contact_type = "OPERATIONS"

  name          = "Example"
  title         = "Example"
  email_address = "someone@example.com"
  phone_number  = "+1234567890"
}
```

您可以為其他聯絡類型新增類似的欄位，例如操作和安全性。在全球自訂中，為每個自訂欄位新增資料查詢，以確保您查詢在帳戶請求中建立的所有欄位：

```
data "aws_ssm_parameter" "billing_name" {
            name = "/aft/account-request/custom-fields/billing_name"
            }
            
            data "aws_ssm_parameter" "billing_title" {
            name = "/aft/account-request/custom-fields/billing_title"
            }
            
            data "aws_ssm_parameter" "billing_email_address" {
            name = "/aft/account-request/custom-fields/billing_email_address"
            }
            
            data "aws_ssm_parameter" "billing_phone_number" {
            name = "/aft/account-request/custom-fields/billing_phone_number"
            }
```

最後，在全球自訂檔案中，建立替代聯絡人資源。您需要為您在帳戶請求中建立的每個聯絡類型定義其中一個區塊：

```
resource "aws_account_alternate_contact" "billing" {
            
            alternate_contact_type = "BILLING"
            
            name          = data.aws_ssm_parameter.billing_name.value
            title         = data.aws_ssm_parameter.billing_title.value
            email_address = data.aws_ssm_parameter.billing_email_address.value
            phone_number  = data.aws_ssm_parameter.billing_phone_number.value
            }
```

**注意**  
 您無法在帳戶佈建期間`control_tower_parameters`變更您為 提供的輸入。  
 在 **aft-account-request** 儲存庫`ManagedOrganizationalUnit`中指定 支援的格式包括 `OUName`和 `OUName (OU-ID)`。

## 更新 AFT 未佈建的帳戶
<a name="aft-update-account-not-provision"></a>

 您可以在 **aft-account-request** 儲存庫中指定帳戶，以更新在 AFT 外部建立的 AWS Control Tower 帳戶。

**注意**  
 確保所有帳戶詳細資訊皆正確且符合 AWS Control Tower 組織和個別 AWS Service Catalog 佈建的產品。

**AWS 帳戶 使用 AFT 更新現有 的先決條件**
+  AWS 帳戶 必須在 AWS Control Tower 中註冊。
+  AWS 帳戶 必須是 AWS Control Tower 組織的一部分。