Search code examples
amazon-web-servicesaws-lambdaalexa-skills-kitamazon-kms

Alexa skills, Lambda and weird AWS Key Management Service requests


I'm starting with Alexa development and AWS in general. I've subscribed for the free tier, created my skill, set a AWS Lambda function and done some little testing. I got nothing more running on AWS.

What I've noticed that except for AWS Lambda and Cloudwatch usage I got requests to AWS Key Management Service on my Billing Dashboard. I'm not using any environment variables as this was one of the reasons for KMS requests suggested by Google.

From my billing management report I got 3 times more KMS requests than to my Lambda (30 vs 9). I know this is small number but KMS got 20k requests in the free tier and Lambda got 1000000 and I just don't understand how this connects to each other.

Is AWS KMS required for Lambda operation? What is it used for?

enter image description here


Solution

  • Many AWS services are using KMS to manage keys and access to keys while keeping them under your control.
    The full list is documented here https://docs.aws.amazon.com/kms/latest/developerguide/service-integration.html

    Pricing of KMS is per keys that you create and manage. https://aws.amazon.com/kms/pricing/
    Keys automatically created by AWS Services are for free.

    I just checked my bill and I am not charged for KMS at all.

    I do suggest you to enable CloudTrail logs on your account to understand where the KMS calls you're seeing are originated from.

    To query Cloudtrail logs, you can make a simple SQL query on Athena.

    Doc to setup Athena for Cloudtrail : https://docs.aws.amazon.com/athena/latest/ug/cloudtrail-logs.html

    SQL Query to analyze kms calls :

    SELECT eventtime,
             useridentity.type,
             eventsource,
             eventname,
             sourceipaddress,
             eventtime
    FROM "default"."cloudtrail_logs_logs_sst_cloudtrail"
    WHERE eventsource = 'kms.amazonaws.com' AND
          eventtime BETWEEN '2018-07-01' AND '2018-07-31' ;