{
  "typeName" : "AWS::IoT::ProvisioningTemplate",
  "description" : "Creates a fleet provisioning template.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
  "definitions" : {
    "ProvisioningHook" : {
      "type" : "object",
      "properties" : {
        "TargetArn" : {
          "type" : "string"
        },
        "PayloadVersion" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "Tag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false,
      "required" : [ "Key", "Value" ]
    }
  },
  "properties" : {
    "TemplateArn" : {
      "type" : "string"
    },
    "TemplateName" : {
      "type" : "string",
      "pattern" : "^[0-9A-Za-z_-]+$",
      "minLength" : 1,
      "maxLength" : 36
    },
    "Description" : {
      "type" : "string",
      "maxLength" : 500
    },
    "Enabled" : {
      "type" : "boolean"
    },
    "ProvisioningRoleArn" : {
      "type" : "string"
    },
    "TemplateBody" : {
      "type" : "string"
    },
    "TemplateType" : {
      "type" : "string",
      "enum" : [ "FLEET_PROVISIONING", "JITP" ]
    },
    "PreProvisioningHook" : {
      "$ref" : "#/definitions/ProvisioningHook"
    },
    "Tags" : {
      "type" : "array",
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : false,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "iot:ListTagsForResource", "iot:TagResource", "iot:UntagResource" ]
  },
  "additionalProperties" : false,
  "required" : [ "ProvisioningRoleArn", "TemplateBody" ],
  "createOnlyProperties" : [ "/properties/TemplateName", "/properties/TemplateType" ],
  "readOnlyProperties" : [ "/properties/TemplateArn" ],
  "primaryIdentifier" : [ "/properties/TemplateName" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "iam:GetRole", "iam:PassRole", "iot:CreateProvisioningTemplate", "iot:DescribeProvisioningTemplate", "iot:TagResource", "iot:ListTagsForResource", "kms:Decrypt" ]
    },
    "read" : {
      "permissions" : [ "iot:DescribeProvisioningTemplate", "iot:ListTagsForResource", "kms:Decrypt" ]
    },
    "update" : {
      "permissions" : [ "iam:GetRole", "iam:PassRole", "iot:UpdateProvisioningTemplate", "iot:CreateProvisioningTemplateVersion", "iot:ListProvisioningTemplateVersions", "iot:DeleteProvisioningTemplateVersion", "iot:DescribeProvisioningTemplate", "iot:TagResource", "iot:UntagResource", "iot:ListTagsForResource", "kms:Decrypt" ]
    },
    "delete" : {
      "permissions" : [ "iot:DeleteProvisioningTemplate", "iot:DescribeProvisioningTemplate", "kms:Decrypt" ]
    },
    "list" : {
      "permissions" : [ "iot:ListProvisioningTemplates" ]
    }
  }
}