I'm trying to list all the recovery points in a AWS Backup vault from the CLI. Running into following error:
An error occurred (AccessDeniedException) when calling the ListRecoveryPointsByBackupVault operation: Insufficient privileges to perform this action.
Having a hard time figuring out what permissions are required to get this working. I've added backup:ListRecoveryPointsByBackupVault permissions. Also, I was looking for a backup policy for I could use as a reference or documentation? not had much luck with searching online regarding what are all the permissions needed to get this working. Any help would be much appreciated!!
Here is my bash:
#!/bin/bash
CURRENTregion=$(aws configure get region)
#GET LIST OF RECOVERY POINTS FROM VAULT
getRecoveryPoints(){
echo "Enter the name of the vault you want to list"
read VAULT_NAME
aws backup list-recovery-points-by-backup-vault --backup-vault-name "$\{VAULT_NAME\}" --query 'RecoveryPoints[*].RecoveryPointArn' --output text > RecoveryPointsList
}
getRecoveryPoints
"$\{VAULT_NAME\}"
-> only $
should be escaped not the vault name ( as OP mentioned)