简体   繁体   English

AWS Iot创建新规则时创建规则错误

[英]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.

相关问题 AWS IoT规则JSON密钥上的SQL查询以数字开头 - SQL Query on AWS IoT Rule JSON key starts with number 仅从AWS IoT规则的json数据中接收一个参数 - Receive only one parameter from aws IoT rule's json data 使用jq解析AWS安全组并添加新的入口规则 - Parse AWS security group with jq and add new ingress rule 为 S3 前缀创建 AWS CloudWatch 事件规则 - Create AWS CloudWatch Event rule for S3 prefix AWS CLI:解析参数“--config-rule”时出错:JSON 无效: - AWS CLI: Error parsing parameter '--config-rule': Invalid JSON: AWS IoT JSON错误 - AWS IoT JSON Error 部署到 KIE 服务器时出现 Drools 错误:Fire 规则限制达到 10000 - Drools Error while deploying into KIE-server : Fire rule limit reached 10000 Error: SyntaxError: Unexpected token C in JSON at position 33 in rule attachments while doing on google firebase - Error: SyntaxError: Unexpected token C in JSON at position 33 in rule attachments while doing on google firebase CloudFormation AWS::Events::Rule:遇到不支持的属性输入格式化程序 - CloudFormation AWS::Events::Rule: Encountered unsupported property inputformatter 如何创建过滤多个源的 EventPattern(在 EventBridge 规则内)? - How to create an EventPattern that filters multiple sources (within an EventBridge rule)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM