serverless-crypt icon indicating copy to clipboard operation
serverless-crypt copied to clipboard

Missing required key 'KeyId' in params

Open Outc4sted opened this issue 8 years ago • 3 comments

This error happens when I attempt to encrypt. The alias for my KMS is PhotoboothConn

service: userApi
provider:
   ...
plugins:
   - serverless-crypt
custom:
   - cryptKeyId: ${env:PhotoboothConn}
functions:
   ...

And the command I run is sls encrypt -n PhotoboothConn -t "postgres://restOfConnectionString" --save

Outc4sted avatar Dec 22 '16 03:12 Outc4sted

@Outc4sted Thank you for your reporting.

cryptKeyId must be a valid KMS key ID. Does ${env:PhotoboothConn} mean "Using PhotoboothConn environment variable" in Serverless Framework.

Have you set PhotoboothConn environment variable?

marcy-terui avatar Dec 22 '16 03:12 marcy-terui

I didn't. I thought when I created the KMS it would automatically be set as an environment var for my lambdas. I just tried with pasting my key id in there and that worked, so thanks. Is it okay to make that into an environment var within my serverless.yml or is that something sensitive I don't want in plain text?

Outc4sted avatar Dec 22 '16 03:12 Outc4sted

Is it okay to make that into an environment var within my serverless.yml or is that something sensitive I don't want in plain text?

I think it is better not to show the ID to others. But, it is not a problem. It's like Account ID in the relationship between Account ID and Password.

marcy-terui avatar Dec 22 '16 04:12 marcy-terui