aws backupをAWS CLIコマンドで実行する

              図A システム構成図
              図Bバックアップボールドの作成
上記URLに記載があるように、次のポリシー2つをアタッチしたロールを作成
・AWSBackupServiceRolePolicyForBackup
・AWSBackupServiceRolePolicyForRestores
aws backup start-backup-job --backup-vault-name バックアップボールド名 \
--resource-arn arn:aws:ec2:ap-northeast-1:123456789012:instance/インスタンスid
 \
--iam-role-arn arn:aws:iam::123456789012:role/作成したロール名  \
--region ap-northeast-1
$./aws_backup
{
    "BackupJobId": "9905344f-40b9-4a35-941e-40bae97adf99",
    "CreationDate": "2024-01-12T13:44:12.548000+09:00",
    "IsParent": false
}
$./aws_backup

An error occurred (AccessDeniedException) when calling the StartBackupJob operation: Insufficient privileges to perform this action.
$aws backup describe-backup-job --backup-job-id 9905344f-40b9-4a35-941e-40bae97adf99
{
    "AccountId": "123456789012",
    "BackupJobId": "9905344f-40b9-4a35-941e-40bae97adf99",
    "BackupVaultName": "backp_xxxx",
    "BackupVaultArn": "arn:aws:backup:ap-northeast-1:123456789012:backup-vault:backp_xxxx",
    "RecoveryPointArn": "arn:aws:ec2:ap-northeast-1::image/ami-xxxxxxxxxxxxxxxxx",
    "ResourceArn": "arn:aws:ec2:ap-northeast-1:123456789012:instance/i-xxxxxxxxxxxxxxxxx",
    "CreationDate": "2024-01-12T13:44:12.548000+09:00",
    "CompletionDate": "2024-01-12T13:48:18.497000+09:00",
    "State": "COMPLETED",
    "PercentDone": "100.0",
    "BackupSizeInBytes": 32212254720,
    "IamRoleArn": "arn:aws:iam::123456789012:role/backup-xxxx-role",
    "ResourceType": "EC2",
    "BytesTransferred": 0,
    "StartBy": "2024-01-12T21:44:12.548000+09:00",
    "IsParent": false,
    "ResourceName": "Ama_linux2_xxxxxx",
    "InitiationDate": "2024-01-12T13:44:12.835000+09:00",
    "MessageCategory": "SUCCESS"
}
              図C バックアップジョブの確認
            図D バックアップボールトが作成されている