gpt4 book ai didi

aws-lambda - 通过 cloudformation yaml 添加带有错误操作的 IoT 规则

转载 作者:行者123 更新时间:2023-12-03 07:35:38 25 4
gpt4 key购买 nike

我正在尝试使用以下 cloudformation yaml 文件添加带有错误操作的物联网规则

从 yaml 中提取:

 DaIoTRule:
Type: AWS::IoT::TopicRule
Properties:
RuleName: sda
TopicRulePayload:
RuleDisabled: false
Sql: SELECT *, topic(2) AS source FROM 'topic/sensors/+'
Actions:
- Lambda:
FunctionArn: !GetAtt LambdaFunction.Arn
ErrorAction:
S3:
RoleArn: !GetAtt DAIoTRuleErrorActionIamRole.Arn
Bucket: iot-message-dump
Key: "errors/${topic()}/${timestamp()}"

但我不断收到此错误:

{
"StackId": "arn:aws:cloudformation:us-east-1:961234632786:stack/wx-da-lambda/91423s00-4e97-11ea-aedd-0ee829hbc650",
"EventId": "DAIoTRule-CREATE_FAILED-2020-02-17T06:51:38.299Z",
"StackName": "da-lambda",
"LogicalResourceId": "DaIoTRule",
"PhysicalResourceId": "",
"ResourceType": "AWS::IoT::TopicRule",
"Timestamp": "2020-02-17T06:51:38.299Z",
"ResourceStatus": "CREATE_FAILED",
"ResourceStatusReason": "Encountered unsupported property bucket"
}

我使用https://docs.aws.amazon.com/iot/latest/developerguide/rule-error-handling.html创建了这个yaml作为引用。

有人可以指出我做错了什么吗?

最佳答案

CloudFormation 使用 BucketName 属性而不是 Bucket 来执行 S3 操作(包括错误操作)。

参见https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iot-topicrule-s3action.html#cfn-iot-topicrule-s3action-bucketname

关于aws-lambda - 通过 cloudformation yaml 添加带有错误操作的 IoT 规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60257653/

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