Integration Example: AWS Lambda

Sync your AWS lambda functions to an Ardoq workspace using the new NodeJS SDK, create powerful integrations in just a dozen lines of code.

Kristine Marhilevica avatar
Written by Kristine Marhilevica
Updated over a week ago

Ardoq has recently released an exciting new NPM module.

This node module allows you to create powerful integrations in just a dozen lines of code! This tutorial will show you how to sync your lambda functions from AWS into an Ardoq workspace.

The code can be run frequently ( think Jenkins, CircleCI, Webhooks, Jira ... etc) and will update the workspace if any lambda functions have been created/updated/deleted within your AWS account.

First, clone the repository with the example code. This repo will use the sync function from ardoq-sdk-js.

git clone https://github.com/ardoq/ardoq-sync-examples


Create a config.js file, by copying the file config.sample.js.

Ardoq was lambda config.js file

You will need to add some credentials here. From IAM in AWS, generate a user with API access and assign the policy AWSLambdaReadOnlyAccess (admin will also work). Copy and paste the accessKeyId and secretAccessKey into the config.js file

Same for your Ardoq token:

Ardoq token

Create a blank workspace in Ardoq, and copy the workspace ID into the config, as well as your Ardoq org name. FYI - AWS workspace templates will be available soon directly from the Ardoq app!
​

Ardoq edit organization

Once your configuration has been updated. You will need to install npm dependencies and run the script. The script will fetch data from AWS, then format this into a graph (which in this case just a list of nodes with no edges). Then the sync module will compare your workspace to your AWS lambda state, and update the workspace accordingly!

npm install npm run lambda

...And you should have data! There are a few metadata fields that have been imported too, such as Runtime, ARN (Amazon Resource Name), etc. In this visualization, I am grouping by the 'Runtime' field.

Ardoq runtime field


Also included are URL fields, with which you can navigate directly to the AWS console, either to the relevant Cloudwatch Logs or to the lambda page itself.

Ardoq Cloudwatch logs

Finally, if you read the code for the integration src/examples/awsLambda/index.js you will see how simple it is to create these "syncs", thanks to the AWS SDK and the Ardoq SDK. Many more possibilities await!
​
​

Did this answer your question?