K

kpis

Scrape KPIs via Lambda and scheduled events

Name Last Update
cloudformation Loading commit data...
group_vars/all Loading commit data...
script Loading commit data...
src Loading commit data...
templates Loading commit data...
test Loading commit data...
vendor Loading commit data...
.dockerignore Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
Dockerfile Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
deploy.yml Loading commit data...
package.json Loading commit data...
teardown.yml Loading commit data...

KPIs

This repo contains the source to deploy a bunch of cron like Lambdas written in Node.js. It uses ansible incombination with cloudformation to deploy the whole stack to AWS.

Developing

$ make check
$ make clean test-ci
# Edit src files
$ make test # run tests quickly

Directory Structure

├── cloudformation -- Templates to provision AWS resources
├── group_vars     -- Ansible variables
├── script         -- Non-production workflow scripts
├── src            -- Individual Lambda source code
├── templates      -- Ansible templates
├── test           -- Tests used CI
└── vendor         -- Third party code

This project uses a few different tools so the things are bit mixes (Ansible directory + node code). Plus there is the Dockerfile, Makefile, and Ansible playbooks (deploy.yml, teardown.yml). Ingeration tokens are kept in an ansible vault. Set ANSIBLE_VAULT_FILE to edit group_vars/all/vault.yml.

Deploying

Deploys happen with ansible. The ansible playbook provisions AWS resources with cloudformation, creates a zip file (containing all Lambdas), runs a smoke test on the zip file, uploads the file to S3, then configures all the Lambdas to use the updated file on S3. Finally, a test invocation happens to verify the deploy.