{
  "typeName" : "AWS::IoTEvents::Input",
  "description" : "The AWS::IoTEvents::Input resource creates an input. To monitor your devices and processes, they must have a way to get telemetry data into AWS IoT Events. This is done by sending messages as *inputs* to AWS IoT Events. For more information, see [How to Use AWS IoT Events](https://docs.aws.amazon.com/iotevents/latest/developerguide/how-to-use-iotevents.html) in the *AWS IoT Events Developer Guide*.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-iotevents.git",
  "definitions" : {
    "InputDefinition" : {
      "type" : "object",
      "additionalProperties" : false,
      "description" : "The definition of the input.",
      "properties" : {
        "Attributes" : {
          "type" : "array",
          "uniqueItems" : true,
          "insertionOrder" : false,
          "description" : "The attributes from the JSON payload that are made available by the input. Inputs are derived from messages sent to the AWS IoT Events system using `BatchPutMessage`. Each such message contains a JSON payload, and those attributes (and their paired values) specified here are available for use in the `condition` expressions used by detectors that monitor this input.",
          "minItems" : 1,
          "maxItems" : 200,
          "items" : {
            "$ref" : "#/definitions/Attribute"
          }
        }
      },
      "required" : [ "Attributes" ]
    },
    "Attribute" : {
      "type" : "object",
      "additionalProperties" : false,
      "description" : "The attributes from the JSON payload that are made available by the input. Inputs are derived from messages sent to the AWS IoT Events system using `BatchPutMessage`. Each such message contains a JSON payload, and those attributes (and their paired values) specified here are available for use in the `condition` expressions used by detectors that monitor this input.",
      "properties" : {
        "JsonPath" : {
          "description" : "An expression that specifies an attribute-value pair in a JSON structure. Use this to specify an attribute from the JSON payload that is made available by the input. Inputs are derived from messages sent to AWS IoT Events (`BatchPutMessage`). Each such message contains a JSON payload. The attribute (and its paired value) specified here are available for use in the `condition` expressions used by detectors.\n\n_Syntax_: `<field-name>.<field-name>...`",
          "minLength" : 1,
          "maxLength" : 128,
          "pattern" : "^((`[a-zA-Z0-9_\\- ]+`)|([a-zA-Z0-9_\\-]+))(\\.((`[a-zA-Z0-9_\\- ]+`)|([a-zA-Z0-9_\\-]+)))*$",
          "type" : "string"
        }
      },
      "required" : [ "JsonPath" ]
    },
    "Tag" : {
      "type" : "object",
      "additionalProperties" : false,
      "description" : "Tags to be applied to Input.",
      "properties" : {
        "Key" : {
          "description" : "Key of the Tag.",
          "type" : "string"
        },
        "Value" : {
          "description" : "Value of the Tag.",
          "type" : "string"
        }
      },
      "required" : [ "Value", "Key" ]
    }
  },
  "properties" : {
    "InputDefinition" : {
      "$ref" : "#/definitions/InputDefinition"
    },
    "InputDescription" : {
      "description" : "A brief description of the input.",
      "minLength" : 1,
      "maxLength" : 128,
      "type" : "string"
    },
    "InputName" : {
      "description" : "The name of the input.",
      "minLength" : 1,
      "maxLength" : 128,
      "pattern" : "^[a-zA-Z][a-zA-Z0-9_]*$",
      "type" : "string"
    },
    "Tags" : {
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "description" : "An array of key-value pairs to apply to this resource.\n\nFor more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "additionalProperties" : false,
  "required" : [ "InputDefinition" ],
  "primaryIdentifier" : [ "/properties/InputName" ],
  "createOnlyProperties" : [ "/properties/InputName" ],
  "taggable" : true,
  "handlers" : {
    "create" : {
      "permissions" : [ "iotevents:CreateInput", "iotevents:TagResource", "iotevents:DescribeInput", "iotevents:ListTagsForResource" ]
    },
    "read" : {
      "permissions" : [ "iotevents:DescribeInput", "iotevents:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "iotevents:UpdateInput", "iotevents:DescribeInput", "iotevents:ListTagsForResource", "iotevents:UntagResource", "iotevents:TagResource" ]
    },
    "delete" : {
      "permissions" : [ "iotevents:DeleteInput", "iotevents:DescribeInput" ]
    },
    "list" : {
      "permissions" : [ "iotevents:ListInputs" ]
    }
  }
}