Audio Processing API in AWS Lamba using Ffmgeg
This is a audio-processing project for CDK development with TypeScript.
The
cdk.json file tells the CDK Toolkit how to execute your app.Useful commands
npm run build compile typescript to jsnpm run watch watch for changes and compilenpx cdk deploy deploy this stack to your default AWS account/regionnpx cdk destroy delete this stack with all the resources it includesnpx cdk diff compare deployed stack with current statenpx cdk synth emits the synthesized CloudFormation templateRoutes
/transcode
/concat
Deploy the stack on AWS
Configure IAM
Go to AWS Identity and Access Management (IAM)
Create a new policie from JSON
Save the policie by providing a name (eg: cdk-deploy).
Create a user and as attatch permissions policie that you just created frow AWS console.
Select the newly created user and go to the
Security credentials tab.Now on the
Access keys section, click on the Create access key button.Now select use case
Command Line Interface (CLI) and confirm. Click on the next button.Click
Create access key button.Now store the
Access key and Secret access key.Configure Github Action
Go to github repo settings.
On the
Security section click on Secrets and variable and then click on action.Now click on
New repository secret and two secret AWS_ACCESS_KEY_ID and AWS_SECRET_KEY and the value should be the Access key and Secret access key you got from AWS console.(Optional) Set another secret
AWS_REGION to specify the deployment region. Default region is us-east-1.Manually trigger deployment
You can triger deployment manually by going to
Action tab on github repo.The choosing
CDK Deploy action and clicking on Run workflow button.Auto-deploy on code push
If you set up github action then whenever a new code push happen on
master branch, the deployment will update automatically.Lambda api gatway url
You can find the deployment url inside github action log. Here is a sample output:
You can see here there is a url
https://fivtqcifhd.execute-api.us-east-1.amazonaws.com/prod/ inside log output. This is the lambda api gatway URL.You can invoke lambda using this URL.
Setup custom domain
If you want to add a custom domain you can follow this guide: https://medium.com/geekculture/how-to-add-a-custom-domain-to-lambda-functions-1bc0ae639676
Configure lambda RAM size and timeout setting
You can change lambda RAM size and timeout setting inside this file:
lib/audio-processing-stack.tsThese are the currentl values:
0 likes · 72 views · Aug 26, 2025
Developed and deployed an audio processing API using AWS Lambda and CDK with TypeScript.