はじめに
AWS Backupの権限分掌の設計を行うにあたって、それぞれの機能の設定をどのロールの人が実施できるのか明確化するために確認したものです。
確認結果としては、「バックアップポリシー」と「クロスアカウントモニタリング」はAWS Organizationsの機能、「クロスアカウントでバックアップ」はAWS Backupの機能でした。(マネコンだとAWS Backupの画面にOrganizationsの機能が統合されていて、利用者からすると便利ですが、権限設計する側からするとわかりずらくてつらい。)
設定方法
バックアップポリシーの有効/無効
バックアップポリシーは、Organizationの中でバックアップを一元管理するための機能です。
こちらの機能は、AWS Organizationsの機能のため、AWS OrganizationsのAPIで操作します。(AWS Backupの機能ではない)
#有効化 RootId=$(aws --output text organizations list-roots --query 'Roots[].Id' ) aws organizations enable-policy-type --root-id ${RootId} --policy-type "BACKUP_POLICY" #無効化 RootId=$(aws --output text organizations list-roots --query 'Roots[].Id' ) aws organizations disable-policy-type --root-id ${RootId} --policy-type "BACKUP_POLICY" #状態確認 aws organizations list-roots
クロスアカウントモニタリングの有効/無効
クロスアカウントモニタリングは、Organizationsの管理アカウントから、組織内のすべてのアカウントのバックアップアクティビティをモニタリングする機能です。こちらもAWS OrganizationsのAPIで操作します。(AWS Backupの機能ではない)
#有効化 aws organizations enable-aws-service-access --service-principal backup.amazonaws.com #無効化 aws organizations disable-aws-service-access --service-principal backup.amazonaws.com #状態確認(リストにbackup.amazonaws.comがあればEnable、なければDisable) aws organizations list-aws-service-access-for-organization
クロスアカウントバックアップ有効/無効
クロスアカウントでバックアップ(リカバリーポイント)をコピーする機能です。こちらはAWS Backupの機能ですので、AWS BackupのAPIで操作します。
グロスアカウントの具体的設定方法については、こちらを参照下しさい。
#有効化 aws backup update-global-settings --global-settings '{"isCrossAccountBackupEnabled":"true"}' #無効化 aws backup update-global-settings --global-settings '{"isCrossAccountBackupEnabled":"false"}' #状態参照 aws backup describe-global-settings
なお本機能はバックアップを他のアカウントにコピーするだけです。他のアカウントのバックアップデータを利用してリストアすることはできません。
AWS Backup does not support recovering resources from one AWS account to another. However, you can copy a backup from one account to a different account and then restore it in that account. For example, you can't restore a backup from account A to account B, but you can copy a backup from account A to account B, and then restore it in account B.
https://docs.aws.amazon.com/aws-backup/latest/devguide/recov-point-create-a-copy.html#restore-cabより引用