Last active
December 5, 2024 18:04
-
-
Save ttfkam/41b5567f72f6f86405479db8c2c402b5 to your computer and use it in GitHub Desktop.
Detect AWS Lambda Environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html | |
if (process.env.AWS_SAM_LOCAL === 'true') { | |
// SAM local development | |
} else if (!!process.env.LAMBDA_TASK_ROOT) { | |
// You're on AWS Lambda | |
} else { | |
// Local or elsewhere | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment