The real value here is not serverless novelty but delaying irreversible audio compression until operational work is finished. That sequencing matters because call recordings initially serve analytics, quality review, and retryable downstream processing, yet later become cold compliance artifacts. By separating those phases, the design turns storage from a passive expense into a managed workflow. Practitioners should read this as an archive-optimization pattern: preserve high-fidelity data while it is still useful, then downgrade it only after its business value declines.
The mechanism is deliberately asynchronous. A scheduled Step Functions workflow scans the prior weekโs objects in S3, pushes them into SQS, and lets Lambda workers resample each .WAV file with ffmpeg before rewriting it into a cheaper storage class. That architecture reduces coordination overhead and allows retries without blocking ingestion. The tagging and dead-letter handling are operationally important because they provide traceability when conversion fails. In practice, the design aligns compute cost with the narrow window when files actually need transformation.
The main tradeoff is that savings depend on accepting nonreversible quality loss and on confident assumptions about access patterns. If a recording later needs high-fidelity replay or expanded analytics, the compressed version may be inadequate, so version retention and lifecycle cleanup must be governed carefully. The cited cost model is persuasive, but it assumes large, stable volumes and disciplined processing windows. For practitioners, the lesson is narrower than the headline: archive economics improve when transformation is deferred, controlled, and explicitly bounded.
Solution overview
When an agent completes a customer call, Amazon Connect sends the call recording to anย Amazon Simple Storage Solution (Amazon S3)ย bucket with: a date and contact ID prefix, the file stored in the .WAV format and encoded using bitrate 256 kb/s, pcm_s16le, 8000 Hz, two channels, and 256 kb/s.ย The call-recording files are approximately 2 Mb/minute optimized for high-quality processing, such as machine learning analysis (see Figure 1).
Figure 1. Asynchronous architecture for batch resampling for call-recording files on Amazon S3
Figure 2. AWS Step Function orchestrates the batch resampling of call recordings
Figure 3. Detailed AWS Step Functions state machine diagram
Resampling
Table 1. Default and resampled call recording audio formats| Audio sampling formats | File size/minute | Notes |
|---|---|---|
| Bitrate 256 kb/s, pcm_s16le, 8000 Hz, 2 channels, 256 kb/s | 2 MB | The default for Amazon Connect call recordings. Sampled for audio quality and call analytics processing. |
| Bitrate 64 kb/s, pcm_alaw, 8000 Hz, 1 channel, 64 kb/s | 0.5 MB | Resampled to mono channel 8 bit. This resampling is not reversible and should only be performed after all call analytics processing has been completed. |
Cost assessment
For pricing information for the primary services used in the solution, visit:- Amazon S3 pricing
- AWS Step Functions Pricing
- AWS Lambda Pricing
- Amazon SQS Pricing
- Original Postricing/" target="_blank" rel="noopener">Amazon CloudWatch pricing
| Year | Total minutes (3 million/month) | Total storage (TB) | Cost of storage, S3 Standard (USD) | Cost of running the resampling (USD) | Cost of resampling solution with S3 Glacier Instant Retrieval (USD) |
|---|---|---|---|---|---|
| 1 | 36,000,000 | 72 | 10,764 | 3,960 | 4,813 |
| 2 | 72,000,000 | 108 | 30,636 | 3,960 | 5,677 |
| 3 | 108,000,000 | 144 | 50,508 | 3,960 | 6,541 |
| 4 | 144,000,000 | 180 | 70,380 | 3,960 | 7,405 |
| 5 | 180,000,000 | 216 | 90,252 | 3,960 | 8,269 |
| 6 | 216,000,000 | 252 | 110,124 | 3,960 | 9,133 |
| Total | 1,008,000,000 | 972 | 356,664 | 23,760 | 41,838 |
Deploying the solution
The code and documentation for this solution are available by cloning theย git repositoryย and can be deployed withย AWS Cloud Development Kit (AWS CDK).Bash
# clone repository
git clone https://github.com/aws-samples/amazon-connect-call-recording-cost-optimizer.git
# navigate the project directory
cd amazon-connect-call-recording-cost-optimizer
Modify theย cdk.context.jsonย with your environmentโs configuration setting, such as theย bucket_name. Next, install the AWS CDK dependencies and deploy the solution:
:# ensure you are in the root directory of the repository
./cdk-deploy.sh
Once deployed, you can test the resampling solution by waiting for the EventBridge schedule rule to execute based on theย num_days_ageย setting that is applied. You can also manually run the AWS Step Function with a specified date, for exampleย {"specific_date":"01/01/2022"}.
The AWS CDK deploymentย creates the following resources:
- AWS Step Function
- AWS Lambda function
- Amazon SQS queues
- Amazon EventBridge rule
Cleanup
When you are finished experimenting with this solution, cleanup your resources by running the command:cdk destroy
This command deletes the AWS CDK-deployed resources. However, the S3 bucket containing your call recordings and CloudWatch log groups are retained.
Conclusion
This call recording resampling solution offers an automated, cost-optimized, and scalable architecture to reduce long-term compliance call recording archival costs.Enjoyed this article? Sign up for our newsletter to receive regular insights and stay connected.

