September 2018
Intermediate to advanced
386 pages
11h 17m
English
In this section, let's provision a key that will be used to encrypt environment variables supplied to Lambda. We have seen this in Chapter 7, Secure Your Application, where we created a key from the web console. The following code block shows us how to provision a KMS key using the serverless framework. The following are the contents of the /resources/kms.yml file:
Resources: letsPollKMSKey: Type: AWS::KMS::Key Properties: Description: "Key to aid in masking of environment variables used by AWS Lambda Env Var" Tags: - Key: Name Value: Lets Poll CMK KeyPolicy: Version: "2012-10-17" Id: "Administrator Access to manage the key" Statement: - Sid: "Allow administration of the key" Effect: "Allow" Principal: AWS : Fn::Join: ...
Read now
Unlock full access