{
  "typeName" : "AWS::Bedrock::KnowledgeBase",
  "description" : "Definition of AWS::Bedrock::KnowledgeBase Resource Type",
  "definitions" : {
    "KnowledgeBaseConfiguration" : {
      "type" : "object",
      "description" : "Contains details about the embeddings model used for the knowledge base.",
      "properties" : {
        "Type" : {
          "$ref" : "#/definitions/KnowledgeBaseType"
        },
        "VectorKnowledgeBaseConfiguration" : {
          "$ref" : "#/definitions/VectorKnowledgeBaseConfiguration"
        },
        "KendraKnowledgeBaseConfiguration" : {
          "$ref" : "#/definitions/KendraKnowledgeBaseConfiguration"
        },
        "SqlKnowledgeBaseConfiguration" : {
          "$ref" : "#/definitions/SqlKnowledgeBaseConfiguration"
        },
        "ManagedKnowledgeBaseConfiguration" : {
          "$ref" : "#/definitions/ManagedKnowledgeBaseConfiguration"
        }
      },
      "required" : [ "Type" ],
      "additionalProperties" : false
    },
    "KnowledgeBaseStatus" : {
      "type" : "string",
      "description" : "The status of a knowledge base.",
      "enum" : [ "CREATING", "ACTIVE", "DELETING", "UPDATING", "FAILED", "DELETE_UNSUCCESSFUL", "UPDATE_UNSUCCESSFUL" ]
    },
    "KnowledgeBaseStorageType" : {
      "type" : "string",
      "description" : "The storage type of a knowledge base.",
      "enum" : [ "OPENSEARCH_SERVERLESS", "PINECONE", "RDS", "MONGO_DB_ATLAS", "NEPTUNE_ANALYTICS", "S3_VECTORS", "OPENSEARCH_MANAGED_CLUSTER" ]
    },
    "KnowledgeBaseType" : {
      "type" : "string",
      "description" : "The type of a knowledge base.",
      "enum" : [ "VECTOR", "KENDRA", "SQL", "MANAGED" ]
    },
    "OpenSearchManagedClusterConfiguration" : {
      "type" : "object",
      "description" : "Contains the storage configuration of the knowledge base in Amazon OpenSearch Service.",
      "properties" : {
        "DomainArn" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^arn:aws(-cn|-us-gov|-eusc|-iso(-[b-f])?)?:es:([a-z]{2,}-){2,}\\d:\\d{12}:domain/[a-z][a-z0-9-]{3,28}$",
          "description" : "The Amazon Resource Name (ARN) of the OpenSearch domain."
        },
        "DomainEndpoint" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^https://.*$",
          "description" : "The endpoint URL the OpenSearch domain."
        },
        "VectorIndexName" : {
          "type" : "string",
          "maxLength" : 2048,
          "minLength" : 1,
          "pattern" : "^(?![\\-_+.])[a-z0-9][a-z0-9\\-_\\.]*$",
          "description" : "The name of the vector store."
        },
        "FieldMapping" : {
          "$ref" : "#/definitions/OpenSearchManagedClusterFieldMapping"
        }
      },
      "required" : [ "DomainArn", "DomainEndpoint", "VectorIndexName", "FieldMapping" ],
      "additionalProperties" : false
    },
    "OpenSearchManagedClusterFieldMapping" : {
      "type" : "object",
      "description" : "A mapping of Bedrock Knowledge Base fields to OpenSearch Managed Cluster field names",
      "properties" : {
        "VectorField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources."
        },
        "TextField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose."
        },
        "MetadataField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores metadata about the vector store."
        }
      },
      "required" : [ "MetadataField", "TextField", "VectorField" ],
      "additionalProperties" : false
    },
    "OpenSearchServerlessConfiguration" : {
      "type" : "object",
      "description" : "Contains the storage configuration of the knowledge base in Amazon OpenSearch Service.",
      "properties" : {
        "CollectionArn" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^arn:aws(|-cn|-us-gov|-iso):aoss:[a-z]{2}(-gov)?-[a-z]+-\\d{1}:\\d{12}:collection/[a-z0-9-]{3,32}$",
          "description" : "The ARN of the OpenSearch Service vector store."
        },
        "VectorIndexName" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the vector store."
        },
        "FieldMapping" : {
          "$ref" : "#/definitions/OpenSearchServerlessFieldMapping"
        }
      },
      "required" : [ "CollectionArn", "FieldMapping", "VectorIndexName" ],
      "additionalProperties" : false
    },
    "OpenSearchServerlessFieldMapping" : {
      "type" : "object",
      "description" : "A mapping of Bedrock Knowledge Base fields to OpenSearch Serverless field names",
      "properties" : {
        "VectorField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources."
        },
        "TextField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose."
        },
        "MetadataField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores metadata about the vector store."
        }
      },
      "required" : [ "MetadataField", "TextField", "VectorField" ],
      "additionalProperties" : false
    },
    "PineconeConfiguration" : {
      "type" : "object",
      "description" : "Contains the storage configuration of the knowledge base in Pinecone.",
      "properties" : {
        "ConnectionString" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The endpoint URL for your index management page."
        },
        "CredentialsSecretArn" : {
          "type" : "string",
          "pattern" : "^arn:aws(|-cn|-us-gov):secretsmanager:[a-z0-9-]{1,20}:([0-9]{12}|):secret:[a-zA-Z0-9!/_+=.@-]{1,512}$",
          "description" : "The ARN of the secret that you created in AWS Secrets Manager that is linked to your Pinecone API key."
        },
        "Namespace" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The namespace to be used to write new data to your database."
        },
        "FieldMapping" : {
          "$ref" : "#/definitions/PineconeFieldMapping"
        }
      },
      "required" : [ "ConnectionString", "CredentialsSecretArn", "FieldMapping" ],
      "additionalProperties" : false
    },
    "PineconeFieldMapping" : {
      "type" : "object",
      "description" : "Contains the names of the fields to which to map information about the vector store.",
      "properties" : {
        "TextField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose."
        },
        "MetadataField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores metadata about the vector store."
        }
      },
      "required" : [ "MetadataField", "TextField" ],
      "additionalProperties" : false
    },
    "RdsConfiguration" : {
      "type" : "object",
      "description" : "Contains details about the storage configuration of the knowledge base in Amazon RDS. For more information, see Create a vector index in Amazon RDS.",
      "properties" : {
        "ResourceArn" : {
          "type" : "string",
          "pattern" : "^arn:aws(|-cn|-us-gov):rds:[a-zA-Z0-9-]*:[0-9]{12}:cluster:[a-zA-Z0-9-]{1,63}$",
          "description" : "The ARN of the vector store."
        },
        "CredentialsSecretArn" : {
          "type" : "string",
          "pattern" : "^arn:aws(|-cn|-us-gov):secretsmanager:[a-z0-9-]{1,20}:([0-9]{12}|):secret:[a-zA-Z0-9!/_+=.@-]{1,512}$",
          "description" : "The ARN of the secret that you created in AWS Secrets Manager that is linked to your Amazon RDS database."
        },
        "DatabaseName" : {
          "type" : "string",
          "maxLength" : 63,
          "pattern" : "^[a-zA-Z0-9_\\-]+$",
          "description" : "The name of your Amazon RDS database."
        },
        "TableName" : {
          "type" : "string",
          "maxLength" : 63,
          "pattern" : "^[a-zA-Z0-9_\\.\\-]+$",
          "description" : "The name of the table in the database."
        },
        "FieldMapping" : {
          "$ref" : "#/definitions/RdsFieldMapping"
        }
      },
      "required" : [ "CredentialsSecretArn", "DatabaseName", "FieldMapping", "ResourceArn", "TableName" ],
      "additionalProperties" : false
    },
    "RdsFieldMapping" : {
      "type" : "object",
      "description" : "Contains the names of the fields to which to map information about the vector store.",
      "properties" : {
        "PrimaryKeyField" : {
          "type" : "string",
          "maxLength" : 63,
          "pattern" : "^[a-zA-Z0-9_\\-]+$",
          "description" : "The name of the field in which Amazon Bedrock stores the ID for each entry."
        },
        "VectorField" : {
          "type" : "string",
          "maxLength" : 63,
          "pattern" : "^[a-zA-Z0-9_\\-]+$",
          "description" : "The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources."
        },
        "TextField" : {
          "type" : "string",
          "maxLength" : 63,
          "pattern" : "^[a-zA-Z0-9_\\-]+$",
          "description" : "The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose."
        },
        "MetadataField" : {
          "type" : "string",
          "maxLength" : 63,
          "pattern" : "^[a-zA-Z0-9_\\-]+$",
          "description" : "The name of the field in which Amazon Bedrock stores metadata about the vector store."
        },
        "CustomMetadataField" : {
          "type" : "string",
          "maxLength" : 63,
          "pattern" : "^[a-zA-Z0-9_\\-]+$",
          "description" : "The name of the field in which Amazon Bedrock stores custom metadata about the vector store."
        }
      },
      "required" : [ "MetadataField", "PrimaryKeyField", "TextField", "VectorField" ],
      "additionalProperties" : false
    },
    "RedisEnterpriseCloudConfiguration" : {
      "type" : "object",
      "description" : "Contains the storage configuration of the knowledge base in Redis Enterprise Cloud.",
      "properties" : {
        "Endpoint" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The endpoint URL of the Redis Enterprise Cloud database."
        },
        "VectorIndexName" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the vector index."
        },
        "CredentialsSecretArn" : {
          "type" : "string",
          "pattern" : "^arn:aws(|-cn|-us-gov):secretsmanager:[a-z0-9-]{1,20}:([0-9]{12}|):secret:[a-zA-Z0-9!/_+=.@-]{1,512}$",
          "description" : "The ARN of the secret that you created in AWS Secrets Manager that is linked to your Redis Enterprise Cloud database."
        },
        "FieldMapping" : {
          "$ref" : "#/definitions/RedisEnterpriseCloudFieldMapping"
        }
      },
      "required" : [ "CredentialsSecretArn", "Endpoint", "FieldMapping", "VectorIndexName" ],
      "additionalProperties" : false
    },
    "RedisEnterpriseCloudFieldMapping" : {
      "type" : "object",
      "description" : "Contains the names of the fields to which to map information about the vector store.",
      "properties" : {
        "VectorField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources."
        },
        "TextField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose."
        },
        "MetadataField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores metadata about the vector store."
        }
      },
      "required" : [ "MetadataField", "TextField", "VectorField" ],
      "additionalProperties" : false
    },
    "MongoDbAtlasFieldMapping" : {
      "type" : "object",
      "description" : "Contains the names of the fields to which to map information about the vector store.",
      "properties" : {
        "VectorField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores the vector embeddings for your data sources."
        },
        "TextField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose."
        },
        "MetadataField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores metadata about the vector store."
        }
      },
      "required" : [ "VectorField", "MetadataField", "TextField" ],
      "additionalProperties" : false
    },
    "MongoDbAtlasConfiguration" : {
      "type" : "object",
      "description" : "Contains the storage configuration of the knowledge base in MongoDb Atlas Cloud.",
      "properties" : {
        "Endpoint" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.mongodb\\.net$",
          "description" : "MongoDB Atlas endpoint."
        },
        "CredentialsSecretArn" : {
          "type" : "string",
          "pattern" : "^arn:aws(|-cn|-us-gov):secretsmanager:[a-z0-9-]{1,20}:([0-9]{12}|):secret:[a-zA-Z0-9!/_+=.@-]{1,512}$",
          "description" : "The ARN of the secret that you created in AWS Secrets Manager that is linked to your Amazon Mongo database."
        },
        "DatabaseName" : {
          "type" : "string",
          "maxLength" : 63,
          "pattern" : "^.*$",
          "description" : "Name of the database within MongoDB Atlas."
        },
        "CollectionName" : {
          "type" : "string",
          "maxLength" : 63,
          "pattern" : "^.*$",
          "description" : "Name of the collection within MongoDB Atlas."
        },
        "VectorIndexName" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "Name of a MongoDB Atlas index."
        },
        "TextIndexName" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "Name of a MongoDB Atlas text index."
        },
        "EndpointServiceName" : {
          "type" : "string",
          "maxLength" : 255,
          "pattern" : "^(?:arn:aws(?:-us-gov|-cn|-iso|-iso-[a-z])*:.+:.*:\\d+:.+/.+$|[a-zA-Z0-9*]+[a-zA-Z0-9._-]*)$",
          "description" : "MongoDB Atlas endpoint service name."
        },
        "FieldMapping" : {
          "$ref" : "#/definitions/MongoDbAtlasFieldMapping"
        }
      },
      "required" : [ "Endpoint", "CredentialsSecretArn", "DatabaseName", "CollectionName", "VectorIndexName", "FieldMapping" ],
      "additionalProperties" : false
    },
    "NeptuneAnalyticsFieldMapping" : {
      "type" : "object",
      "description" : "A mapping of Bedrock Knowledge Base fields to Neptune Analytics fields.",
      "properties" : {
        "TextField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores the raw text from your data. The text is split according to the chunking strategy you choose."
        },
        "MetadataField" : {
          "type" : "string",
          "maxLength" : 2048,
          "pattern" : "^.*$",
          "description" : "The name of the field in which Amazon Bedrock stores metadata about the vector store."
        }
      },
      "required" : [ "TextField", "MetadataField" ],
      "additionalProperties" : false
    },
    "NeptuneAnalyticsConfiguration" : {
      "type" : "object",
      "description" : "Contains the configurations to use Neptune Analytics as Vector Store.",
      "properties" : {
        "GraphArn" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 255,
          "pattern" : "^arn:aws(|-cn|-us-gov):neptune-graph:[a-zA-Z0-9-]*:[0-9]{12}:graph\\/g-[a-zA-Z0-9]{10}$",
          "description" : "ARN for Neptune Analytics graph database."
        },
        "FieldMapping" : {
          "$ref" : "#/definitions/NeptuneAnalyticsFieldMapping"
        }
      },
      "required" : [ "GraphArn", "FieldMapping" ],
      "additionalProperties" : false
    },
    "S3VectorsConfiguration" : {
      "type" : "object",
      "description" : "Contains the storage configuration of the knowledge base for S3 vectors.",
      "properties" : {
        "VectorBucketArn" : {
          "type" : "string",
          "description" : "The Amazon Resource Name (ARN) of the S3 bucket where vector embeddings are stored. This bucket contains the vector data used by the knowledge base."
        },
        "IndexArn" : {
          "type" : "string",
          "description" : "The Amazon Resource Name (ARN) of the vector index used for the knowledge base. This ARN identifies the specific vector index resource within Amazon Bedrock."
        },
        "IndexName" : {
          "type" : "string",
          "maxLength" : 63,
          "minLength" : 3,
          "description" : "The name of the vector index used for the knowledge base. This name identifies the vector index within the Amazon Bedrock service."
        }
      },
      "oneOf" : [ {
        "required" : [ "IndexArn" ]
      }, {
        "required" : [ "VectorBucketArn", "IndexName" ]
      } ],
      "additionalProperties" : false
    },
    "StorageConfiguration" : {
      "type" : "object",
      "description" : "The vector store service in which the knowledge base is stored.",
      "properties" : {
        "Type" : {
          "$ref" : "#/definitions/KnowledgeBaseStorageType"
        },
        "OpensearchServerlessConfiguration" : {
          "$ref" : "#/definitions/OpenSearchServerlessConfiguration"
        },
        "PineconeConfiguration" : {
          "$ref" : "#/definitions/PineconeConfiguration"
        },
        "RdsConfiguration" : {
          "$ref" : "#/definitions/RdsConfiguration"
        },
        "MongoDbAtlasConfiguration" : {
          "$ref" : "#/definitions/MongoDbAtlasConfiguration"
        },
        "NeptuneAnalyticsConfiguration" : {
          "$ref" : "#/definitions/NeptuneAnalyticsConfiguration"
        },
        "S3VectorsConfiguration" : {
          "$ref" : "#/definitions/S3VectorsConfiguration"
        },
        "OpensearchManagedClusterConfiguration" : {
          "$ref" : "#/definitions/OpenSearchManagedClusterConfiguration"
        }
      },
      "required" : [ "Type" ],
      "oneOf" : [ {
        "required" : [ "OpensearchServerlessConfiguration" ]
      }, {
        "required" : [ "PineconeConfiguration" ]
      }, {
        "required" : [ "RdsConfiguration" ]
      }, {
        "required" : [ "NeptuneAnalyticsConfiguration" ]
      }, {
        "required" : [ "S3VectorsConfiguration" ]
      }, {
        "required" : [ "MongoDbAtlasConfiguration" ]
      }, {
        "required" : [ "OpensearchManagedClusterConfiguration" ]
      } ],
      "additionalProperties" : false
    },
    "TagsMap" : {
      "type" : "object",
      "description" : "A map of tag keys and values",
      "patternProperties" : {
        "^[a-zA-Z0-9\\s._:/=+@-]*$" : {
          "type" : "string",
          "maxLength" : 256,
          "minLength" : 0,
          "pattern" : "^[a-zA-Z0-9\\s._:/=+@-]*$",
          "description" : "Value of a tag"
        }
      },
      "additionalProperties" : false
    },
    "FixedLengthDuration" : {
      "type" : "integer",
      "description" : "Duration in seconds to segment the multi modal media",
      "minimum" : 1,
      "maximum" : 30
    },
    "AudioSegmentationConfiguration" : {
      "type" : "object",
      "description" : "Configure the audio segmentation configuration for multi modal ingestion.",
      "properties" : {
        "FixedLengthDuration" : {
          "$ref" : "#/definitions/FixedLengthDuration"
        }
      },
      "required" : [ "FixedLengthDuration" ],
      "additionalProperties" : false
    },
    "VideoSegmentationConfiguration" : {
      "type" : "object",
      "description" : "Configure the video segmentation configuration for multi modal ingestion.",
      "properties" : {
        "FixedLengthDuration" : {
          "$ref" : "#/definitions/FixedLengthDuration"
        }
      },
      "required" : [ "FixedLengthDuration" ],
      "additionalProperties" : false
    },
    "AudioConfiguration" : {
      "type" : "object",
      "description" : "Configure the audio configuration for multi modal ingestion.",
      "properties" : {
        "SegmentationConfiguration" : {
          "$ref" : "#/definitions/AudioSegmentationConfiguration"
        }
      },
      "required" : [ "SegmentationConfiguration" ],
      "additionalProperties" : false
    },
    "VideoConfiguration" : {
      "type" : "object",
      "description" : "Configure the video configuration for multi modal ingestion.",
      "properties" : {
        "SegmentationConfiguration" : {
          "$ref" : "#/definitions/VideoSegmentationConfiguration"
        }
      },
      "required" : [ "SegmentationConfiguration" ],
      "additionalProperties" : false
    },
    "AudioConfigurations" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/AudioConfiguration"
      },
      "maxItems" : 1,
      "minItems" : 1,
      "description" : "List of audio configurations for multi modal ingestion.",
      "insertionOrder" : false
    },
    "VideoConfigurations" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/VideoConfiguration"
      },
      "maxItems" : 1,
      "minItems" : 1,
      "description" : "List of video configurations for multi modal ingestion.",
      "insertionOrder" : false
    },
    "BedrockEmbeddingModelConfiguration" : {
      "type" : "object",
      "description" : "The vector configuration details for the Bedrock embeddings model.",
      "properties" : {
        "Dimensions" : {
          "type" : "integer",
          "maximum" : 4096,
          "minimum" : 0,
          "description" : "The dimensions details for the vector configuration used on the Bedrock embeddings model."
        },
        "EmbeddingDataType" : {
          "type" : "string",
          "description" : "The data type for the vectors when using a model to convert text into vector embeddings.",
          "enum" : [ "FLOAT32", "BINARY" ]
        },
        "Audio" : {
          "$ref" : "#/definitions/AudioConfigurations"
        },
        "Video" : {
          "$ref" : "#/definitions/VideoConfigurations"
        }
      },
      "additionalProperties" : false
    },
    "EmbeddingModelConfiguration" : {
      "type" : "object",
      "description" : "The embeddings model configuration details for the vector model used in Knowledge Base.",
      "properties" : {
        "BedrockEmbeddingModelConfiguration" : {
          "$ref" : "#/definitions/BedrockEmbeddingModelConfiguration"
        }
      },
      "additionalProperties" : false
    },
    "VectorKnowledgeBaseConfiguration" : {
      "type" : "object",
      "description" : "Contains details about the model used to create vector embeddings for the knowledge base.",
      "properties" : {
        "EmbeddingModelArn" : {
          "type" : "string",
          "maxLength" : 2048,
          "minLength" : 20,
          "pattern" : "^(arn:aws(-[^:]+)?:[a-z0-9-]+:[a-z0-9-]{1,20}:[0-9]{0,12}:[a-zA-Z0-9-:/._+]+)$",
          "description" : "The ARN of the model used to create vector embeddings for the knowledge base."
        },
        "EmbeddingModelConfiguration" : {
          "$ref" : "#/definitions/EmbeddingModelConfiguration"
        },
        "SupplementalDataStorageConfiguration" : {
          "$ref" : "#/definitions/SupplementalDataStorageConfiguration"
        }
      },
      "required" : [ "EmbeddingModelArn" ],
      "additionalProperties" : false
    },
    "S3Location" : {
      "type" : "object",
      "description" : "An Amazon S3 location.",
      "properties" : {
        "URI" : {
          "type" : "string",
          "maxLength" : 2048,
          "minLength" : 1,
          "pattern" : "^s3://.{1,128}$",
          "description" : "The location's URI"
        }
      },
      "required" : [ "URI" ],
      "additionalProperties" : false
    },
    "SupplementalDataStorageLocationType" : {
      "type" : "string",
      "description" : "Supplemental data storage location type.",
      "enum" : [ "S3" ]
    },
    "SupplementalDataStorageLocation" : {
      "type" : "object",
      "description" : "Supplemental data storage location.",
      "properties" : {
        "SupplementalDataStorageLocationType" : {
          "$ref" : "#/definitions/SupplementalDataStorageLocationType"
        },
        "S3Location" : {
          "$ref" : "#/definitions/S3Location"
        }
      },
      "required" : [ "SupplementalDataStorageLocationType" ],
      "additionalProperties" : false
    },
    "SupplementalDataStorageLocations" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/SupplementalDataStorageLocation"
      },
      "maxItems" : 1,
      "minItems" : 1,
      "description" : "List of supplemental data storage locations.",
      "insertionOrder" : false
    },
    "SupplementalDataStorageConfiguration" : {
      "type" : "object",
      "description" : "Configurations for supplemental data storage.",
      "properties" : {
        "SupplementalDataStorageLocations" : {
          "$ref" : "#/definitions/SupplementalDataStorageLocations"
        }
      },
      "required" : [ "SupplementalDataStorageLocations" ],
      "additionalProperties" : false
    },
    "EmbeddingModelType" : {
      "type" : "string",
      "description" : "The type of embedding model to use for the managed knowledge base.",
      "enum" : [ "CUSTOM", "MANAGED" ]
    },
    "ManagedKnowledgeBaseConfiguration" : {
      "type" : "object",
      "description" : "Contains details about the model used to create vector embeddings for a managed knowledge base.",
      "properties" : {
        "EmbeddingModelArn" : {
          "type" : "string",
          "maxLength" : 2048,
          "minLength" : 20,
          "pattern" : "^(arn:aws(-[^:]+)?:[a-z0-9-]+:[a-z0-9-]{1,20}:[0-9]{0,12}:[a-zA-Z0-9-:/._+]+)$",
          "description" : "The ARN of the model used to create vector embeddings for the knowledge base."
        },
        "EmbeddingModelType" : {
          "$ref" : "#/definitions/EmbeddingModelType"
        },
        "EmbeddingModelConfiguration" : {
          "$ref" : "#/definitions/EmbeddingModelConfiguration"
        },
        "ServerSideEncryptionConfiguration" : {
          "$ref" : "#/definitions/ManagedKnowledgeBaseServerSideEncryptionConfiguration"
        }
      },
      "required" : [ "EmbeddingModelArn" ],
      "additionalProperties" : false
    },
    "ManagedKnowledgeBaseServerSideEncryptionConfiguration" : {
      "type" : "object",
      "description" : "Contains details about the server-side encryption for the managed knowledge base.",
      "properties" : {
        "KmsKeyArn" : {
          "type" : "string",
          "maxLength" : 2048,
          "minLength" : 1,
          "pattern" : "^arn:aws(-cn|-us-gov|-eusc|-iso(-[b-f])?)?:kms:[a-zA-Z0-9-]*:[0-9]{12}:key/[a-zA-Z0-9-]{36}$",
          "description" : "The ARN of the AWS KMS key used to encrypt the managed knowledge base."
        }
      },
      "additionalProperties" : false
    },
    "KendraKnowledgeBaseConfiguration" : {
      "type" : "object",
      "description" : "Configurations for a Kendra knowledge base",
      "properties" : {
        "KendraIndexArn" : {
          "$ref" : "#/definitions/KendraIndexArn"
        }
      },
      "required" : [ "KendraIndexArn" ],
      "additionalProperties" : false
    },
    "KendraIndexArn" : {
      "type" : "string",
      "description" : "Arn of a Kendra index",
      "pattern" : "^arn:aws(|-cn|-us-gov):kendra:[a-z0-9-]{1,20}:([0-9]{12}|):index/([a-zA-Z0-9][a-zA-Z0-9-]{35}|[a-zA-Z0-9][a-zA-Z0-9-]{35}-[a-zA-Z0-9][a-zA-Z0-9-]{35})$"
    },
    "SqlKnowledgeBaseConfiguration" : {
      "type" : "object",
      "description" : "Configurations for a SQL knowledge base",
      "properties" : {
        "Type" : {
          "$ref" : "#/definitions/QueryEngineType"
        },
        "RedshiftConfiguration" : {
          "$ref" : "#/definitions/RedshiftConfiguration"
        }
      },
      "required" : [ "Type" ],
      "additionalProperties" : false
    },
    "QueryEngineType" : {
      "type" : "string",
      "description" : "SQL query engine type",
      "enum" : [ "REDSHIFT" ]
    },
    "RedshiftConfiguration" : {
      "type" : "object",
      "description" : "Configurations for a Redshift knowledge base",
      "properties" : {
        "StorageConfigurations" : {
          "$ref" : "#/definitions/RedshiftQueryEngineStorageConfigurations"
        },
        "QueryEngineConfiguration" : {
          "$ref" : "#/definitions/RedshiftQueryEngineConfiguration"
        },
        "QueryGenerationConfiguration" : {
          "$ref" : "#/definitions/QueryGenerationConfiguration"
        }
      },
      "required" : [ "StorageConfigurations", "QueryEngineConfiguration" ],
      "additionalProperties" : false
    },
    "RedshiftQueryEngineStorageConfigurations" : {
      "type" : "array",
      "description" : "List of configurations for available Redshift query engine storage types",
      "minItems" : 1,
      "maxItems" : 1,
      "items" : {
        "$ref" : "#/definitions/RedshiftQueryEngineStorageConfiguration"
      },
      "insertionOrder" : false
    },
    "RedshiftQueryEngineStorageConfiguration" : {
      "type" : "object",
      "description" : "Configurations for available Redshift query engine storage types",
      "properties" : {
        "Type" : {
          "$ref" : "#/definitions/RedshiftQueryEngineStorageType"
        },
        "AwsDataCatalogConfiguration" : {
          "$ref" : "#/definitions/RedshiftQueryEngineAwsDataCatalogStorageConfiguration"
        },
        "RedshiftConfiguration" : {
          "$ref" : "#/definitions/RedshiftQueryEngineRedshiftStorageConfiguration"
        }
      },
      "required" : [ "Type" ],
      "additionalProperties" : false
    },
    "RedshiftQueryEngineStorageType" : {
      "type" : "string",
      "description" : "Redshift query engine storage type",
      "enum" : [ "REDSHIFT", "AWS_DATA_CATALOG" ]
    },
    "RedshiftQueryEngineAwsDataCatalogStorageConfiguration" : {
      "type" : "object",
      "description" : "Configurations for Redshift query engine AWS Data Catalog backed storage",
      "properties" : {
        "TableNames" : {
          "$ref" : "#/definitions/AwsDataCatalogTableNames"
        }
      },
      "required" : [ "TableNames" ],
      "additionalProperties" : false
    },
    "AwsDataCatalogTableNames" : {
      "type" : "array",
      "description" : "List of table names in AWS Data Catalog. Must follow two part notation",
      "items" : {
        "$ref" : "#/definitions/AwsDataCatalogTableName"
      },
      "minItems" : 1,
      "maxItems" : 1000,
      "insertionOrder" : false
    },
    "AwsDataCatalogTableName" : {
      "type" : "string",
      "description" : "AWS Data Catalog table name",
      "pattern" : "^.*\\.*$",
      "minLength" : 1,
      "maxLength" : 200
    },
    "RedshiftQueryEngineRedshiftStorageConfiguration" : {
      "type" : "object",
      "description" : "Configurations for Redshift query engine Redshift backed storage",
      "properties" : {
        "DatabaseName" : {
          "$ref" : "#/definitions/RedshiftDatabase"
        }
      },
      "required" : [ "DatabaseName" ],
      "additionalProperties" : false
    },
    "RedshiftDatabase" : {
      "type" : "string",
      "description" : "Redshift database name",
      "minLength" : 1,
      "maxLength" : 200
    },
    "RedshiftQueryEngineConfiguration" : {
      "type" : "object",
      "description" : "Configurations for Redshift query engine",
      "properties" : {
        "Type" : {
          "$ref" : "#/definitions/RedshiftQueryEngineType"
        },
        "ServerlessConfiguration" : {
          "$ref" : "#/definitions/RedshiftServerlessConfiguration"
        },
        "ProvisionedConfiguration" : {
          "$ref" : "#/definitions/RedshiftProvisionedConfiguration"
        }
      },
      "required" : [ "Type" ],
      "additionalProperties" : false
    },
    "RedshiftQueryEngineType" : {
      "type" : "string",
      "description" : "Redshift query engine type",
      "enum" : [ "SERVERLESS", "PROVISIONED" ]
    },
    "RedshiftServerlessConfiguration" : {
      "type" : "object",
      "description" : "Configurations for serverless Redshift query engine",
      "properties" : {
        "WorkgroupArn" : {
          "$ref" : "#/definitions/WorkgroupArn"
        },
        "AuthConfiguration" : {
          "$ref" : "#/definitions/RedshiftServerlessAuthConfiguration"
        }
      },
      "required" : [ "WorkgroupArn", "AuthConfiguration" ],
      "additionalProperties" : false
    },
    "WorkgroupArn" : {
      "type" : "string",
      "description" : "Workgroup arn",
      "pattern" : "^(arn:(aws(-[a-z]+)*):redshift-serverless:[a-z]{2}(-gov)?-[a-z]+-\\d{1}:\\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$"
    },
    "RedshiftServerlessAuthConfiguration" : {
      "type" : "object",
      "description" : "Configurations for Redshift query engine serverless auth setup",
      "properties" : {
        "Type" : {
          "$ref" : "#/definitions/RedshiftServerlessAuthType"
        },
        "UsernamePasswordSecretArn" : {
          "$ref" : "#/definitions/SecretArn"
        }
      },
      "required" : [ "Type" ],
      "additionalProperties" : false
    },
    "RedshiftServerlessAuthType" : {
      "type" : "string",
      "description" : "Serverless Redshift auth type",
      "enum" : [ "IAM", "USERNAME_PASSWORD" ]
    },
    "SecretArn" : {
      "type" : "string",
      "description" : "Arn of a SecretsManager Secret",
      "pattern" : "^arn:aws(|-cn|-us-gov):secretsmanager:[a-z0-9-]{1,20}:([0-9]{12}|):secret:[a-zA-Z0-9!/_+=.@-]{1,512}$"
    },
    "RedshiftProvisionedConfiguration" : {
      "type" : "object",
      "description" : "Configurations for provisioned Redshift query engine",
      "properties" : {
        "ClusterIdentifier" : {
          "$ref" : "#/definitions/RedshiftClusterIdentifier"
        },
        "AuthConfiguration" : {
          "$ref" : "#/definitions/RedshiftProvisionedAuthConfiguration"
        }
      },
      "required" : [ "ClusterIdentifier", "AuthConfiguration" ],
      "additionalProperties" : false
    },
    "RedshiftClusterIdentifier" : {
      "type" : "string",
      "description" : "Redshift cluster identifier",
      "minLength" : 1,
      "maxLength" : 63
    },
    "RedshiftProvisionedAuthConfiguration" : {
      "type" : "object",
      "description" : "Configurations for Redshift query engine provisioned auth setup",
      "properties" : {
        "Type" : {
          "$ref" : "#/definitions/RedshiftProvisionedAuthType"
        },
        "DatabaseUser" : {
          "type" : "string",
          "description" : "Redshift database user"
        },
        "UsernamePasswordSecretArn" : {
          "$ref" : "#/definitions/SecretArn"
        }
      },
      "required" : [ "Type" ],
      "additionalProperties" : false
    },
    "RedshiftProvisionedAuthType" : {
      "type" : "string",
      "description" : "Provisioned Redshift auth type",
      "enum" : [ "IAM", "USERNAME_PASSWORD", "USERNAME" ]
    },
    "QueryGenerationConfiguration" : {
      "type" : "object",
      "description" : "Configurations for generating Redshift engine queries",
      "properties" : {
        "ExecutionTimeoutSeconds" : {
          "$ref" : "#/definitions/QueryExecutionTimeoutSeconds"
        },
        "GenerationContext" : {
          "$ref" : "#/definitions/QueryGenerationContext"
        }
      },
      "additionalProperties" : false
    },
    "QueryExecutionTimeoutSeconds" : {
      "type" : "integer",
      "description" : "Max query execution timeout",
      "minimum" : 1,
      "maximum" : 200
    },
    "QueryGenerationContext" : {
      "type" : "object",
      "description" : "Context used to improve query generation",
      "properties" : {
        "Tables" : {
          "$ref" : "#/definitions/QueryGenerationTables"
        },
        "CuratedQueries" : {
          "$ref" : "#/definitions/CuratedQueries"
        }
      },
      "additionalProperties" : false
    },
    "QueryGenerationTables" : {
      "type" : "array",
      "description" : "List of tables used for Redshift query generation context",
      "items" : {
        "$ref" : "#/definitions/QueryGenerationTable"
      },
      "maxItems" : 50,
      "insertionOrder" : false
    },
    "QueryGenerationTable" : {
      "type" : "object",
      "description" : "Tables used for Redshift query generation context",
      "properties" : {
        "Name" : {
          "$ref" : "#/definitions/QueryGenerationTableName"
        },
        "Description" : {
          "$ref" : "#/definitions/DescriptionString"
        },
        "Inclusion" : {
          "$ref" : "#/definitions/InclusionType"
        },
        "Columns" : {
          "$ref" : "#/definitions/QueryGenerationColumns"
        }
      },
      "required" : [ "Name" ],
      "additionalProperties" : false
    },
    "QueryGenerationTableName" : {
      "type" : "string",
      "description" : "Query generation table name. Must follow three-part notation",
      "pattern" : "^.*\\..*\\..*$"
    },
    "DescriptionString" : {
      "type" : "string",
      "description" : "Description for the attached entity",
      "minLength" : 1,
      "maxLength" : 200
    },
    "InclusionType" : {
      "type" : "string",
      "description" : "Include or Exclude status for an entity",
      "enum" : [ "INCLUDE", "EXCLUDE" ]
    },
    "QueryGenerationColumns" : {
      "type" : "array",
      "description" : "List of Redshift query generation columns",
      "items" : {
        "$ref" : "#/definitions/QueryGenerationColumn"
      },
      "insertionOrder" : false
    },
    "QueryGenerationColumn" : {
      "type" : "object",
      "description" : "Redshift query generation column",
      "properties" : {
        "Name" : {
          "$ref" : "#/definitions/QueryGenerationColumnName"
        },
        "Description" : {
          "$ref" : "#/definitions/DescriptionString"
        },
        "Inclusion" : {
          "$ref" : "#/definitions/InclusionType"
        }
      },
      "additionalProperties" : false
    },
    "QueryGenerationColumnName" : {
      "type" : "string",
      "description" : "Query generation column name",
      "minLength" : 1,
      "maxLength" : 127
    },
    "CuratedQueries" : {
      "type" : "array",
      "description" : "List of example queries and results",
      "maxItems" : 10,
      "items" : {
        "$ref" : "#/definitions/CuratedQuery"
      },
      "insertionOrder" : false
    },
    "CuratedQuery" : {
      "type" : "object",
      "description" : "Curated query or question and answer pair",
      "properties" : {
        "NaturalLanguage" : {
          "$ref" : "#/definitions/NaturalLanguageString"
        },
        "Sql" : {
          "$ref" : "#/definitions/SqlString"
        }
      },
      "required" : [ "NaturalLanguage", "Sql" ],
      "additionalProperties" : false
    },
    "NaturalLanguageString" : {
      "type" : "string",
      "description" : "Question for the curated query",
      "minLength" : 1,
      "maxLength" : 1000
    },
    "SqlString" : {
      "type" : "string",
      "description" : "Answer for the curated query",
      "minLength" : 1,
      "maxLength" : 1000
    }
  },
  "properties" : {
    "Description" : {
      "type" : "string",
      "maxLength" : 200,
      "minLength" : 1,
      "description" : "Description of the Resource."
    },
    "KnowledgeBaseConfiguration" : {
      "$ref" : "#/definitions/KnowledgeBaseConfiguration"
    },
    "KnowledgeBaseId" : {
      "type" : "string",
      "pattern" : "^[0-9a-zA-Z]{10}$",
      "description" : "The unique identifier of the knowledge base."
    },
    "KnowledgeBaseArn" : {
      "type" : "string",
      "maxLength" : 128,
      "minLength" : 0,
      "pattern" : "^arn:aws(|-cn|-us-gov):bedrock:[a-zA-Z0-9-]*:[0-9]{12}:knowledge-base/[0-9a-zA-Z]+$",
      "description" : "The ARN of the knowledge base."
    },
    "Name" : {
      "type" : "string",
      "pattern" : "^([0-9a-zA-Z][_-]?){1,100}$",
      "description" : "The name of the knowledge base."
    },
    "Status" : {
      "$ref" : "#/definitions/KnowledgeBaseStatus"
    },
    "RoleArn" : {
      "type" : "string",
      "maxLength" : 2048,
      "pattern" : "^arn:aws(-[^:]+)?:iam::([0-9]{12})?:role/.+$",
      "description" : "The ARN of the IAM role with permissions to invoke API operations on the knowledge base. The ARN must begin with AmazonBedrockExecutionRoleForKnowledgeBase_"
    },
    "CreatedAt" : {
      "type" : "string",
      "description" : "The time at which the knowledge base was created."
    },
    "FailureReasons" : {
      "type" : "array",
      "items" : {
        "type" : "string",
        "maxLength" : 2048,
        "description" : "Failure Reason for Error."
      },
      "maxItems" : 2048,
      "description" : "A list of reasons that the API operation on the knowledge base failed.",
      "insertionOrder" : false
    },
    "UpdatedAt" : {
      "type" : "string",
      "description" : "The time at which the knowledge base was last updated."
    },
    "StorageConfiguration" : {
      "$ref" : "#/definitions/StorageConfiguration"
    },
    "Tags" : {
      "$ref" : "#/definitions/TagsMap"
    }
  },
  "required" : [ "KnowledgeBaseConfiguration", "Name", "RoleArn" ],
  "readOnlyProperties" : [ "/properties/KnowledgeBaseId", "/properties/KnowledgeBaseArn", "/properties/CreatedAt", "/properties/UpdatedAt", "/properties/FailureReasons", "/properties/Status" ],
  "createOnlyProperties" : [ "/properties/StorageConfiguration", "/properties/KnowledgeBaseConfiguration/Type", "/properties/KnowledgeBaseConfiguration/VectorKnowledgeBaseConfiguration", "/properties/KnowledgeBaseConfiguration/KendraKnowledgeBaseConfiguration", "/properties/KnowledgeBaseConfiguration/ManagedKnowledgeBaseConfiguration", "/properties/KnowledgeBaseConfiguration/SqlKnowledgeBaseConfiguration/Type", "/properties/KnowledgeBaseConfiguration/SqlKnowledgeBaseConfiguration/RedshiftConfiguration/StorageConfigurations", "/properties/KnowledgeBaseConfiguration/SqlKnowledgeBaseConfiguration/RedshiftConfiguration/QueryEngineConfiguration" ],
  "primaryIdentifier" : [ "/properties/KnowledgeBaseId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "bedrock:CreateKnowledgeBase", "bedrock:GetKnowledgeBase", "bedrock:TagResource", "bedrock:ListTagsForResource", "bedrock:AssociateThirdPartyKnowledgeBase", "iam:PassRole", "kms:CreateGrant", "kms:RetireGrant", "kms:GenerateDataKey", "kms:GenerateDataKeyWithoutPlaintext", "kms:Encrypt", "kms:Decrypt" ]
    },
    "read" : {
      "permissions" : [ "bedrock:GetKnowledgeBase", "bedrock:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "bedrock:GetKnowledgeBase", "bedrock:UpdateKnowledgeBase", "bedrock:TagResource", "bedrock:UntagResource", "bedrock:ListTagsForResource", "bedrock:AssociateThirdPartyKnowledgeBase", "iam:PassRole", "kms:CreateGrant", "kms:RetireGrant", "kms:GenerateDataKey", "kms:GenerateDataKeyWithoutPlaintext", "kms:Encrypt", "kms:Decrypt" ]
    },
    "delete" : {
      "permissions" : [ "bedrock:GetKnowledgeBase", "bedrock:DeleteKnowledgeBase", "bedrock:ListDataSources" ]
    },
    "list" : {
      "permissions" : [ "bedrock:ListKnowledgeBases" ]
    }
  },
  "tagging" : {
    "cloudFormationSystemTags" : true,
    "tagOnCreate" : true,
    "tagProperty" : "/properties/Tags",
    "tagUpdatable" : true,
    "taggable" : true,
    "permissions" : [ "bedrock:TagResource", "bedrock:UntagResource", "bedrock:ListTagsForResource" ]
  },
  "additionalProperties" : false
}