0
0

クロスアカウントクロスリージョンの設定方法

Last updated at Posted at 2024-06-28

設定方法

(1)各アカウントでCloudWatch データを共有を行う

スクリーンショット 2024-06-28 10.16.19.png

CloudFormaitonで指定する値
Policy:CloudWatch-and-AutomaticDashboards

作成されるIAMロール情報
ロール名:CloudWatch-CrossAccountSharingRole
ポリシー:CloudWatchAutomaticDashboardsAccess
ポリシー:CloudWatchReadOnlyAccess

信頼関係

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::<モニタリングアカウントID>:root"
            },
            "Action": "sts:AssumeRole"
        }
    ]
}

データ共有したいアカウントを入力してテンプレートを起動させる
スクリーンショット 2024-06-28 10.17.45.png

(2)モニタリングアカウントで以下設定を行う

クロスアカウントクロスリージョンを表示を有効にする
スクリーンショット 2024-06-28 10.11.54.png

コンソールにセレクタを表示するとAWS 組織アカウントセレクタにチェックをいれて有効にすること
スクリーンショット 2024-06-28 10.12.54.png

作成されるIAMロール
IAMロール名:AWSServiceRoleForCloudWatchCrossAccount
説明:Allows CloudWatch to assume CloudWatch-CrossAccountSharing roles in remote accounts on behalf of the current account in order to display data cross-account, cross region
ポリシー:CloudWatch-CrossAccountAccess
信頼関係

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "cloudwatch-crossaccount.amazonaws.com"
            },
            "Action": "sts:AssumeRole"
        }
    ]
}

組織のアカウントリストをルートアカウント以外に共有する

作成されるもの

CloudWatch-CrossAccountSharing-ListAccountsRole
カスタマーインライン:CloudWatch-CrossAccountSharing-ListAccounts-Policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "organizations:ListAccounts",
                "organizations:ListAccountsForParent"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

信頼関係

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::211125665348:root"
            },
            "Action": "sts:AssumeRole"
        }
    ]
}

戻しの作業

(1)各アカウントでCloudFormationsの削除
(2)モニタリングアカウントで以下ロールを削除
→AWSServiceRoleForCloudWatchCrossAccount

番外編

モニタリングアカウントをルートアカウント以外にしたい場合

作成されるIAMロール

IAMロール名:CloudWatch-CrossAccountSharing-ListAccountsRole
説明:なし
インラインポリシー:CloudWatch-CrossAccountSharing-ListAccounts-Policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "organizations:ListAccounts",
                "organizations:ListAccountsForParent"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

信頼関係

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::xxxx:root"
            },
            "Action": "sts:AssumeRole"
        }
    ]
}
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