I have several lambda’s I am working with, and they use some private tokens as part of the execution.
I want to avoid keeping them in the lambda function in plain text, and would rather keep them somehow in an encrypted global variable or some other way AWS is offering for such things?
I’m sure there’s plenty of ways to do so in AWS, but as a beginner+ aws user I would love to hear your feedback what would be safe to use, maintain and access when needed.
Thanks!
Currently my lambda is just storing the pass key in plain text.
I need it to be stored like a global variable and I am not sure where to start.
2
Answers
Thanks for the guidance guys!
Eventually this is what I did:
And it now works :)
You should use AWS SSM Parameter Store
SecureString
, or AWS Secrets Manager to store these values. When using Secrets Manager, or when using SSM Parameter StoreSecureString
, the value will be encrypted using AWS KMS.If you want further control over this, you can create a Customer Master Key in AWS KMS, and tell SSM or Secrets Manager to use that key for encryption. Your Lambda function will need the relevant IAM permissions to access the secure parameter/secret, as well as decrypt permissions for the KMS key.