{
 "additionalProperties": false,
 "definitions": {
  "AllowedScope": {
   "pattern": "[\\x21\\x23-\\x5B\\x5D-\\x7E]+",
   "type": "string"
  },
  "AuthorizerConfiguration": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "CustomJWTAuthorizer": {
       "$ref": "#/definitions/CustomJWTAuthorizerConfiguration"
      }
     },
     "required": [
      "CustomJWTAuthorizer"
     ],
     "title": "CustomJWTAuthorizer",
     "type": "object"
    }
   ]
  },
  "AuthorizerType": {
   "enum": [
    "CUSTOM_JWT",
    "AWS_IAM",
    "NONE"
   ],
   "type": "string"
  },
  "AuthorizingClaimMatchValueType": {
   "additionalProperties": false,
   "properties": {
    "ClaimMatchOperator": {
     "$ref": "#/definitions/ClaimMatchOperator"
    },
    "ClaimMatchValue": {
     "$ref": "#/definitions/ClaimMatchValueType"
    }
   },
   "required": [
    "ClaimMatchOperator",
    "ClaimMatchValue"
   ],
   "type": "object"
  },
  "ClaimMatchOperator": {
   "enum": [
    "EQUALS",
    "CONTAINS",
    "CONTAINS_ANY"
   ],
   "type": "string"
  },
  "ClaimMatchValueType": {
   "additionalProperties": false,
   "oneOf": [
    {
     "required": [
      "MatchValueString"
     ]
    },
    {
     "required": [
      "MatchValueStringList"
     ]
    }
   ],
   "properties": {
    "MatchValueString": {
     "$ref": "#/definitions/MatchValueString"
    },
    "MatchValueStringList": {
     "$ref": "#/definitions/MatchValueStringList"
    }
   },
   "type": "object"
  },
  "CustomClaimValidationType": {
   "additionalProperties": false,
   "properties": {
    "AuthorizingClaimMatchValue": {
     "$ref": "#/definitions/AuthorizingClaimMatchValueType"
    },
    "InboundTokenClaimName": {
     "$ref": "#/definitions/InboundTokenClaimName"
    },
    "InboundTokenClaimValueType": {
     "$ref": "#/definitions/InboundTokenClaimValueType"
    }
   },
   "required": [
    "AuthorizingClaimMatchValue",
    "InboundTokenClaimName",
    "InboundTokenClaimValueType"
   ],
   "type": "object"
  },
  "CustomJWTAuthorizerConfiguration": {
   "additionalProperties": false,
   "properties": {
    "AllowedAudience": {
     "items": {
      "type": "string"
     },
     "minItems": 1,
     "type": "array"
    },
    "AllowedClients": {
     "items": {
      "type": "string"
     },
     "minItems": 1,
     "type": "array"
    },
    "AllowedScopes": {
     "items": {
      "$ref": "#/definitions/AllowedScope"
     },
     "minItems": 1,
     "type": "array"
    },
    "CustomClaims": {
     "items": {
      "$ref": "#/definitions/CustomClaimValidationType"
     },
     "minItems": 1,
     "type": "array"
    },
    "DiscoveryUrl": {
     "pattern": "^.+/\\.well-known/openid-configuration$",
     "type": "string"
    }
   },
   "required": [
    "DiscoveryUrl"
   ],
   "type": "object"
  },
  "ExceptionLevel": {
   "enum": [
    "DEBUG"
   ],
   "type": "string"
  },
  "GatewayInterceptionPoint": {
   "enum": [
    "REQUEST",
    "RESPONSE"
   ],
   "type": "string"
  },
  "GatewayInterceptorConfiguration": {
   "additionalProperties": false,
   "properties": {
    "InputConfiguration": {
     "$ref": "#/definitions/InterceptorInputConfiguration"
    },
    "InterceptionPoints": {
     "items": {
      "$ref": "#/definitions/GatewayInterceptionPoint"
     },
     "maxItems": 2,
     "minItems": 1,
     "type": "array"
    },
    "Interceptor": {
     "$ref": "#/definitions/InterceptorConfiguration"
    }
   },
   "required": [
    "Interceptor",
    "InterceptionPoints"
   ],
   "type": "object"
  },
  "GatewayPolicyEngineConfiguration": {
   "additionalProperties": false,
   "properties": {
    "Arn": {
     "maxLength": 170,
     "minLength": 1,
     "pattern": "^arn:[a-z0-9-]{1,20}:bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:policy-engine/[a-zA-Z][a-zA-Z0-9-_]{0,99}-[a-zA-Z0-9_]{10}$",
     "type": "string"
    },
    "Mode": {
     "$ref": "#/definitions/GatewayPolicyEngineMode"
    }
   },
   "required": [
    "Arn",
    "Mode"
   ],
   "type": "object"
  },
  "GatewayPolicyEngineMode": {
   "enum": [
    "LOG_ONLY",
    "ENFORCE"
   ],
   "type": "string"
  },
  "GatewayProtocolConfiguration": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "Mcp": {
       "$ref": "#/definitions/MCPGatewayConfiguration"
      }
     },
     "required": [
      "Mcp"
     ],
     "title": "Mcp",
     "type": "object"
    }
   ]
  },
  "GatewayProtocolType": {
   "enum": [
    "MCP"
   ],
   "type": "string"
  },
  "GatewayStatus": {
   "enum": [
    "CREATING",
    "UPDATING",
    "UPDATE_UNSUCCESSFUL",
    "DELETING",
    "READY",
    "FAILED"
   ],
   "type": "string"
  },
  "InboundTokenClaimName": {
   "pattern": "[A-Za-z0-9_.-:]+",
   "type": "string"
  },
  "InboundTokenClaimValueType": {
   "enum": [
    "STRING",
    "STRING_ARRAY"
   ],
   "type": "string"
  },
  "InterceptorConfiguration": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "Lambda": {
       "$ref": "#/definitions/LambdaInterceptorConfiguration"
      }
     },
     "required": [
      "Lambda"
     ],
     "title": "Lambda",
     "type": "object"
    }
   ]
  },
  "InterceptorInputConfiguration": {
   "additionalProperties": false,
   "properties": {
    "PassRequestHeaders": {
     "type": "boolean"
    }
   },
   "required": [
    "PassRequestHeaders"
   ],
   "type": "object"
  },
  "LambdaInterceptorConfiguration": {
   "additionalProperties": false,
   "properties": {
    "Arn": {
     "maxLength": 170,
     "minLength": 1,
     "pattern": "^arn:[a-z0-9-]{1,20}:lambda:([a-z]{2}(-gov)?-[a-z]+-\\d{1}):(\\d{12}):function:([a-zA-Z0-9-_.]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?$",
     "type": "string"
    }
   },
   "required": [
    "Arn"
   ],
   "type": "object"
  },
  "MCPGatewayConfiguration": {
   "additionalProperties": false,
   "properties": {
    "Instructions": {
     "maxLength": 2048,
     "minLength": 1,
     "type": "string"
    },
    "SearchType": {
     "$ref": "#/definitions/SearchType"
    },
    "SupportedVersions": {
     "items": {
      "default": "2025-03-26",
      "type": "string"
     },
     "type": "array"
    }
   },
   "type": "object"
  },
  "MatchValueString": {
   "pattern": "[A-Za-z0-9_.-]+",
   "type": "string"
  },
  "MatchValueStringList": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/MatchValueString"
   },
   "maxItems": 255,
   "minItems": 1,
   "type": "array"
  },
  "SearchType": {
   "enum": [
    "SEMANTIC"
   ],
   "type": "string"
  },
  "TagsMap": {
   "additionalProperties": false,
   "maxProperties": 50,
   "minProperties": 0,
   "patternProperties": {
    "^[a-zA-Z0-9\\s._:/=+@-]*$": {
     "maxLength": 256,
     "minLength": 0,
     "pattern": "^[a-zA-Z0-9\\s._:/=+@-]*$",
     "type": "string"
    }
   },
   "type": "object"
  },
  "WorkloadIdentityDetails": {
   "additionalProperties": false,
   "properties": {
    "WorkloadIdentityArn": {
     "maxLength": 1024,
     "minLength": 1,
     "type": "string"
    }
   },
   "required": [
    "WorkloadIdentityArn"
   ],
   "type": "object"
  }
 },
 "primaryIdentifier": [
  "/properties/GatewayIdentifier"
 ],
 "properties": {
  "AuthorizerConfiguration": {
   "$ref": "#/definitions/AuthorizerConfiguration"
  },
  "AuthorizerType": {
   "$ref": "#/definitions/AuthorizerType"
  },
  "CreatedAt": {
   "format": "date-time",
   "type": "string"
  },
  "Description": {
   "maxLength": 200,
   "minLength": 1,
   "type": "string"
  },
  "ExceptionLevel": {
   "$ref": "#/definitions/ExceptionLevel"
  },
  "GatewayArn": {
   "pattern": "^arn:[a-z0-9-]{1,20}:bedrock-agentcore:[a-z0-9-]{1,20}:[0-9]{12}:gateway/([0-9a-z][-]?){1,100}-[a-z0-9]{10}$",
   "type": "string"
  },
  "GatewayIdentifier": {
   "pattern": "^([0-9a-z][-]?){1,100}-[0-9a-z]{10}$",
   "type": "string"
  },
  "GatewayUrl": {
   "maxLength": 1024,
   "minLength": 1,
   "type": "string"
  },
  "InterceptorConfigurations": {
   "items": {
    "$ref": "#/definitions/GatewayInterceptorConfiguration"
   },
   "maxItems": 2,
   "minItems": 1,
   "type": "array"
  },
  "KmsKeyArn": {
   "format": "AWS::KMS::Key.Arn",
   "maxLength": 2048,
   "minLength": 1,
   "pattern": "^arn:[a-z0-9-]{1,20}:kms:[a-zA-Z0-9-]*:[0-9]{12}:key/[a-zA-Z0-9-]{36}$",
   "type": "string"
  },
  "Name": {
   "pattern": "^([0-9a-zA-Z][-]?){1,100}$",
   "type": "string"
  },
  "PolicyEngineConfiguration": {
   "$ref": "#/definitions/GatewayPolicyEngineConfiguration"
  },
  "ProtocolConfiguration": {
   "$ref": "#/definitions/GatewayProtocolConfiguration"
  },
  "ProtocolType": {
   "$ref": "#/definitions/GatewayProtocolType"
  },
  "RoleArn": {
   "format": "AWS::IAM::Role.Arn",
   "maxLength": 2048,
   "minLength": 1,
   "pattern": "^arn:[a-z0-9-]{1,20}:iam::([0-9]{12})?:role/.+$",
   "type": "string"
  },
  "Status": {
   "$ref": "#/definitions/GatewayStatus"
  },
  "StatusReasons": {
   "items": {
    "maxLength": 2048,
    "type": "string"
   },
   "maxItems": 100,
   "type": "array"
  },
  "Tags": {
   "$ref": "#/definitions/TagsMap"
  },
  "UpdatedAt": {
   "format": "date-time",
   "type": "string"
  },
  "WorkloadIdentityDetails": {
   "$ref": "#/definitions/WorkloadIdentityDetails"
  }
 },
 "readOnlyProperties": [
  "/properties/CreatedAt",
  "/properties/GatewayArn",
  "/properties/GatewayIdentifier",
  "/properties/GatewayUrl",
  "/properties/Status",
  "/properties/StatusReasons",
  "/properties/UpdatedAt",
  "/properties/WorkloadIdentityDetails"
 ],
 "required": [
  "AuthorizerType",
  "Name",
  "ProtocolType",
  "RoleArn"
 ],
 "tagging": {
  "cloudFormationSystemTags": false,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::BedrockAgentCore::Gateway"
}
