- Newest
- Most votes
- Most comments
Based on the information provided, it seems that you've set up the IAM roles and trust relationships correctly, but there might be a few things to consider:
-
Lambda Function Permissions: Ensure that your Lambda function has the necessary permissions to interact with AWS Backup. The Lambda execution role (CrossAccountBackupsLambdaExecutionRole) should have permissions to call AWS Backup APIs, particularly the StartBackupJob operation.
-
AWSBackupOperatorAccess: Consider attaching the AWSBackupOperatorAccess managed policy to your Lambda execution role. This policy specifically grants permissions to create on-demand backups, which aligns with your use case.
-
Resource-based Policies: Check if there are any resource-based policies on the resources you're trying to back up that might be restricting access.
-
Cross-Account Permissions: For cross-account backups, ensure that the target accounts have the necessary permissions set up to allow the central account to initiate backups.
-
VPC Configuration: If your Lambda function is running in a VPC, make sure it has the necessary network access to reach AWS Backup endpoints.
-
IAM Policy Evaluation: Remember that when you assume a role, you don't accumulate permissions from multiple roles. The effective permissions are those granted by the assumed role (AWSBackupDefaultServiceRole in this case).
-
CloudTrail Logs: Review CloudTrail logs for the StartBackupJob API call to see if there are any specific permission issues being reported.
Given that you can perform the operation successfully via CLI and the management console, the issue likely lies in how the Lambda function is assuming and using the roles. Double-check the IAM policy attached to your Lambda execution role and ensure it has the necessary permissions to interact with AWS Backup directly, in addition to the ability to assume the AWSBackupDefaultServiceRole.
If the issue persists, you might want to temporarily grant broader permissions to your Lambda execution role for troubleshooting purposes, and then narrow them down once you identify the specific permissions needed.
Sources
AWSBackupOperatorAccess - AWS Managed Policy
Resolve your AWS incidents faster by automatically engaging AWS Managed Services | AWS Cloud Operations Blog
Relevant content
- AWS OFFICIALUpdated 3 years ago
