我想将s3:CreateObject:*事件发送到SQS队列。但是设置通知配置会导致A client error (InvalidArgument) occurred when calling the PutBucketNotificationConfiguration operation: Unable to validate the following destination configurations
这是我创建存储桶的方式:
aws s3api create-bucket --profile default --bucket my-bucket --create-bucket-configuration LocationConstraint=eu-west-1
这就是我创建SQS队列的方式
aws sqs create-queue --profile default --queue-name my-queue --attributes file://attributes.json
与attributes.json文件
{ "DelaySeconds":"0", "MessageRetentionPeriod":"3600", "Policy":"{\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":[\"sqs:SendMessage\",\"sqs:ReceiveMessage\"],\"Condition\":{\"ArnLike\": {\"aws:SourceArn\": \"arn:aws:s3:*:*:my-bucket\"}}}]}" }
最后,尝试设置引发我上面列出的错误消息的通知:
aws s3api put-bucket-notification-configuration --profile default --bucket my-bucket --notification-configuration file://notification.json`
与notification.json文件一起使用
{ "TopicConfigurations": [ ], "QueueConfigurations": [ { "QueueArn": "arn:aws:sqs:eu-west-1:123456789012:my-queue", "Events": [ "s3:ObjectCreated:*" ], "Filter": { "Key": { "FilterRules": [ { "Name": "prefix", "Value": "my-filter" } ] } } } ], "LambdaFunctionConfigurations": [ ] }
我真的不知道错误可能在哪里。谢谢你的帮助!