{
  "typeName" : "AWS::Kendra::Index",
  "description" : "A Kendra index",
  "sourceUrl" : "https://docs.aws.amazon.com/kendra/latest/dg/hiw-index.html",
  "definitions" : {
    "ServerSideEncryptionConfiguration" : {
      "type" : "object",
      "properties" : {
        "KmsKeyId" : {
          "$ref" : "#/definitions/KmsKeyId"
        }
      },
      "additionalProperties" : false
    },
    "Description" : {
      "type" : "string",
      "maxLength" : 1000
    },
    "KmsKeyId" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 2048
    },
    "Tag" : {
      "description" : "A label for tagging Kendra resources",
      "type" : "object",
      "properties" : {
        "Key" : {
          "description" : "A string used to identify this tag",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "description" : "A string containing the value for the tag",
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "TagList" : {
      "description" : "List of tags",
      "type" : "array",
      "maxItems" : 200,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "Importance" : {
      "type" : "integer",
      "minimum" : 1,
      "maximum" : 10
    },
    "Freshness" : {
      "type" : "boolean"
    },
    "Duration" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 10,
      "pattern" : "[0-9]+[s]"
    },
    "Order" : {
      "type" : "string",
      "enum" : [ "ASCENDING", "DESCENDING" ]
    },
    "Relevance" : {
      "type" : "object",
      "properties" : {
        "Freshness" : {
          "$ref" : "#/definitions/Freshness"
        },
        "Importance" : {
          "$ref" : "#/definitions/Importance"
        },
        "Duration" : {
          "$ref" : "#/definitions/Duration"
        },
        "RankOrder" : {
          "$ref" : "#/definitions/Order"
        },
        "ValueImportanceItems" : {
          "$ref" : "#/definitions/ValueImportanceItems"
        }
      },
      "additionalProperties" : false
    },
    "ValueImportanceItems" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/ValueImportanceItem"
      }
    },
    "ValueImportanceItem" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "$ref" : "#/definitions/ValueImportanceItemKey"
        },
        "Value" : {
          "$ref" : "#/definitions/Importance"
        }
      },
      "additionalProperties" : false
    },
    "ValueImportanceItemKey" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 50
    },
    "Search" : {
      "type" : "object",
      "properties" : {
        "Facetable" : {
          "type" : "boolean"
        },
        "Searchable" : {
          "type" : "boolean"
        },
        "Displayable" : {
          "type" : "boolean"
        },
        "Sortable" : {
          "type" : "boolean"
        }
      },
      "additionalProperties" : false
    },
    "DocumentMetadataConfigurationName" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 30
    },
    "DocumentAttributeValueType" : {
      "type" : "string",
      "enum" : [ "STRING_VALUE", "STRING_LIST_VALUE", "LONG_VALUE", "DATE_VALUE" ]
    },
    "DocumentMetadataConfiguration" : {
      "type" : "object",
      "properties" : {
        "Name" : {
          "$ref" : "#/definitions/DocumentMetadataConfigurationName"
        },
        "Type" : {
          "$ref" : "#/definitions/DocumentAttributeValueType"
        },
        "Relevance" : {
          "$ref" : "#/definitions/Relevance"
        },
        "Search" : {
          "$ref" : "#/definitions/Search"
        }
      },
      "additionalProperties" : false,
      "required" : [ "Name", "Type" ]
    },
    "DocumentMetadataConfigurationList" : {
      "type" : "array",
      "maxItems" : 500,
      "items" : {
        "$ref" : "#/definitions/DocumentMetadataConfiguration"
      }
    },
    "StorageCapacityUnits" : {
      "type" : "integer",
      "minimum" : 0
    },
    "QueryCapacityUnits" : {
      "type" : "integer",
      "minimum" : 0
    },
    "CapacityUnitsConfiguration" : {
      "type" : "object",
      "properties" : {
        "StorageCapacityUnits" : {
          "$ref" : "#/definitions/StorageCapacityUnits"
        },
        "QueryCapacityUnits" : {
          "$ref" : "#/definitions/QueryCapacityUnits"
        }
      },
      "additionalProperties" : false,
      "required" : [ "StorageCapacityUnits", "QueryCapacityUnits" ]
    },
    "Edition" : {
      "description" : "Edition of index",
      "type" : "string",
      "enum" : [ "DEVELOPER_EDITION", "ENTERPRISE_EDITION" ]
    },
    "Name" : {
      "description" : "Name of index",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 1000
    },
    "RoleArn" : {
      "description" : "Role Arn",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 1284,
      "pattern" : "arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}"
    },
    "Id" : {
      "description" : "Unique ID of index",
      "type" : "string",
      "minLength" : 36,
      "maxLength" : 36
    },
    "Arn" : {
      "type" : "string",
      "maxLength" : 1000
    },
    "UserContextPolicy" : {
      "type" : "string",
      "enum" : [ "ATTRIBUTE_FILTER", "USER_TOKEN" ]
    },
    "UserNameAttributeField" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 100
    },
    "GroupAttributeField" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 100
    },
    "KeyLocation" : {
      "type" : "string",
      "enum" : [ "URL", "SECRET_MANAGER" ]
    },
    "Issuer" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 65
    },
    "ClaimRegex" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 100
    },
    "Url" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 2048,
      "pattern" : "^(https?|ftp|file):\\/\\/([^\\s]*)"
    },
    "JsonTokenTypeConfiguration" : {
      "type" : "object",
      "properties" : {
        "UserNameAttributeField" : {
          "$ref" : "#/definitions/UserNameAttributeField"
        },
        "GroupAttributeField" : {
          "$ref" : "#/definitions/GroupAttributeField"
        }
      },
      "additionalProperties" : false,
      "required" : [ "UserNameAttributeField", "GroupAttributeField" ]
    },
    "JwtTokenTypeConfiguration" : {
      "type" : "object",
      "properties" : {
        "KeyLocation" : {
          "$ref" : "#/definitions/KeyLocation"
        },
        "URL" : {
          "$ref" : "#/definitions/Url"
        },
        "SecretManagerArn" : {
          "$ref" : "#/definitions/RoleArn"
        },
        "UserNameAttributeField" : {
          "$ref" : "#/definitions/UserNameAttributeField"
        },
        "GroupAttributeField" : {
          "$ref" : "#/definitions/GroupAttributeField"
        },
        "Issuer" : {
          "$ref" : "#/definitions/Issuer"
        },
        "ClaimRegex" : {
          "$ref" : "#/definitions/ClaimRegex"
        }
      },
      "additionalProperties" : false,
      "required" : [ "KeyLocation" ]
    },
    "UserTokenConfiguration" : {
      "type" : "object",
      "properties" : {
        "JwtTokenTypeConfiguration" : {
          "$ref" : "#/definitions/JwtTokenTypeConfiguration"
        },
        "JsonTokenTypeConfiguration" : {
          "$ref" : "#/definitions/JsonTokenTypeConfiguration"
        }
      },
      "additionalProperties" : false
    },
    "UserTokenConfigurationList" : {
      "type" : "array",
      "maxItems" : 1,
      "items" : {
        "$ref" : "#/definitions/UserTokenConfiguration"
      }
    }
  },
  "properties" : {
    "Id" : {
      "$ref" : "#/definitions/Id"
    },
    "Arn" : {
      "$ref" : "#/definitions/Arn"
    },
    "Description" : {
      "description" : "A description for the index",
      "$ref" : "#/definitions/Description"
    },
    "ServerSideEncryptionConfiguration" : {
      "description" : "Server side encryption configuration",
      "$ref" : "#/definitions/ServerSideEncryptionConfiguration"
    },
    "Tags" : {
      "description" : "Tags for labeling the index",
      "$ref" : "#/definitions/TagList"
    },
    "Name" : {
      "$ref" : "#/definitions/Name"
    },
    "RoleArn" : {
      "$ref" : "#/definitions/RoleArn"
    },
    "Edition" : {
      "$ref" : "#/definitions/Edition"
    },
    "DocumentMetadataConfigurations" : {
      "description" : "Document metadata configurations",
      "$ref" : "#/definitions/DocumentMetadataConfigurationList"
    },
    "CapacityUnits" : {
      "description" : "Capacity units",
      "$ref" : "#/definitions/CapacityUnitsConfiguration"
    },
    "UserContextPolicy" : {
      "$ref" : "#/definitions/UserContextPolicy"
    },
    "UserTokenConfigurations" : {
      "$ref" : "#/definitions/UserTokenConfigurationList"
    }
  },
  "required" : [ "Name", "RoleArn", "Edition" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "kendra:CreateIndex", "kendra:DescribeIndex", "kendra:UpdateIndex", "kendra:ListTagsForResource", "iam:PassRole", "kendra:TagResource" ],
      "timeoutInMinutes" : 240
    },
    "read" : {
      "permissions" : [ "kendra:DescribeIndex", "kendra:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "kendra:DescribeIndex", "kendra:UpdateIndex", "kendra:ListTagsForResource", "kendra:TagResource", "kendra:UntagResource", "iam:PassRole" ],
      "timeoutInMinutes" : 240
    },
    "delete" : {
      "permissions" : [ "kendra:DescribeIndex", "kendra:DeleteIndex" ],
      "timeoutInMinutes" : 720
    },
    "list" : {
      "permissions" : [ "kendra:ListIndices" ]
    }
  },
  "additionalProperties" : false,
  "primaryIdentifier" : [ "/properties/Id" ],
  "readOnlyProperties" : [ "/properties/Id", "/properties/Arn" ],
  "createOnlyProperties" : [ "/properties/Edition", "/properties/ServerSideEncryptionConfiguration" ]
}