
Create a REST API that proxies requests directly to Amazon CloudWatch Logs to put and get log events, without a Lambda function.
POST /putLog maps to the PutLogEvents action and writes an event to a log stream, and POST /getLog maps to GetLogEvents and reads the events back.logs:PutLogEvents and logs:GetLogEvents on the one log stream the stack creates. The log group and stream are fixed in the mapping templates, so callers can't reach other logs, and the templates encode the caller's ts and message with $input.json, so a crafted value can't break the JSON request.git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-cloudwatch-logs/samsam deploy --guidedPOST requests with a ts and message to the PutLogUrl output, then read them back from GetLogUrl. See the README in the GitHub repo for the commands.sam delete