{
  "typeName" : "AWS::Bedrock::IntelligentPromptRouter",
  "description" : "Definition of AWS::Bedrock::IntelligentPromptRouter Resource Type",
  "definitions" : {
    "PromptRouterStatus" : {
      "type" : "string",
      "description" : "Status of a PromptRouter",
      "enum" : [ "AVAILABLE" ]
    },
    "PromptRouterTargetModel" : {
      "type" : "object",
      "description" : "Model configuration",
      "properties" : {
        "ModelArn" : {
          "type" : "string",
          "maxLength" : 2048,
          "minLength" : 1,
          "pattern" : "(^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}::foundation-model/[a-z0-9-]{1,63}[.]{1}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2})|(^arn:aws(|-us-gov|-cn|-iso|-iso-b):bedrock:(|[0-9a-z-]{0,20}):(|[0-9]{12}):(inference-profile|application-inference-profile)/[a-zA-Z0-9-:.]+)$",
          "description" : "Arn of underlying model which are added in the Prompt Router."
        }
      },
      "required" : [ "ModelArn" ],
      "additionalProperties" : false
    },
    "PromptRouterType" : {
      "type" : "string",
      "description" : "Type of a Prompt Router",
      "enum" : [ "custom", "default" ]
    },
    "RoutingCriteria" : {
      "type" : "object",
      "description" : "Represents the criteria used for routing requests.",
      "properties" : {
        "ResponseQualityDifference" : {
          "type" : "number",
          "maximum" : 100,
          "minimum" : 0
        }
      },
      "required" : [ "ResponseQualityDifference" ],
      "additionalProperties" : false
    },
    "Tag" : {
      "type" : "object",
      "description" : "Definition of the key/value pair for a tag",
      "properties" : {
        "Key" : {
          "type" : "string",
          "maxLength" : 128,
          "minLength" : 1,
          "pattern" : "^[a-zA-Z0-9\\s._:/=+@-]*$",
          "description" : "Tag Key"
        },
        "Value" : {
          "type" : "string",
          "maxLength" : 256,
          "minLength" : 0,
          "pattern" : "^[a-zA-Z0-9\\s._:/=+@-]*$",
          "description" : "Tag Value"
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "CreatedAt" : {
      "type" : "string",
      "description" : "Time Stamp",
      "format" : "date-time"
    },
    "Description" : {
      "type" : "string",
      "maxLength" : 200,
      "minLength" : 1,
      "pattern" : "^([0-9a-zA-Z:.][ _-]?)+$",
      "description" : "Description of the Prompt Router."
    },
    "FallbackModel" : {
      "$ref" : "#/definitions/PromptRouterTargetModel"
    },
    "Models" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/PromptRouterTargetModel"
      },
      "description" : "List of model configuration"
    },
    "PromptRouterArn" : {
      "type" : "string",
      "maxLength" : 2048,
      "minLength" : 1,
      "pattern" : "^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:(default-)?prompt-router/[a-zA-Z0-9-:.]+$",
      "description" : "Arn of the Prompt Router."
    },
    "PromptRouterName" : {
      "type" : "string",
      "maxLength" : 64,
      "minLength" : 1,
      "pattern" : "^([0-9a-zA-Z][ _-]?)+$",
      "description" : "Name of the Prompt Router."
    },
    "RoutingCriteria" : {
      "$ref" : "#/definitions/RoutingCriteria"
    },
    "Status" : {
      "$ref" : "#/definitions/PromptRouterStatus"
    },
    "Tags" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "maxItems" : 200,
      "minItems" : 0,
      "description" : "List of Tags"
    },
    "Type" : {
      "$ref" : "#/definitions/PromptRouterType"
    },
    "UpdatedAt" : {
      "type" : "string",
      "description" : "Time Stamp",
      "format" : "date-time"
    }
  },
  "required" : [ "FallbackModel", "Models", "PromptRouterName", "RoutingCriteria" ],
  "readOnlyProperties" : [ "/properties/CreatedAt", "/properties/PromptRouterArn", "/properties/Status", "/properties/Type", "/properties/UpdatedAt" ],
  "createOnlyProperties" : [ "/properties/FallbackModel", "/properties/Models", "/properties/PromptRouterName", "/properties/RoutingCriteria", "/properties/Description" ],
  "primaryIdentifier" : [ "/properties/PromptRouterArn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "bedrock:CreatePromptRouter", "bedrock:GetPromptRouter", "bedrock:TagResource", "bedrock:ListTagsForResource" ]
    },
    "read" : {
      "permissions" : [ "bedrock:GetPromptRouter", "bedrock:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "bedrock:GetPromptRouter", "bedrock:ListTagsForResource", "bedrock:TagResource", "bedrock:UntagResource" ]
    },
    "delete" : {
      "permissions" : [ "bedrock:DeletePromptRouter", "bedrock:GetPromptRouter" ]
    },
    "list" : {
      "permissions" : [ "bedrock:ListPromptRouters" ]
    }
  },
  "tagging" : {
    "cloudFormationSystemTags" : true,
    "tagOnCreate" : true,
    "tagProperty" : "/properties/Tags",
    "tagUpdatable" : true,
    "taggable" : true,
    "permissions" : [ "bedrock:TagResource", "bedrock:UntagResource", "bedrock:ListTagsForResource" ]
  },
  "additionalProperties" : false
}