I am trying to hide the "app key id" which define in the Lambda Environment variable using Terraform to show as > ************************* instead of the real value. Any suggestions how can I don that ?
Thanks
There is no way to achieve what you are trying and lambda environment variables are not a suitable place for storing app secrets.
For storing secrets, I would recommend that you use AWS Secrets Manager or AWS System Manager Parameter Store. Both have the ability to hide/mask the value, and also encrypt it, as per your use case.
AWS Secrets Manager is a costlier service in comparison but provides more features like integration for secret rotation with some AWS services (RDS, RedShift, DocumentDB) but the same effect can be achieved in Parameter Store using lambda functions.
You can compare and contrast and see what fits your use case better!