This article needs help. It assumes a level of understanding of the tool that shouldn't be expected and is unclear as a result.
For anyone looking for more clear cut documentation, look here: https://cloudsbaba.com/how-can-i-get-notifications-for-aws-backup-jobs-that-completed-and-failed/
More helpful AWS docs also here: https://docs.aws.amazon.com/aws-backup/latest/devguide/sns-notifications.html
Thank you for your comment. We'll review and update the Knowledge Center article as needed.
Hello, I followed the documentation, but there are several issues with this:
- SNS filter policy must be "Message body" which is not mentioned in the article, and it is not the default selection.
- The filter policy is referencing the "State" but when I checked the CloudTrail message that was sent to the topic the state is all lowercase "state", which cost me a lot of time to figure this out.
For others facing a similar issue, this is the message filter that worked for me:
{
"state": [
{
"anything-but": [
"COMPLETED"
]
}
]
}
And this is a sample CloudTrail event with FAILED status for testing:
{
"completionDate": {
"seconds": 1700078469,
"nanos": 519000000
},
"state": "FAILED",
"percentDone": 100,
"restoreJobId": "XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX",
"backupVaultName": "daily",
"backupVaultArn": "arn:aws:backup:eu-central-1:000000000000:backup-vault:daily",
"recoveryPointArn": "arn:aws:backup:eu-central-1:000000000000:recovery-point:XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX",
"resourceArn": "arn:aws:dynamodb:eu-central-1:000000000000:table/mytable",
"creationDate": {
"seconds": 1700078313,
"nanos": 329000000
},
"backupSizeInBytes": 847,
"iamRoleArn": "arn:aws:iam::000000000000:role/backup_role",
"resourceType": "DynamoDB"
}
Thank you for your comment. We'll review and update the Knowledge Center article as needed.
The above doesn't work without a few modifications for the failed backup job.
With the below CLI command, you need to replace BACKUP_JOB_COMPLETED with BACKUP_JOB_FAILED if you are just looking for failed notification events and don't need any filter policy on subscription.
aws backup put-backup-vault-notifications --backup-vault-name examplevault --sns-topic-arn arn:aws:sns:eu-west-1:111111111111:exampletopic --backup-vault-events
BACKUP_JOB_COMPLETED
aws backup put-backup-vault-notifications --backup-vault-name examplevault --sns-topic-arn arn:aws:sns:eu-west-1:111111111111:exampletopic --backup-vault-events BACKUP_JOB_FAILED BACKUP_JOB_EXPIRED
You can look for events for backup jobs in this doc. https://docs.aws.amazon.com/aws-backup/latest/devguide/API_GetBackupVaultNotifications.html
Relevant content
- asked 3 years ago
- Accepted Answerasked a year ago
- Accepted Answerasked 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago