Development with AWS Services
A Lambda function has environment variables STAGE=prod and PREFIX=${STAGE}/images. Its code reads PREFIX directly and receives the placeholder unchanged. What should the developer do to produce prod/images?
Show the answer
Correct answerD. Read STAGE and construct the prefix in the function code.
AWhy not this: Publishing a version snapshots configuration without expanding variable references.
BWhy not this: IAM permissions do not enable substitution within Lambda environment variable values.
CWhy not this: The handler identifies the entry point; it does not control environment variable substitution.
DWhy this is right: The code must construct the value because Lambda does not expand environment variable references.
Lambda treats environment variable values as literal strings and does not expand references to other variables. Publishing a version preserves the configuration; it does not perform variable substitution.