CloudFront Function: Secret/Config management #18339
ChristopheBougere
started this conversation in
General
Replies: 2 comments 2 replies
-
Some opinions and questions from my side:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
As was stated in the article you linked, the best practice for this is to use a Secrets Manager/KMS managed key that is retrieved by the lambda at runtime (as you are allowed to make calls to the AWS SDK) in order to keep from keeping your secrets in your CDK code -- only the references to your keys are there, not the keys themselves. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm following this post for securing content with CloudFront Function.
The major drawback to me is the need to write the secret in the CloudFront Function code, and thus committed in the repository. It also makes it more complicated to use different values for each environment.
I know CloudFront Function don't have environment variables, and cannot do network call, so I'm trying to find a workaround and was thinking about this:
cdk.json
file that doesn't need to be committed)filePath
option of theFunctionCode.fromFile()
method, we could add a dictionary of placeholders to replaceHere is a quick snippet (not tested):
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions