{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--aws-lambda-eventsourcemapping.json",
  "title": "AWSLambdaEventSourceMappingProperties",
  "description": "Resource Type definition for AWS::Lambda::EventSourceMapping. Source:- No source definition found, add manually please",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lalcebo/json-schema/master/serverless/resources/cloudformation-modified/aws-lambda-eventsourcemapping.json",
    "sourceSha256": "cc2a35be9cf3ca1905ffa757fc9c23dc2d34dfd15bdfe4e1bb1a6cd739a447c9"
  },
  "type": "object",
  "properties": {
    "BatchSize": {
      "description": "The maximum number of items to retrieve in a single batch.",
      "type": "integer",
      "minimum": 1,
      "maximum": 10000
    },
    "BisectBatchOnFunctionError": {
      "description": "(Streams) If the function returns an error, split the batch in two and retry.",
      "type": "boolean"
    },
    "DestinationConfig": {
      "description": "(Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded records.",
      "$ref": "#/$defs/DestinationConfig"
    },
    "Enabled": {
      "description": "Disables the event source mapping to pause polling and invocation.",
      "type": "boolean"
    },
    "EventSourceArn": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)",
          "minLength": 12,
          "maxLength": 1024
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The Amazon Resource Name (ARN) of the event source."
    },
    "FilterCriteria": {
      "description": "The filter criteria to control event filtering.",
      "$ref": "#/$defs/FilterCriteria"
    },
    "FunctionName": {
      "oneOf": [
        {
          "type": "string",
          "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-_]+))?",
          "minLength": 1,
          "maxLength": 140
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The name of the Lambda function."
    },
    "MaximumBatchingWindowInSeconds": {
      "description": "(Streams) The maximum amount of time to gather records before invoking the function, in seconds.",
      "type": "integer",
      "minimum": 0,
      "maximum": 300
    },
    "MaximumRecordAgeInSeconds": {
      "description": "(Streams) The maximum age of a record that Lambda sends to a function for processing.",
      "type": "integer",
      "minimum": -1,
      "maximum": 604800
    },
    "MaximumRetryAttempts": {
      "description": "(Streams) The maximum number of times to retry when the function returns an error.",
      "type": "integer",
      "minimum": -1,
      "maximum": 10000
    },
    "ParallelizationFactor": {
      "description": "(Streams) The number of batches to process from each shard concurrently.",
      "type": "integer",
      "minimum": 1,
      "maximum": 10
    },
    "StartingPosition": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "(LATEST|TRIM_HORIZON|AT_TIMESTAMP)+",
          "minLength": 6,
          "maxLength": 12
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Streams sources."
    },
    "StartingPositionTimestamp": {
      "description": "With StartingPosition set to AT_TIMESTAMP, the time from which to start reading, in Unix time seconds.",
      "type": "number"
    },
    "Topics": {
      "description": "(Kafka) A list of Kafka topics.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^[^.]([a-zA-Z0-9\\-_.]+)",
        "minLength": 1,
        "maxLength": 249
      },
      "minItems": 1,
      "maxItems": 1
    },
    "Queues": {
      "description": "(ActiveMQ) A list of ActiveMQ queues.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "[\\s\\S]*",
        "minLength": 1,
        "maxLength": 1000
      },
      "minItems": 1,
      "maxItems": 1
    },
    "SourceAccessConfigurations": {
      "description": "A list of SourceAccessConfiguration.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/SourceAccessConfiguration"
      },
      "minItems": 1,
      "maxItems": 22
    },
    "TumblingWindowInSeconds": {
      "description": "(Streams) Tumbling window (non-overlapping time window) duration to perform aggregations.",
      "type": "integer",
      "minimum": 0,
      "maximum": 900
    },
    "FunctionResponseTypes": {
      "description": "(Streams) A list of response types supported by the function.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "ReportBatchItemFailures"
        ]
      },
      "minLength": 0,
      "maxLength": 1
    },
    "SelfManagedEventSource": {
      "description": "Self-managed event source endpoints.",
      "$ref": "#/$defs/SelfManagedEventSource"
    },
    "AmazonManagedKafkaEventSourceConfig": {
      "description": "Specific configuration settings for an MSK event source.",
      "$ref": "#/$defs/AmazonManagedKafkaEventSourceConfig"
    },
    "SelfManagedKafkaEventSourceConfig": {
      "description": "Specific configuration settings for a Self-Managed Apache Kafka event source.",
      "$ref": "#/$defs/SelfManagedKafkaEventSourceConfig"
    },
    "ScalingConfig": {
      "description": "The scaling configuration for the event source.",
      "$ref": "#/$defs/ScalingConfig"
    },
    "DocumentDBEventSourceConfig": {
      "description": "Document db event source config.",
      "$ref": "#/$defs/DocumentDBEventSourceConfig"
    }
  },
  "typeName": "AWS::Lambda::EventSourceMapping",
  "primaryIdentifier": [
    "/properties/Id"
  ],
  "$defs": {
    "DestinationConfig": {
      "type": "object",
      "title": "AWSLambdaEventSourceMappingDestinationConfigDefinition",
      "description": "(Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded records.",
      "properties": {
        "OnFailure": {
          "description": "The destination configuration for failed invocations.",
          "$ref": "#/$defs/OnFailure"
        }
      },
      "additionalProperties": false
    },
    "FilterCriteria": {
      "type": "object",
      "description": "The filter criteria to control event filtering.",
      "title": "AWSLambdaEventSourceMappingFilterCriteriaDefinition",
      "properties": {
        "Filters": {
          "description": "List of filters of this FilterCriteria",
          "type": "array",
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/Filter"
          },
          "minItems": 1,
          "maxItems": 20
        }
      },
      "additionalProperties": false
    },
    "Filter": {
      "type": "object",
      "description": "The filter object that defines parameters for ESM filtering.",
      "title": "AWSLambdaEventSourceMappingFilterDefinition",
      "properties": {
        "Pattern": {
          "oneOf": [
            {
              "type": "string",
              "pattern": ".*",
              "minLength": 0,
              "maxLength": 4096
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The filter pattern that defines which events should be passed for invocations."
        }
      },
      "additionalProperties": false
    },
    "OnFailure": {
      "type": "object",
      "description": "A destination for events that failed processing.",
      "title": "AWSLambdaEventSourceMappingOnFailureDefinition",
      "properties": {
        "Destination": {
          "oneOf": [
            {
              "type": "string",
              "pattern": "arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)",
              "minLength": 12,
              "maxLength": 1024
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The Amazon Resource Name (ARN) of the destination resource."
        }
      },
      "additionalProperties": false
    },
    "SourceAccessConfiguration": {
      "type": "object",
      "title": "AWSLambdaEventSourceMappingSourceAccessConfigurationDefinition",
      "description": "The configuration used by AWS Lambda to access event source",
      "properties": {
        "Type": {
          "oneOf": [
            {
              "enum": [
                "BASIC_AUTH",
                "VPC_SUBNET",
                "VPC_SECURITY_GROUP",
                "SASL_SCRAM_512_AUTH",
                "SASL_SCRAM_256_AUTH",
                "VIRTUAL_HOST",
                "CLIENT_CERTIFICATE_TLS_AUTH",
                "SERVER_ROOT_CA_CERTIFICATE"
              ],
              "type": "string"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The type of source access configuration."
        },
        "URI": {
          "oneOf": [
            {
              "type": "string",
              "pattern": "[a-zA-Z0-9-\\/*:_+=.@-]*",
              "minLength": 1,
              "maxLength": 200
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The URI for the source access configuration resource."
        }
      },
      "additionalProperties": false
    },
    "SelfManagedEventSource": {
      "type": "object",
      "title": "AWSLambdaEventSourceMappingSelfManagedEventSourceDefinition",
      "description": "The configuration used by AWS Lambda to access a self-managed event source.",
      "properties": {
        "Endpoints": {
          "description": "The endpoints for a self-managed event source.",
          "$ref": "#/$defs/Endpoints"
        }
      },
      "additionalProperties": false
    },
    "Endpoints": {
      "type": "object",
      "title": "AWSLambdaEventSourceMappingEndpointsDefinition",
      "description": "The endpoints used by AWS Lambda to access a self-managed event source.",
      "properties": {
        "KafkaBootstrapServers": {
          "type": "array",
          "description": "A list of Kafka server endpoints.",
          "uniqueItems": true,
          "items": {
            "type": "string",
            "description": "The URL of a Kafka server.",
            "pattern": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9]):[0-9]{1,5}",
            "minLength": 1,
            "maxLength": 300
          },
          "minItems": 1,
          "maxItems": 10
        }
      },
      "additionalProperties": false
    },
    "ConsumerGroupId": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "[a-zA-Z0-9-\\/*:_+=.@-]*",
          "minLength": 1,
          "maxLength": 200
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The identifier for the Kafka Consumer Group to join.",
      "title": "AWSLambdaEventSourceMappingConsumerGroupIdDefinition"
    },
    "AmazonManagedKafkaEventSourceConfig": {
      "description": "Specific configuration settings for an MSK event source.",
      "type": "object",
      "title": "AWSLambdaEventSourceMappingAmazonManagedKafkaEventSourceConfigDefinition",
      "properties": {
        "ConsumerGroupId": {
          "description": "The identifier for the Kafka Consumer Group to join.",
          "$ref": "#/$defs/ConsumerGroupId"
        }
      },
      "additionalProperties": false
    },
    "SelfManagedKafkaEventSourceConfig": {
      "description": "Specific configuration settings for a Self-Managed Apache Kafka event source.",
      "type": "object",
      "title": "AWSLambdaEventSourceMappingSelfManagedKafkaEventSourceConfigDefinition",
      "properties": {
        "ConsumerGroupId": {
          "description": "The identifier for the Kafka Consumer Group to join.",
          "$ref": "#/$defs/ConsumerGroupId"
        }
      },
      "additionalProperties": false
    },
    "MaximumConcurrency": {
      "description": "The maximum number of concurrent functions that an event source can invoke.",
      "type": "integer",
      "minimum": 2,
      "maximum": 1000,
      "title": "AWSLambdaEventSourceMappingMaximumConcurrencyDefinition"
    },
    "ScalingConfig": {
      "description": "The scaling configuration for the event source.",
      "type": "object",
      "title": "AWSLambdaEventSourceMappingScalingConfigDefinition",
      "properties": {
        "MaximumConcurrency": {
          "description": "The maximum number of concurrent functions that the event source can invoke.",
          "$ref": "#/$defs/MaximumConcurrency"
        }
      },
      "additionalProperties": false
    },
    "DocumentDBEventSourceConfig": {
      "description": "Document db event source config.",
      "type": "object",
      "title": "AWSLambdaEventSourceMappingDocumentDBEventSourceConfigDefinition",
      "properties": {
        "DatabaseName": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 63
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The database name to connect to."
        },
        "CollectionName": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 57
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The collection name to connect to."
        },
        "FullDocument": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "UpdateLookup",
                "Default"
              ]
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "Include full document in change stream response. The default option will only send the changes made to documents to Lambda. If you want the complete document sent to Lambda, set this to UpdateLookup."
        }
      },
      "additionalProperties": false
    }
  },
  "readOnlyProperties": [
    "/properties/Id"
  ],
  "additionalProperties": false,
  "required": [
    "FunctionName"
  ],
  "createOnlyProperties": [
    "/properties/EventSourceArn",
    "/properties/StartingPosition",
    "/properties/StartingPositionTimestamp",
    "/properties/SelfManagedEventSource",
    "/properties/AmazonManagedKafkaEventSourceConfig",
    "/properties/SelfManagedKafkaEventSourceConfig"
  ]
}
