Now, we build and deploy the package in the usual way via the console, and test it using the curl command. The output is as follows:
Ameyas-MacBook-Pro:greeter-service Webonise$ curl -X POST -H 'x-api-key:1fmETyfh8x7OazCD4nPvd9WkUPM0An953mkmpmoN' https://8uf5e3eccd.execute-api.us-west-1.amazonaws.com/test/greeter -d '"ameya"'"Hello, ameya on 2018-08-29 16:30:46.515508 as per the time on database server"
As we can verify the output is the same as was expected, this shows how we can use AWS KMS to encrypt environment variables supplied to a lambda function and decrypt them during its execution.