{
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/EventSourceArn",
  "/properties/StartingPosition",
  "/properties/StartingPositionTimestamp",
  "/properties/SelfManagedEventSource"
 ],
 "definitions": {
  "AmazonManagedKafkaEventSourceConfig": {
   "additionalProperties": false,
   "properties": {
    "ConsumerGroupId": {
     "$ref": "#/definitions/ConsumerGroupId"
    },
    "SchemaRegistryConfig": {
     "$ref": "#/definitions/SchemaRegistryConfig"
    }
   },
   "type": "object"
  },
  "ConsumerGroupId": {
   "maxLength": 200,
   "minLength": 1,
   "pattern": "[a-zA-Z0-9-\\/*:_+=.@-]*",
   "type": "string"
  },
  "DestinationConfig": {
   "additionalProperties": false,
   "properties": {
    "OnFailure": {
     "$ref": "#/definitions/OnFailure"
    }
   },
   "type": "object"
  },
  "DocumentDBEventSourceConfig": {
   "additionalProperties": false,
   "properties": {
    "CollectionName": {
     "maxLength": 57,
     "minLength": 1,
     "pattern": "^(^(?!(system\\x2e)))(^[_a-zA-Z0-9])([^$]*)$",
     "type": "string"
    },
    "DatabaseName": {
     "maxLength": 63,
     "minLength": 1,
     "pattern": "^[^ /\\.$\\x22]*$",
     "type": "string"
    },
    "FullDocument": {
     "enum": [
      "UpdateLookup",
      "Default"
     ],
     "type": "string"
    }
   },
   "type": "object"
  },
  "Endpoints": {
   "additionalProperties": false,
   "properties": {
    "KafkaBootstrapServers": {
     "items": {
      "maxLength": 300,
      "minLength": 1,
      "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}",
      "type": "string"
     },
     "maxItems": 10,
     "minItems": 1,
     "type": "array",
     "uniqueItems": true
    }
   },
   "type": "object"
  },
  "Filter": {
   "additionalProperties": false,
   "properties": {
    "Pattern": {
     "maxLength": 4096,
     "minLength": 0,
     "pattern": ".*",
     "type": "string"
    }
   },
   "type": "object"
  },
  "FilterCriteria": {
   "additionalProperties": false,
   "properties": {
    "Filters": {
     "items": {
      "$ref": "#/definitions/Filter"
     },
     "maxItems": 20,
     "minItems": 1,
     "type": "array",
     "uniqueItems": true
    }
   },
   "type": "object"
  },
  "LoggingConfig": {
   "additionalProperties": false,
   "properties": {
    "SystemLogLevel": {
     "enum": [
      "DEBUG",
      "INFO",
      "WARN"
     ],
     "type": "string"
    }
   },
   "type": "object"
  },
  "MaximumConcurrency": {
   "maximum": 1000,
   "minimum": 2,
   "type": "integer"
  },
  "MetricsConfig": {
   "additionalProperties": false,
   "properties": {
    "Metrics": {
     "items": {
      "enum": [
       "EventCount",
       "ErrorCount",
       "KafkaMetrics"
      ],
      "type": "string"
     },
     "maxItems": 3,
     "minItems": 0,
     "type": "array",
     "uniqueItems": true
    }
   },
   "type": "object"
  },
  "OnFailure": {
   "additionalProperties": false,
   "properties": {
    "Destination": {
     "maxLength": 1024,
     "minLength": 12,
     "pattern": "^$|kafka://([^.]([a-zA-Z0-9\\-_.]{0,248}))|arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:((eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)",
     "type": "string"
    }
   },
   "type": "object"
  },
  "ProvisionedPollerConfig": {
   "additionalProperties": false,
   "properties": {
    "MaximumPollers": {
     "maximum": 2000,
     "minimum": 1,
     "type": "integer"
    },
    "MinimumPollers": {
     "maximum": 200,
     "minimum": 1,
     "type": "integer"
    },
    "PollerGroupName": {
     "maxLength": 128,
     "minLength": 0,
     "pattern": "^[a-zA-Z0-9-_]*$",
     "type": "string"
    }
   },
   "type": "object"
  },
  "ScalingConfig": {
   "additionalProperties": false,
   "properties": {
    "MaximumConcurrency": {
     "$ref": "#/definitions/MaximumConcurrency"
    }
   },
   "type": "object"
  },
  "SchemaRegistryAccessConfig": {
   "additionalProperties": false,
   "properties": {
    "Type": {
     "enum": [
      "BASIC_AUTH",
      "CLIENT_CERTIFICATE_TLS_AUTH",
      "SERVER_ROOT_CA_CERTIFICATE"
     ],
     "type": "string"
    },
    "URI": {
     "maxLength": 10000,
     "minLength": 1,
     "pattern": "arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:((eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)",
     "type": "string"
    }
   },
   "type": "object"
  },
  "SchemaRegistryConfig": {
   "additionalProperties": false,
   "properties": {
    "AccessConfigs": {
     "items": {
      "$ref": "#/definitions/SchemaRegistryAccessConfig"
     },
     "maxItems": 2,
     "type": "array",
     "uniqueItems": true
    },
    "EventRecordFormat": {
     "enum": [
      "JSON",
      "SOURCE"
     ],
     "type": "string"
    },
    "SchemaRegistryURI": {
     "maxLength": 10000,
     "minLength": 1,
     "pattern": "[a-zA-Z0-9-/*:_+=.@-]*",
     "type": "string"
    },
    "SchemaValidationConfigs": {
     "items": {
      "$ref": "#/definitions/SchemaValidationConfig"
     },
     "maxItems": 2,
     "minItems": 1,
     "type": "array",
     "uniqueItems": true
    }
   },
   "type": "object"
  },
  "SchemaValidationConfig": {
   "additionalProperties": false,
   "properties": {
    "Attribute": {
     "enum": [
      "KEY",
      "VALUE"
     ],
     "type": "string"
    }
   },
   "type": "object"
  },
  "SelfManagedEventSource": {
   "additionalProperties": false,
   "properties": {
    "Endpoints": {
     "$ref": "#/definitions/Endpoints"
    }
   },
   "type": "object"
  },
  "SelfManagedKafkaEventSourceConfig": {
   "additionalProperties": false,
   "properties": {
    "ConsumerGroupId": {
     "$ref": "#/definitions/ConsumerGroupId"
    },
    "SchemaRegistryConfig": {
     "$ref": "#/definitions/SchemaRegistryConfig"
    }
   },
   "type": "object"
  },
  "SourceAccessConfiguration": {
   "additionalProperties": false,
   "properties": {
    "Type": {
     "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"
    },
    "URI": {
     "maxLength": 200,
     "minLength": 1,
     "pattern": "[a-zA-Z0-9-\\/*:_+=.@-]*",
     "type": "string"
    }
   },
   "type": "object"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "maxLength": 128,
     "minLength": 1,
     "type": "string"
    },
    "Value": {
     "maxLength": 256,
     "minLength": 0,
     "type": "string"
    }
   },
   "required": [
    "Key"
   ],
   "type": "object"
  }
 },
 "primaryIdentifier": [
  "/properties/Id"
 ],
 "properties": {
  "AmazonManagedKafkaEventSourceConfig": {
   "$ref": "#/definitions/AmazonManagedKafkaEventSourceConfig"
  },
  "BatchSize": {
   "maximum": 10000,
   "minimum": 1,
   "type": "integer"
  },
  "BisectBatchOnFunctionError": {
   "type": "boolean"
  },
  "DestinationConfig": {
   "$ref": "#/definitions/DestinationConfig"
  },
  "DocumentDBEventSourceConfig": {
   "$ref": "#/definitions/DocumentDBEventSourceConfig"
  },
  "Enabled": {
   "type": "boolean"
  },
  "EventSourceArn": {
   "maxLength": 1024,
   "minLength": 12,
   "pattern": "arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:((eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)",
   "type": "string"
  },
  "EventSourceMappingArn": {
   "maxLength": 120,
   "minLength": 85,
   "pattern": "arn:(aws[a-zA-Z-]*)?:lambda:(eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\\d{1}:\\d{12}:event-source-mapping:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}",
   "type": "string"
  },
  "FilterCriteria": {
   "$ref": "#/definitions/FilterCriteria"
  },
  "FunctionName": {
   "maxLength": 140,
   "minLength": 1,
   "pattern": "(arn:(aws[a-zA-Z-]*)?:lambda:)?((eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\\$LATEST(\\.PUBLISHED)?|[a-zA-Z0-9-_]+))?",
   "type": "string"
  },
  "FunctionResponseTypes": {
   "items": {
    "enum": [
     "ReportBatchItemFailures"
    ],
    "type": "string"
   },
   "maxItems": 1,
   "maxLength": 1,
   "minItems": 0,
   "minLength": 0,
   "type": "array",
   "uniqueItems": true
  },
  "Id": {
   "maxLength": 36,
   "minLength": 36,
   "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
   "type": "string"
  },
  "KmsKeyArn": {
   "format": "AWS::KMS::Key.Arn",
   "maxLength": 2048,
   "minLength": 12,
   "pattern": "(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()",
   "type": "string"
  },
  "LoggingConfig": {
   "$ref": "#/definitions/LoggingConfig"
  },
  "MaximumBatchingWindowInSeconds": {
   "maximum": 300,
   "minimum": 0,
   "type": "integer"
  },
  "MaximumRecordAgeInSeconds": {
   "maximum": 604800,
   "minimum": -1,
   "type": "integer"
  },
  "MaximumRetryAttempts": {
   "maximum": 10000,
   "minimum": -1,
   "type": "integer"
  },
  "MetricsConfig": {
   "$ref": "#/definitions/MetricsConfig"
  },
  "ParallelizationFactor": {
   "maximum": 10,
   "minimum": 1,
   "type": "integer"
  },
  "ProvisionedPollerConfig": {
   "$ref": "#/definitions/ProvisionedPollerConfig"
  },
  "Queues": {
   "items": {
    "maxLength": 1000,
    "minLength": 1,
    "pattern": "[\\s\\S]*",
    "type": "string"
   },
   "maxItems": 1,
   "minItems": 1,
   "type": "array",
   "uniqueItems": true
  },
  "ScalingConfig": {
   "$ref": "#/definitions/ScalingConfig"
  },
  "SelfManagedEventSource": {
   "$ref": "#/definitions/SelfManagedEventSource"
  },
  "SelfManagedKafkaEventSourceConfig": {
   "$ref": "#/definitions/SelfManagedKafkaEventSourceConfig"
  },
  "SourceAccessConfigurations": {
   "items": {
    "$ref": "#/definitions/SourceAccessConfiguration"
   },
   "maxItems": 22,
   "minItems": 1,
   "type": "array",
   "uniqueItems": true
  },
  "StartingPosition": {
   "maxLength": 12,
   "minLength": 6,
   "pattern": "(LATEST|TRIM_HORIZON|AT_TIMESTAMP)+",
   "type": "string"
  },
  "StartingPositionTimestamp": {
   "type": "number"
  },
  "Tags": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "type": "array",
   "uniqueItems": true
  },
  "Topics": {
   "items": {
    "maxLength": 249,
    "minLength": 1,
    "pattern": "^[^.]([a-zA-Z0-9\\-_.]+)",
    "type": "string"
   },
   "maxItems": 1,
   "minItems": 1,
   "type": "array",
   "uniqueItems": true
  },
  "TumblingWindowInSeconds": {
   "maximum": 900,
   "minimum": 0,
   "type": "integer"
  }
 },
 "propertyTransform": {
  "/properties/FunctionName": "$split(FunctionName, \":\")[-1] $OR FunctionName $OR $join([\"((arn:.*:lambda:.*:[0-9]{12}:function)|([0-9]{12}:function)):\", $split(FunctionName, \":\")[-1]])",
  "/properties/StartingPositionTimestamp": "StartingPositionTimestamp * 1000"
 },
 "readOnlyProperties": [
  "/properties/Id",
  "/properties/EventSourceMappingArn"
 ],
 "required": [
  "FunctionName"
 ],
 "tagging": {
  "cloudFormationSystemTags": true,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::Lambda::EventSourceMapping"
}
