Cannot access deploy_id from Lambda function

I’m having trouble with the following code (it is sitting under /functions and running fine). I have an hourly scheduled function also running on the same site that get the DEPLOY_ID just fine.

const app = express();
const SITE_ID = process.env.SITE_ID;
console.log(SITE_ID);  // this correctly logs 
const DEPLOY_ID = process.env.DEPLOY_ID;
console.log(DEPLOY_ID);   // this is undefined
const TOKEN = process.env.NETLIFY_AUTH_TOKEN;
console.log(TOKEN);  // this correctly logs 

This is express with serverless-http

DEPLOY_ID is a deploy-time variable, not request-time. You’d have to write the value of the deploy ID to a file and read that file in your Function. You’d also need: How to Include Files in Netlify Serverless Functions