{
  "typeName" : "AWS::Logs::QueryDefinition",
  "description" : "The resource schema for AWSLogs QueryDefinition",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs.git",
  "definitions" : {
    "LogGroup" : {
      "type" : "string",
      "pattern" : "[\\.\\-_/#A-Za-z0-9]+",
      "minLength" : 1,
      "maxLength" : 512
    }
  },
  "properties" : {
    "Name" : {
      "description" : "A name for the saved query definition",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 255
    },
    "QueryString" : {
      "description" : "The query string to use for this definition",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 10000
    },
    "LogGroupNames" : {
      "description" : "Optionally define specific log groups as part of your query definition",
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "description" : "LogGroup name",
        "$ref" : "#/definitions/LogGroup"
      }
    },
    "QueryDefinitionId" : {
      "description" : "Unique identifier of a query definition",
      "type" : "string",
      "minLength" : 0,
      "maxLength" : 256
    }
  },
  "required" : [ "Name", "QueryString" ],
  "additionalProperties" : false,
  "readOnlyProperties" : [ "/properties/QueryDefinitionId" ],
  "primaryIdentifier" : [ "/properties/QueryDefinitionId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "logs:PutQueryDefinition", "logs:DescribeQueryDefinition" ]
    },
    "read" : {
      "permissions" : [ "logs:DescribeQueryDefinition" ]
    },
    "update" : {
      "permissions" : [ "logs:PutQueryDefinition", "logs:DescribeQueryDefinition", "logs:DeleteQueryDefinition" ]
    },
    "delete" : {
      "permissions" : [ "logs:DescribeQueryDefinition", "logs:DeleteQueryDefinition" ]
    },
    "list" : {
      "permissions" : [ "logs:DescribeQueryDefinition" ]
    }
  },
  "taggable" : false
}