[英]Aws Iot create rule error while creating new rule
I am creating a new rule using the following command 我正在使用以下命令创建新规则
aws iot create-topic-rule --rule-name my-rule --topic-rule-payload file://myrule.json
The content of myrule.json
contents is myrule.json
内容的内容是
{
"sql": "SELECT * FROM 'iot/test'",
"ruleDisabled": false,
"awsIotSqlVersion": "2016-03-23-beta",
"actions": [{
"dynamoDB": {
"tableName": "my-dynamodb-table",
"roleArn": "arn:aws:iam::12345*****:role/my-iot-role",
"hashKeyField": "topic",
"hashKeyValue": "${topic(2)}",
"rangeKeyField": "timestamp",
"rangeKeyValue": "${timestamp()}"
}
}]
}
I am getting following error. 我收到以下错误。
A client error (InvalidRequestException) occurred when calling the CreateTopicRule operation: 1 validation error detected: Value 'my-rule' at 'ruleName' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-zA-Z0-9_]+$
调用CreateTopicRule操作时发生客户端错误(InvalidRequestException):检测到1个验证错误:'ruleName'处的值'my-rule'无法满足约束:成员必须满足正则表达式模式:^ [a-zA-Z0-9_] + $
please can someone help? 请有人帮忙吗?
The regex ^[a-zA-Z0-9_]+$ means you cannot use dashes(-) . 正则表达式^ [a-zA-Z0-9 _] + $表示您不能使用破折号(-)。 Only underscore( _ ) is allowed
仅允许使用下划线(_)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.