{
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/GatewayIdentifier"
 ],
 "definitions": {
  "ApiGatewayTargetConfiguration": {
   "additionalProperties": false,
   "properties": {
    "ApiGatewayToolConfiguration": {
     "$ref": "#/definitions/ApiGatewayToolConfiguration"
    },
    "RestApiId": {
     "type": "string"
    },
    "Stage": {
     "type": "string"
    }
   },
   "required": [
    "RestApiId",
    "Stage",
    "ApiGatewayToolConfiguration"
   ],
   "type": "object"
  },
  "ApiGatewayToolConfiguration": {
   "additionalProperties": false,
   "properties": {
    "ToolFilters": {
     "items": {
      "$ref": "#/definitions/ApiGatewayToolFilter"
     },
     "type": "array"
    },
    "ToolOverrides": {
     "items": {
      "$ref": "#/definitions/ApiGatewayToolOverride"
     },
     "type": "array"
    }
   },
   "required": [
    "ToolFilters"
   ],
   "type": "object"
  },
  "ApiGatewayToolFilter": {
   "additionalProperties": false,
   "properties": {
    "FilterPath": {
     "type": "string"
    },
    "Methods": {
     "items": {
      "$ref": "#/definitions/RestApiMethod"
     },
     "type": "array"
    }
   },
   "required": [
    "FilterPath",
    "Methods"
   ],
   "type": "object"
  },
  "ApiGatewayToolOverride": {
   "additionalProperties": false,
   "properties": {
    "Description": {
     "type": "string"
    },
    "Method": {
     "$ref": "#/definitions/RestApiMethod"
    },
    "Name": {
     "type": "string"
    },
    "Path": {
     "type": "string"
    }
   },
   "required": [
    "Name",
    "Path",
    "Method"
   ],
   "type": "object"
  },
  "ApiKeyCredentialLocation": {
   "enum": [
    "HEADER",
    "QUERY_PARAMETER"
   ],
   "type": "string"
  },
  "ApiKeyCredentialProvider": {
   "additionalProperties": false,
   "properties": {
    "CredentialLocation": {
     "$ref": "#/definitions/ApiKeyCredentialLocation"
    },
    "CredentialParameterName": {
     "maxLength": 64,
     "minLength": 1,
     "type": "string"
    },
    "CredentialPrefix": {
     "maxLength": 64,
     "minLength": 1,
     "type": "string"
    },
    "ProviderArn": {
     "pattern": "^arn:([^:]*):([^:]*):([^:]*):([0-9]{12})?:(.+)$",
     "type": "string"
    }
   },
   "required": [
    "ProviderArn"
   ],
   "type": "object"
  },
  "ApiSchemaConfiguration": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "S3": {
       "$ref": "#/definitions/S3Configuration"
      }
     },
     "required": [
      "S3"
     ],
     "title": "S3",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "InlinePayload": {
       "type": "string"
      }
     },
     "required": [
      "InlinePayload"
     ],
     "title": "InlinePayload",
     "type": "object"
    }
   ]
  },
  "AuthorizationData": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "Oauth2": {
       "$ref": "#/definitions/OAuth2AuthorizationData"
      }
     },
     "required": [
      "Oauth2"
     ],
     "title": "Oauth2",
     "type": "object"
    }
   ]
  },
  "CredentialProvider": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "OauthCredentialProvider": {
       "$ref": "#/definitions/OAuthCredentialProvider"
      }
     },
     "required": [
      "OauthCredentialProvider"
     ],
     "title": "OauthCredentialProvider",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "ApiKeyCredentialProvider": {
       "$ref": "#/definitions/ApiKeyCredentialProvider"
      }
     },
     "required": [
      "ApiKeyCredentialProvider"
     ],
     "title": "ApiKeyCredentialProvider",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "IamCredentialProvider": {
       "$ref": "#/definitions/IamCredentialProvider"
      }
     },
     "required": [
      "IamCredentialProvider"
     ],
     "title": "IamCredentialProvider",
     "type": "object"
    }
   ]
  },
  "CredentialProviderConfiguration": {
   "additionalProperties": false,
   "properties": {
    "CredentialProvider": {
     "$ref": "#/definitions/CredentialProvider"
    },
    "CredentialProviderType": {
     "$ref": "#/definitions/CredentialProviderType"
    }
   },
   "required": [
    "CredentialProviderType"
   ],
   "type": "object"
  },
  "CredentialProviderType": {
   "enum": [
    "GATEWAY_IAM_ROLE",
    "OAUTH",
    "API_KEY",
    "CALLER_IAM_CREDENTIALS",
    "JWT_PASSTHROUGH"
   ],
   "type": "string"
  },
  "EndpointIpAddressType": {
   "enum": [
    "IPV4",
    "IPV6"
   ],
   "type": "string"
  },
  "HttpTargetConfiguration": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "AgentcoreRuntime": {
       "$ref": "#/definitions/RuntimeTargetConfiguration"
      }
     },
     "required": [
      "AgentcoreRuntime"
     ],
     "title": "AgentcoreRuntime",
     "type": "object"
    }
   ]
  },
  "IamCredentialProvider": {
   "additionalProperties": false,
   "properties": {
    "Region": {
     "maxLength": 32,
     "minLength": 1,
     "pattern": "^[a-zA-Z0-9-]+$",
     "type": "string"
    },
    "Service": {
     "maxLength": 64,
     "minLength": 1,
     "pattern": "^[a-zA-Z0-9._-]+$",
     "type": "string"
    }
   },
   "required": [
    "Service"
   ],
   "type": "object"
  },
  "ManagedResourceDetails": {
   "additionalProperties": false,
   "properties": {
    "Domain": {
     "type": "string"
    },
    "ResourceAssociationArn": {
     "pattern": "^(arn:[a-z0-9\\-]+:vpc-lattice:[a-zA-Z0-9\\-]+:\\d{12}:servicenetworkresourceassociation/)?snra-[0-9a-f]{17}$",
     "type": "string"
    },
    "ResourceGatewayArn": {
     "pattern": "^arn:[a-z0-9\\-]+:vpc-lattice:[a-zA-Z0-9\\-]+:\\d{12}:resourcegateway/rgw-[0-9a-z]{17}$",
     "type": "string"
    }
   },
   "type": "object"
  },
  "ManagedVpcResource": {
   "additionalProperties": false,
   "properties": {
    "EndpointIpAddressType": {
     "$ref": "#/definitions/EndpointIpAddressType"
    },
    "RoutingDomain": {
     "maxLength": 255,
     "minLength": 3,
     "type": "string"
    },
    "SecurityGroupIds": {
     "items": {
      "pattern": "^sg-(([0-9a-z]{8})|([0-9a-z]{17}))$",
      "type": "string"
     },
     "maxItems": 5,
     "minItems": 0,
     "type": "array"
    },
    "SubnetIds": {
     "items": {
      "pattern": "^subnet-[0-9a-zA-Z]{8,17}$",
      "type": "string"
     },
     "minItems": 1,
     "type": "array"
    },
    "VpcIdentifier": {
     "pattern": "^vpc-(([0-9a-z]{8})|([0-9a-z]{17}))$",
     "type": "string"
    }
   },
   "required": [
    "EndpointIpAddressType",
    "SubnetIds",
    "VpcIdentifier"
   ],
   "type": "object"
  },
  "McpLambdaTargetConfiguration": {
   "additionalProperties": false,
   "properties": {
    "LambdaArn": {
     "format": "AWS::Lambda::Function.Arn",
     "maxLength": 170,
     "minLength": 1,
     "pattern": "^arn:(aws[a-zA-Z-]*)?:lambda:([a-z]{2}(-gov)?-[a-z]+-\\d{1}):(\\d{12}):function:([a-zA-Z0-9-_.]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?$",
     "type": "string"
    },
    "ToolSchema": {
     "$ref": "#/definitions/ToolSchema"
    }
   },
   "required": [
    "LambdaArn",
    "ToolSchema"
   ],
   "type": "object"
  },
  "McpServerListingMode": {
   "enum": [
    "DEFAULT",
    "DYNAMIC"
   ],
   "type": "string"
  },
  "McpServerTargetConfiguration": {
   "additionalProperties": false,
   "properties": {
    "Endpoint": {
     "pattern": "^https://.*",
     "type": "string"
    },
    "ListingMode": {
     "$ref": "#/definitions/McpServerListingMode"
    },
    "McpToolSchema": {
     "$ref": "#/definitions/McpToolSchemaConfiguration"
    },
    "ResourcePriority": {
     "maximum": 1000,
     "minimum": 0,
     "type": "integer"
    }
   },
   "required": [
    "Endpoint"
   ],
   "type": "object"
  },
  "McpTargetConfiguration": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "OpenApiSchema": {
       "$ref": "#/definitions/ApiSchemaConfiguration"
      }
     },
     "required": [
      "OpenApiSchema"
     ],
     "title": "OpenApiSchema",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "SmithyModel": {
       "$ref": "#/definitions/ApiSchemaConfiguration"
      }
     },
     "required": [
      "SmithyModel"
     ],
     "title": "SmithyModel",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "Lambda": {
       "$ref": "#/definitions/McpLambdaTargetConfiguration"
      }
     },
     "required": [
      "Lambda"
     ],
     "title": "Lambda",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "McpServer": {
       "$ref": "#/definitions/McpServerTargetConfiguration"
      }
     },
     "required": [
      "McpServer"
     ],
     "title": "McpServer",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "ApiGateway": {
       "$ref": "#/definitions/ApiGatewayTargetConfiguration"
      }
     },
     "required": [
      "ApiGateway"
     ],
     "title": "ApiGateway",
     "type": "object"
    }
   ]
  },
  "McpToolSchemaConfiguration": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "S3": {
       "$ref": "#/definitions/S3Configuration"
      }
     },
     "required": [
      "S3"
     ],
     "title": "S3",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "InlinePayload": {
       "type": "string"
      }
     },
     "required": [
      "InlinePayload"
     ],
     "title": "InlinePayload",
     "type": "object"
    }
   ]
  },
  "MetadataConfiguration": {
   "additionalProperties": false,
   "properties": {
    "AllowedQueryParameters": {
     "items": {
      "type": "string"
     },
     "type": "array"
    },
    "AllowedRequestHeaders": {
     "items": {
      "type": "string"
     },
     "type": "array"
    },
    "AllowedResponseHeaders": {
     "items": {
      "type": "string"
     },
     "type": "array"
    }
   },
   "type": "object"
  },
  "OAuth2AuthorizationData": {
   "additionalProperties": false,
   "properties": {
    "AuthorizationUrl": {
     "minLength": 1,
     "type": "string"
    },
    "UserId": {
     "maxLength": 128,
     "minLength": 1,
     "type": "string"
    }
   },
   "required": [
    "AuthorizationUrl"
   ],
   "type": "object"
  },
  "OAuthCredentialProvider": {
   "additionalProperties": false,
   "properties": {
    "CustomParameters": {
     "$ref": "#/definitions/OAuthCustomParameters"
    },
    "DefaultReturnUrl": {
     "maxLength": 2048,
     "minLength": 1,
     "pattern": "\\w+:(\\/?\\/?)[^\\s]+",
     "type": "string"
    },
    "GrantType": {
     "$ref": "#/definitions/OAuthGrantType"
    },
    "ProviderArn": {
     "pattern": "^arn:([^:]*):([^:]*):([^:]*):([0-9]{12})?:(.+)$",
     "type": "string"
    },
    "Scopes": {
     "items": {
      "maxLength": 128,
      "minLength": 1,
      "type": "string"
     },
     "maxItems": 100,
     "type": "array"
    }
   },
   "required": [
    "ProviderArn",
    "Scopes"
   ],
   "type": "object"
  },
  "OAuthCustomParameters": {
   "additionalProperties": false,
   "maxProperties": 10,
   "minProperties": 1,
   "patternProperties": {
    ".+": {
     "maxLength": 2048,
     "minLength": 1,
     "type": "string"
    }
   },
   "type": "object"
  },
  "OAuthGrantType": {
   "enum": [
    "AUTHORIZATION_CODE",
    "CLIENT_CREDENTIALS",
    "TOKEN_EXCHANGE"
   ],
   "type": "string"
  },
  "PrivateEndpoint": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "SelfManagedLatticeResource": {
       "$ref": "#/definitions/SelfManagedLatticeResource"
      }
     },
     "required": [
      "SelfManagedLatticeResource"
     ],
     "title": "SelfManagedLatticeResource",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "ManagedVpcResource": {
       "$ref": "#/definitions/ManagedVpcResource"
      }
     },
     "required": [
      "ManagedVpcResource"
     ],
     "title": "ManagedVpcResource",
     "type": "object"
    }
   ]
  },
  "RestApiMethod": {
   "enum": [
    "GET",
    "DELETE",
    "HEAD",
    "OPTIONS",
    "PATCH",
    "PUT",
    "POST"
   ],
   "type": "string"
  },
  "RuntimeTargetConfiguration": {
   "additionalProperties": false,
   "properties": {
    "Arn": {
     "pattern": "^arn:aws(-[^:]+)?:bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:runtime/[a-zA-Z][a-zA-Z0-9_]{0,47}-[a-zA-Z0-9]{10}$",
     "type": "string"
    },
    "Qualifier": {
     "pattern": "^(([1-9][0-9]{0,4})|([a-zA-Z][a-zA-Z0-9_]{0,47}))$",
     "type": "string"
    }
   },
   "required": [
    "Arn"
   ],
   "type": "object"
  },
  "S3Configuration": {
   "additionalProperties": false,
   "properties": {
    "BucketOwnerAccountId": {
     "pattern": "^[0-9]{12}$",
     "type": "string"
    },
    "Uri": {
     "pattern": "^s3://.{1,2043}$",
     "type": "string"
    }
   },
   "type": "object"
  },
  "SchemaDefinition": {
   "additionalProperties": false,
   "properties": {
    "Description": {
     "type": "string"
    },
    "Items": {
     "$ref": "#/definitions/SchemaDefinition"
    },
    "Properties": {
     "$ref": "#/definitions/SchemaProperties"
    },
    "Required": {
     "items": {
      "type": "string"
     },
     "type": "array"
    },
    "Type": {
     "$ref": "#/definitions/SchemaType"
    }
   },
   "required": [
    "Type"
   ],
   "type": "object"
  },
  "SchemaProperties": {
   "additionalProperties": false,
   "patternProperties": {
    ".+": {
     "$ref": "#/definitions/SchemaDefinition"
    }
   },
   "type": "object"
  },
  "SchemaType": {
   "enum": [
    "string",
    "number",
    "object",
    "array",
    "boolean",
    "integer"
   ],
   "type": "string"
  },
  "SelfManagedLatticeResource": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "ResourceConfigurationIdentifier": {
       "maxLength": 2048,
       "minLength": 20,
       "pattern": "^((rcfg-[0-9a-z]{17})|(arn:[a-z0-9\\-]+:vpc-lattice:[a-zA-Z0-9\\-]+:\\d{12}:resourceconfiguration/rcfg-[0-9a-z]{17}))$",
       "type": "string"
      }
     },
     "required": [
      "ResourceConfigurationIdentifier"
     ],
     "title": "ResourceConfigurationIdentifier",
     "type": "object"
    }
   ]
  },
  "TargetConfiguration": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "Mcp": {
       "$ref": "#/definitions/McpTargetConfiguration"
      }
     },
     "required": [
      "Mcp"
     ],
     "title": "Mcp",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "Http": {
       "$ref": "#/definitions/HttpTargetConfiguration"
      }
     },
     "required": [
      "Http"
     ],
     "title": "Http",
     "type": "object"
    }
   ]
  },
  "TargetProtocolType": {
   "enum": [
    "MCP",
    "HTTP"
   ],
   "type": "string"
  },
  "TargetStatus": {
   "enum": [
    "CREATING",
    "UPDATING",
    "UPDATE_UNSUCCESSFUL",
    "DELETING",
    "READY",
    "FAILED",
    "SYNCHRONIZING",
    "SYNCHRONIZE_UNSUCCESSFUL",
    "CREATE_PENDING_AUTH",
    "UPDATE_PENDING_AUTH",
    "SYNCHRONIZE_PENDING_AUTH"
   ],
   "type": "string"
  },
  "ToolDefinition": {
   "additionalProperties": false,
   "properties": {
    "Description": {
     "type": "string"
    },
    "InputSchema": {
     "$ref": "#/definitions/SchemaDefinition"
    },
    "Name": {
     "type": "string"
    },
    "OutputSchema": {
     "$ref": "#/definitions/SchemaDefinition"
    }
   },
   "required": [
    "Description",
    "InputSchema",
    "Name"
   ],
   "type": "object"
  },
  "ToolSchema": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "S3": {
       "$ref": "#/definitions/S3Configuration"
      }
     },
     "required": [
      "S3"
     ],
     "title": "S3",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "InlinePayload": {
       "items": {
        "$ref": "#/definitions/ToolDefinition"
       },
       "type": "array"
      }
     },
     "required": [
      "InlinePayload"
     ],
     "title": "InlinePayload",
     "type": "object"
    }
   ]
  }
 },
 "primaryIdentifier": [
  "/properties/GatewayIdentifier",
  "/properties/TargetId"
 ],
 "properties": {
  "AuthorizationData": {
   "$ref": "#/definitions/AuthorizationData"
  },
  "CreatedAt": {
   "format": "date-time",
   "type": "string"
  },
  "CredentialProviderConfigurations": {
   "items": {
    "$ref": "#/definitions/CredentialProviderConfiguration"
   },
   "maxItems": 1,
   "minItems": 1,
   "type": "array"
  },
  "Description": {
   "maxLength": 200,
   "minLength": 1,
   "type": "string"
  },
  "GatewayArn": {
   "pattern": "^arn:aws(|-cn|-us-gov):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"
  },
  "LastSynchronizedAt": {
   "format": "date-time",
   "type": "string"
  },
  "MetadataConfiguration": {
   "$ref": "#/definitions/MetadataConfiguration"
  },
  "Name": {
   "pattern": "^([0-9a-zA-Z][-]?){1,100}$",
   "type": "string"
  },
  "PrivateEndpoint": {
   "$ref": "#/definitions/PrivateEndpoint"
  },
  "PrivateEndpointManagedResources": {
   "items": {
    "$ref": "#/definitions/ManagedResourceDetails"
   },
   "type": "array"
  },
  "ProtocolType": {
   "$ref": "#/definitions/TargetProtocolType"
  },
  "Status": {
   "$ref": "#/definitions/TargetStatus"
  },
  "StatusReasons": {
   "items": {
    "maxLength": 2048,
    "type": "string"
   },
   "maxItems": 100,
   "type": "array"
  },
  "TargetConfiguration": {
   "$ref": "#/definitions/TargetConfiguration"
  },
  "TargetId": {
   "pattern": "^[0-9a-zA-Z]{10}$",
   "type": "string"
  },
  "UpdatedAt": {
   "format": "date-time",
   "type": "string"
  }
 },
 "readOnlyProperties": [
  "/properties/CreatedAt",
  "/properties/GatewayArn",
  "/properties/LastSynchronizedAt",
  "/properties/Status",
  "/properties/StatusReasons",
  "/properties/TargetId",
  "/properties/PrivateEndpointManagedResources",
  "/properties/UpdatedAt",
  "/properties/AuthorizationData",
  "/properties/ProtocolType"
 ],
 "required": [
  "Name",
  "TargetConfiguration"
 ],
 "tagging": {
  "cloudFormationSystemTags": false,
  "taggable": false
 },
 "typeName": "AWS::BedrockAgentCore::GatewayTarget"
}
