0
0
AWScloud~5 mins

Environment variables in Lambda in AWS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What are environment variables in AWS Lambda?
Environment variables in AWS Lambda are key-value pairs that you can set to store configuration settings. They help your function access settings without hardcoding them in the code.
Click to reveal answer
beginner
How do environment variables improve Lambda function management?
They let you change settings like database URLs or API keys without changing the code. This makes your function easier to update and more secure.
Click to reveal answer
intermediate
Can environment variables in Lambda be encrypted? If yes, how?
Yes, Lambda supports encrypting environment variables using AWS Key Management Service (KMS). This keeps sensitive data like passwords safe.
Click to reveal answer
beginner
How can you access environment variables inside a Lambda function?
Inside your Lambda code, you can read environment variables using standard methods. For example, in Node.js, use process.env.VARIABLE_NAME.
Click to reveal answer
intermediate
What is a best practice when using environment variables in Lambda?
Avoid putting sensitive data directly in environment variables unless encrypted. Use AWS KMS encryption and restrict access with IAM roles.
Click to reveal answer
What is the main purpose of environment variables in AWS Lambda?
AIncrease the memory of the Lambda function
BStore configuration settings separately from code
CControl the number of Lambda executions
DManage user permissions
How can you secure sensitive environment variables in Lambda?
AEncrypt them using AWS KMS
BStore them in plain text
CHardcode them in the Lambda function
DDisable environment variables
Which of the following is a correct way to access an environment variable named 'API_KEY' in Node.js Lambda code?
Alambda.env.API_KEY
Benv.API_KEY
Cprocess.env.API_KEY
DgetEnv('API_KEY')
What happens if you update an environment variable in Lambda?
AThe new value is used in the next function invocation
BThe function crashes immediately
CThe old value remains forever
DThe Lambda function restarts automatically
Which AWS service is used to encrypt Lambda environment variables?
AAmazon EC2
BAmazon S3
CAWS CloudTrail
DAWS Key Management Service (KMS)
Explain what environment variables are in AWS Lambda and why they are useful.
Think about how you might keep your app settings outside the code.
You got /5 concepts.
    Describe how to securely manage sensitive data using environment variables in Lambda.
    Focus on encryption and access control.
    You got /4 concepts.