- Newest
- Most votes
- Most comments
Hello,
Greetings of the day!! Thank you for contacting AWS.
I understand you are getting the following error when trying to add Event Notification for SQS via CDK:
"botocore.exceptions.ClientError: An error occurred (InvalidArgument) when calling the PutBucketNotificationConfiguration"
Please note here that this error usually occur if the destination which we are configuring don't allow Amazon S3 from pushing the configured events. Therefore, in order to troubleshoot the issue, you need to check the SQS queue policy as per the documentation[+]. Basically, the SQS queue policy needs to be checked for the permissions for the particular bucket you are configuring.
[+]https://docs.aws.amazon.com/AmazonS3/latest/userguide/grant-destinations-permissions-to-s3.html
{ "Version": "2012-10-17", "Id": "example-ID", "Statement": [ { "Sid": "Example SNS topic policy", "Effect": "Allow", "Principal": { "Service": "s3.amazonaws.com" }, "Action": [ "SNS:Publish" ], "Resource": "SNS-topic-ARN", "Condition": { "ArnLike": { "aws:SourceArn": "arn:aws:s3:::bucket-name" //should contain all the buckets that need to be configured. }, "StringEquals": { "aws:SourceAccount": "bucket-owner-account-id" } } } ] }
Also, to better address the issue, we require details that are non-public information. Thus, I request you to kindly open a support case with AWS using the following link from the account that owns the SQS queue.
https://console.aws.amazon.com/support/home#/case/create
Thank you and have a nice day!!
Relevant content
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated a year ago