我想将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
Run Code Online (Sandbox Code Playgroud)
这就是我创建SQS队列的方式
aws sqs create-queue --profile default --queue-name my-queue --attributes file://attributes.json
Run Code Online (Sandbox Code Playgroud)
与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\"}}}]}"
}
Run Code Online (Sandbox Code Playgroud)
最后,尝试设置引发我上面列出的错误消息的通知:
aws s3api put-bucket-notification-configuration --profile default --bucket my-bucket --notification-configuration file://notification.json`
Run Code Online (Sandbox Code Playgroud)
与notification.json文件一起使用
{
"TopicConfigurations": [
],
"QueueConfigurations": [
{
"QueueArn": "arn:aws:sqs:eu-west-1:123456789012:my-queue",
"Events": [
"s3:ObjectCreated:*"
],
"Filter": {
"Key": {
"FilterRules": [
{
"Name": "prefix",
"Value": …Run Code Online (Sandbox Code Playgroud)