0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AWS Control Towerを作ろうとして詰んだアクションとリカバリー方法

Last updated at Posted at 2025-02-20

AWS Control Towerを検証中に詰んだと思ったときの備忘録です。

再現方法

  1. 管理者ユーザー認証情報を使用して AWS マネジメントコンソールにサインインします
  2. AWS Control Tower コンソール (https://console.aws.amazon.com/controltower ) に移動します
  3. 目的のホームリージョンで作業していることを確認します
  4. [Set up landing zone] (ランディングゾーンの設定) を選択します
  5. コンソールの指示に従い、すべてのデフォルト値を受け入れます
    アカウント、ログアーカイブアカウント、監査アカウントの E メールアドレスに すでにAWSアカウントに登録済みのメールアドレス を入力します ←ここ

やらかしたこと

過去に閉鎖したAWSアカウントの登録メールアドレスとして使っていたものを、Control Towerが新規で作成するAWSアカウントのメールアドレスとして指定していた。

起きる事象

Control Towerのランディングゾーン設定の作成中にエラーとなり、再試行しようにもコンソールから変更できない状態になる。

AWS Control Tower はランディングゾーンを完全に設定できませんでした。AWS Control Tower cannot create an account using email {入力したメールアドレス} because an AWS account with that email already exists, but it is not part of your AWS Control Tower organization.

cannot_update_aws_account_mailaddress.png

リカバリー方法

AWSコンソールからだと完全に詰んだ状態で、サポートに問い合わせても(有償サポートじゃないというのもあり)、対応はしてくれなかった。

幸いCLIから見るとランディングゾーンは存在していたので削除してみると、コンソール上のエラーは消えた。

~ $ aws controltower list-landing-zones
{
    "landingZones": [
        {
            "arn": "arn:aws:controltower:ap-northeast-1:012345678901:landingzone/xxxxxxxxx"
        }
    ]
}
~ $ aws controltower delete-landing-zone --landing-zone-identifier  arn:aws:controltower:ap-northeast-1:012345678901:landingzone/xxxxxxxxx
{
    "operationIdentifier": "xxxxx-xxxx-xxxx-xxxx-xxxxx"
}

クリーンアップ

これだけだと再度ランディングゾーンの設定フローを行ったときにリソースが衝突するため、クリーンアップを行う必要があります。

ログ記録アカウントまたは監査アカウントに指定された E メールアドレスが既存の AWS アカウントに関連付けられている場合、セットアップは失敗します。 AWS アカウントを閉鎖することも、別の E メールアドレスを使用してランディングゾーンを再度セットアップすることもできます。

この状況になってようやく気づいたんですが、ドキュメントに書いてあるんですね……
前例があるならサポートで回答欲しかったが。

ひとまずこれをやっておけばドキュメント上は解消されるようなので、綺麗にしてからまたControl Towerの設定を入れてみようと思います。

参考:CloudTrailのログ

自力でクリーンアップしようと思ってたときにメモしたもの。
Control Towerのランディングゾーン設定フロー(エラーで止まるまで)が行われたときのログ。

OUが作られていたり、失敗したAWSアカウント作成のログがない。
Organizationに関わるものは出力されない仕様だったっけ?
とにかくクリーンアップのドキュメントはこのあたりを補完してくれている存在なのだろう。

SetupLandingZone	2月 17, 2025, 17:47:59 (UTC+09:00)	controltower.amazonaws.com
AssociateProfile	2月 17, 2025, 17:47:13 (UTC+09:00)	sso.amazonaws.com
AssociateProfile	2月 17, 2025, 17:47:12 (UTC+09:00)	sso.amazonaws.com
AssociateProfile	2月 17, 2025, 17:47:11 (UTC+09:00)	sso.amazonaws.com
AssociateProfile	2月 17, 2025, 17:47:11 (UTC+09:00)	sso.amazonaws.com
AssociateProfile	2月 17, 2025, 17:47:10 (UTC+09:00)	sso.amazonaws.com
GetProfile, CreateProfile, UpdateProfile	2月 17, 2025, 17:47:09 (UTC+09:00)	sso.amazonaws.com
GetProfile, CreateProfile, UpdateProfile	2月 17, 2025, 17:47:07 (UTC+09:00)	sso.amazonaws.com
GetProfile, CreateProfile, UpdateProfile	2月 17, 2025, 17:47:06 (UTC+09:00)	sso.amazonaws.com
GetProfile, CreateProfile, UpdateProfile	2月 17, 2025, 17:47:04 (UTC+09:00)	sso.amazonaws.com
GetProfile, CreateProfile, UpdateProfile	2月 17, 2025, 17:47:03 (UTC+09:00)	sso.amazonaws.com
GetTrust, CreateTrust, UpdateTrust	2月 17, 2025, 17:47:01 (UTC+09:00)	sso.amazonaws.com
GetApplicationInstance, CreateApplicationInstance	2月 17, 2025, 17:47:00 (UTC+09:00)	sso.amazonaws.com
AddMemberToGroup	2月 17, 2025, 17:46:59 (UTC+09:00)	sso-directory.amazonaws.com
AddMemberToGroup	2月 17, 2025, 17:46:59 (UTC+09:00)	sso-directory.amazonaws.com
CreateUser	2月 17, 2025, 17:46:58 (UTC+09:00)	sso-directory.amazonaws.com
PutPermissionsPolicy	2月 17, 2025, 17:46:57 (UTC+09:00)	sso.amazonaws.com
CreatePermissionSet	2月 17, 2025, 17:46:57 (UTC+09:00)	sso.amazonaws.com
PutPermissionsPolicy	2月 17, 2025, 17:46:56 (UTC+09:00)	sso.amazonaws.com
PutPermissionsPolicy	2月 17, 2025, 17:46:56 (UTC+09:00)	sso.amazonaws.com
PutPermissionsPolicy	2月 17, 2025, 17:46:56 (UTC+09:00)	sso.amazonaws.com
CreatePermissionSet	2月 17, 2025, 17:46:56 (UTC+09:00)	sso.amazonaws.com
CreatePermissionSet	2月 17, 2025, 17:46:56 (UTC+09:00)	sso.amazonaws.com
CreatePermissionSet	2月 17, 2025, 17:46:56 (UTC+09:00)	sso.amazonaws.com
CreatePermissionSet	2月 17, 2025, 17:46:55 (UTC+09:00)	sso.amazonaws.com
PutPermissionsPolicy	2月 17, 2025, 17:46:55 (UTC+09:00)	sso.amazonaws.com
CreatePermissionSet	2月 17, 2025, 17:46:55 (UTC+09:00)	sso.amazonaws.com
PutPermissionsPolicy	2月 17, 2025, 17:46:55 (UTC+09:00)	sso.amazonaws.com
PutPermissionsPolicy	2月 17, 2025, 17:46:55 (UTC+09:00)	sso.amazonaws.com
CreateGroup	2月 17, 2025, 17:46:54 (UTC+09:00)	sso-directory.amazonaws.com
CreateGroup	2月 17, 2025, 17:46:54 (UTC+09:00)	sso-directory.amazonaws.com
CreateGroup	2月 17, 2025, 17:46:53 (UTC+09:00)	sso-directory.amazonaws.com
CreateGroup	2月 17, 2025, 17:46:53 (UTC+09:00)	sso-directory.amazonaws.com
CreateGroup	2月 17, 2025, 17:46:52 (UTC+09:00)	sso-directory.amazonaws.com
SetupLandingZone	2月 17, 2025, 17:45:56 (UTC+09:00)	controltower.amazonaws.com
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?