A team migrates a Node.js handler to Python but leaves the handler string pointing at the old export name, causing runtime import errors. What must be aligned?
Select an answer to reveal the explanation.
Short Explanation
The bouncer checks both the language on the invitation and the door marked on the map. After moving from Node to Python, point runtime and handler at the new module.function entrypoint—or Lambda keeps looking for an export that no longer exists. IAM, memory, and log group renames won't fix a wrong handler string.
Full Explanation
When a team migrates a Node.js handler to Python but leaves the handler string pointing at the old export name, runtime import errors follow. The Lambda runtime and handler string must match the packaged entrypoint—for Python, something like module.function that actually exists in the deployment artifact. Runtime, handler configuration, and package contents form one contract; changing language without updating that configuration is a classic promotion failure in municipal CI/CD pipelines and shows up as “Unable to import module” at the worst time—right after a “successful” deploy.
Updating only the IAM role does not fix import paths or entrypoint names. Memory settings do not make Python ignore a wrong handler field. Changing only the CloudWatch log group name when switching languages addresses where logs land, not how Lambda resolves the callable. Likewise, leaving a Node-style index.handler export string while shipping Python modules guarantees cold failure on every invoke.
Exam caveat: handler formats differ by runtime (Node file.export, Python file.func, Java fully qualified class::method or ::handleRequest styles). Container image packaging uses a different image entrypoint story than zip handlers—align the deploy type you chose. Always smoke-invoke after runtime migrations before promoting toward citizen traffic.
Operational check: update runtime and handler together in IaC; add a CI check that imports the handler locally for the target runtime; smoke-test with a sample event in sandbox after deploy; and keep fixtures for the new runtime’s event shapes so API Gateway proxy fields still parse correctly.