I need to deploy AWS lambda function using serverless with secret keys into environment variable from a file. I do not want to use AWS secret/system manager. How do I hide the environment variable in serverless.yml file?
When i manually upload and deploy my nodejs AWS lambda function, it is able to read data from environment variable and run. I want to handle this using serverless instead of manual deployment.
My serverless yml file is as below:
service: sample-lambda
provider:
name: aws
runtime: nodejs10.x
stage: dev
region: us-east-2
apiName: getData
profile: MYAWS
timeout: 300
memorySize: 512
functions:
getData:
handler: handler.getData
name: getData
description: API to get data from server
environment:
key1: 12345
key2: abcdef
server: sample
events:
- http:
path: getData
method: post
cors: true