This is a companion repo for the blog article titled: How to use feature flags with AWS Lambda. The article walks you through the steps on how you can use ConfigCat feature flags to control functionalities of your AWS Lambda functions.
- A verified AWS account
- Basic Node.js and AWS knowledge
-
Clone this repo and run
npm install
to install the packages. -
Open the
index.mjs
and replaceYOUR-CONFIGCAT-SDK-KEY
with your SDK Key. If you named your feature flag differently you may need to change its name in thegetValueAsync
function.
- In the root folder, run the following command to zip all the files:
zip function.zip *
- On the function page, with the Code tab selected, upload your
function.zip
file by clicking the Upload from button on the right.
Add an API Gateway trigger. As a result, when a GET request is sent to the function endpoint it will trigger the execution of the function.
Click the Deploy button to publish the function, then make a GET request to the endpoint url generated by the API Gateway trigger.
Useful links to technical resources.
-
AWS Lambda Documentation - Introduction to AWS Lambda.
ConfigCat also 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 here in the ConfigCat labs on GitHub.
Keep up with ConfigCat on Twitter, Facebook, LinkedIn, and GitHub.
Contributions are welcome!