Using Consul with Serverless
This is an example of Consul Service Mesh with serverless. In this case, we use:
to quickly demonstrate how service networking can facilitate security and management of serverless.
We wrote a function that:
Accesses a database containing 311 complaints submitted to New York City on Halloween 2018.
Aggregates the data for a given borough and returns the total number of complaints for the borough.
However, we find out that a compliance requirement outlines that production infrastructure must only connect to production data.
We can meet this compliance requirment with a few solutions:
Let's examine intent-based networking to prevent a non-production function from access production data!
vagrant up
open http://192.168.50.5:8500
open http://192.168.50.5:4646
vagrant ssh
cd serverless-consul
nomad run nomad_job_files/dev-db.hcl
nomad run nomad_job_files/prod-db.hcl
nomad nomad_job_files/prod-db.hcl
curl 10.0.2.15:8080/function/nyc311-halloween-prod -d 'Manhattan'
willvagrant destroy --force