gpt4 book ai didi

json - 通过 Cloudformation 在 S3 存储桶上创建 SQS 事件时,通知目标服务区域对于存储桶位置约束无效

转载 作者:行者123 更新时间:2023-12-03 07:14:22 26 4
gpt4 key购买 nike

我正在创建一个 cloudformation 模板,该模板必须创建一个私有(private)存储桶,然后添加事件通知,每次在存储桶中创建对象时都会向队列发送消息。当我运行堆栈时,出现以下错误:

通知目标服务区域对于存储桶位置约束无效(服务:Amazon S3;状态代码:400;错误代码:InvalidArgument;

这是Json格式的模板:

    "AWSTemplateFormatVersion": "2010-09-09",
"Metadata": {
"AWS::CloudFormation::Designer": {
"b4cec5e5-e02b-4489-80ee-9627fd1bbbff": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 40,
"y": 130
},
"z": 0,
"embeds": [],
"dependson": [
"8e5a0dc7-8982-475c-baa7-41de089beb18"
]
}
}
},
"Resources": {
"S3B2HKY4": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketName": "cloudformation.bucket.sqs",
"AccessControl": "Private",
"NotificationConfiguration": {
"QueueConfigurations": [
{
"Event": "s3:ObjectCreated:*",
"Queue": "arn:aws:sqs:*:*:cloudformation_queue_s3"
}
]
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "b4cec5e5-e02b-4489-80ee-9627fd1bbbff"
}
}
}
}
}```

I have checked similar problems but most of them are for SNS and Lambda function.

最佳答案

您的 arn:aws:sqs:*:*:cloudformation_queue_s3 应为绝对值(帐户和区域)。

注意到该错误是因为来自 S3 事件通知的通知只能排队到与存储桶位于同一区域的资源。

关于json - 通过 Cloudformation 在 S3 存储桶上创建 SQS 事件时,通知目标服务区域对于存储桶位置约束无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62996034/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com