API Reference
    Preparing search index...
    • Check if the code is running inside an actual AWS Lambda execution environment.

      This is determined by the AWS_LAMBDA_INITIALIZATION_TYPE environment variable, which is set by the Lambda runtime to either on-demand or provisioned-concurrency.

      When the variable is not set, or when running in development mode - see isDevMode() - the function returns false, e.g. during local development or in tests.

      Returns boolean

      import { isRunningInLambda } from '@aws-lambda-powertools/commons/utils/env';

      if (isRunningInLambda()) {
      // do something that requires a real Lambda execution environment
      }