A sample app demonstrating how to use ConfigCat feature flags in an AWS Lambda function running on .NET.
Instructions on how to build and run the application locally.
You will need a few tools installed and accounts set up. Free tiers work perfectly for everything here.
- A ConfigCat account: You can sign up for a Forever Free account here.
- An AWS account: You will need access to the AWS Console and a user with permissions to create Lambda functions.
- Docker Desktop: You can use Docker to spin up a Redis server to run the Lambda locally. (In production AWS environments, Amazon ElastiCache is typically used instead.)
- Microsoft .NET SDK: You will need the .NET 10 SDK or newer to build the project. Download it here.
- Command line tools:
- AWS .NET Mock Lambda Test Tool: Install the version matching your .NET SDK version as a global .NET tool (
dotnet tool install -g Amazon.Lambda.TestTool-10.0). - AWS CLI: Configure it with your credentials (
aws configure). - AWS Lambda Tools for .NET: Install it as a global .NET tool (
dotnet tool install -g Amazon.Lambda.Tools).
- AWS .NET Mock Lambda Test Tool: Install the version matching your .NET SDK version as a global .NET tool (
-
Build the project:
dotnet build
-
Spin up a Redis server locally using Docker:
docker compose up -d
-
Run the Lambda Test Tool:
dotnet lambda-test-tool-10.0
-
When launched, click the Execute Function button. The Response and Log Output show the result of feature flag evaluation, based on the data cached in Redis.
-
Deploy the function to AWS Lambda:
dotnet lambda deploy-function ConfigCatLambdaDemo
-
Once deployed, invoke the function directly from the CLI to see the result immediately:
dotnet lambda invoke-function ConfigCatLambdaDemo
Useful links to technical resources:
ConfigCat supports many other frameworks and languages. Check out the full list of supported SDKs here.
You can also explore other code samples for various languages, frameworks, and topics in ConfigCat labs on GitHub.
Keep up with ConfigCat on X, Facebook, LinkedIn, GitHub, and the News & Product Updates page.
Contributions are welcome!