Amazon web services SNS主题说它需要一个字符串
我查看了几个指南,它们都遵循相同的模式,但我仍然得到以下错误:Amazon web services SNS主题说它需要一个字符串,amazon-web-services,amazon-cloudformation,serverless-framework,Amazon Web Services,Amazon Cloudformation,Serverless Framework,我查看了几个指南,它们都遵循相同的模式,但我仍然得到以下错误: An error occurred: IngestSNSTopic - Value of property Endpoint must be of type String. 这里使用无服务器框架是声明该资源的部分。我已经反复考虑了几个小时了,希望能得到一些帮助,谢谢 IngestSNSTopic: Type: AWS::SNS::Topic Properties: Subscript
An error occurred: IngestSNSTopic - Value of property Endpoint must be of type String.
这里使用无服务器框架是声明该资源的部分。我已经反复考虑了几个小时了,希望能得到一些帮助,谢谢
IngestSNSTopic:
Type: AWS::SNS::Topic
Properties:
Subscription:
-
Endpoint:
Fn::GetAtt:
- IngestQueue
- Arn
Protocol: sqs
IngestQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: ${opt:stage}-mam-ingest-queue-${file(env/${opt:stage, 'dev'}.yml):IP_SLUG}
RedrivePolicy:
maxReceiveCount: 3
deadLetterTargetArn:
Fn::GetAtt:
- IngestDeadLetter
- Arn
我认为,JSON和YAML示例的输出不同。协议
属性缩进过多,这意味着端点
将作为对象进行计算
以下是您的配置在JSON中的计算结果:
{
"IngestSNSTopic": {
"Type": "AWS::SNS::Topic",
"Properties": {
"Subscription": [
{
"Endpoint": {
"Fn::GetAtt": [
"IngestQueue",
"Arn"
],
"Protocol": "sqs"
}
}
]
}
}
}
我认为应该是这样的:
IngestSNSTopic:
Type: AWS::SNS::Topic
Properties:
Subscription:
-
Endpoint:
Fn::GetAtt:
- IngestQueue
- Arn
Protocol: sqs
堆栈在我加入SNS之前部署得很好很难说,但是看起来
IngestSNSTopic
的YAML缩进太多了?这是有效的YAML吗?到目前为止看起来不错!我之前差点就试过了,但每个导游都有相反的想法!文档中的错误具有误导性,但来自平台的错误是正确的,Endpoint
需要是字符串。来自平台的信息可能含糊不清,导致普遍的不信任,但在这种情况下,这是最好的线索。