
Stream every event on an EventBridge bus to OpenSearch through Amazon Data Firehose for near real-time search, with payload flattening, daily index rotation and an S3 backup.
detail-type is renamed to detail_type so it needs no escaping in queries, and the fields inside detail are promoted to the top level so a dashboard can filter on claimId rather than detail.claimId. Envelope fields win on collision, so a business payload carrying its own source key is indexed as detail_source instead of masking the real event source.events-YYYY-MM-DD, and every document is also written to an S3 bucket, which makes that bucket an audit trail rather than only a dead letter destination.id field for deduplication at query time. The pattern adds no dead-letter queue on the rule target and no alarms. The README lists what to add for production.git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/eventbridge-firehose-opensearch/typescript/cdkcd cdknpm installcdk deploy -c dashboardAccessIp=YOUR_IP/32BUS=$(aws cloudformation describe-stacks --stack-name EventMonitorStack --query "Stacks[0].Outputs[?OutputKey=='EventBusName'].OutputValue" --output text)aws events put-events --entries '[{"Source":"demo.test","DetailType":"TestEvent","Detail":"{\"message\":\"Hello OpenSearch\",\"claimId\":\"CLM-001\"}","EventBusName":"'"$BUS"'"}]'DashboardsUrl from the stack outputs and create an index pattern of events-* with time as the time field.cd cdkcdk destroy