Interview Prep/AWS/S3, EBS and EFS

`put-bucket-notification-configuration` fails: `Unable to validate the following destination configurations`.

IntermediateTroubleshootingS3, EBS and EFS
Answer

Likely causes → S3 checks that it may publish to the destination. The Lambda has no resource policy allowing s3.amazonaws.com, or the SNS topic or SQS queue policy does not allow S3, or the destination's KMS key does not let S3 use it.

Diagnose →

aws lambda get-policy --function-name thumbnailer
aws sqs get-queue-attributes --queue-url <url> --attribute-names Policy KmsMasterKeyId

Fix →

aws lambda add-permission --function-name thumbnailer --statement-id s3invoke \
  --action lambda:InvokeFunction --principal s3.amazonaws.com \
  --source-arn arn:aws:s3:::uploads --source-account 111111111111

For SQS or SNS, add a policy statement for s3.amazonaws.com with an aws:SourceArn condition. With SSE, the key policy must allow S3 kms:GenerateDataKey and kms:Decrypt.

Prevent → Create the permission and the notification together in IaC (with depends_on), or route events through EventBridge.

aws All AWS questions Roadmap: AWS core services

More on S3, EBS and EFS