{
  "typeName" : "AWS::IoT::Policy",
  "description" : "Resource Type definition for AWS::IoT::Policy",
  "definitions" : {
    "Tag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false,
      "required" : [ "Key", "Value" ]
    }
  },
  "additionalProperties" : false,
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : false,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "iot:ListTagsForResource", "iot:TagResource", "iot:UntagResource" ]
  },
  "properties" : {
    "Id" : {
      "type" : "string"
    },
    "Arn" : {
      "type" : "string"
    },
    "PolicyDocument" : {
      "type" : [ "object", "string" ],
      "minLength" : 1,
      "maxLength" : 404600
    },
    "PolicyName" : {
      "type" : "string"
    },
    "Tags" : {
      "type" : "array",
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "required" : [ "PolicyDocument" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/Id" ],
  "createOnlyProperties" : [ "/properties/PolicyName" ],
  "primaryIdentifier" : [ "/properties/Id" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "iot:CreatePolicy", "iot:GetPolicy", "iot:TagResource", "iot:ListTagsForResource", "kms:Decrypt" ]
    },
    "read" : {
      "permissions" : [ "iot:GetPolicy", "iot:ListTagsForResource", "kms:Decrypt" ]
    },
    "delete" : {
      "permissions" : [ "iot:DeletePolicy", "iot:GetPolicy", "iot:ListPolicyVersions", "iot:DeletePolicyVersion", "kms:Decrypt" ]
    },
    "update" : {
      "permissions" : [ "iot:GetPolicy", "iot:ListPolicyVersions", "iot:CreatePolicyVersion", "iot:DeletePolicyVersion", "iot:SetDefaultPolicyVersion", "iot:TagResource", "iot:UntagResource", "iot:ListTagsForResource", "kms:Decrypt" ]
    },
    "list" : {
      "permissions" : [ "iot:ListPolicies" ]
    }
  }
}