bbilger/jrestless

Add Execution Stage Information

Closed this issue · 1 comments

Make the execution stage injectable.

  • add a new class ExecutionStage with a name property
  • derive the exection stage from com.amazonaws.services.lambda.runtime.Context#getInvokedFunctionArn()
    • invokedFunctionArn.split(":").length == 8 => invokedFunctionArn.length.split(":")[7] => alias
    • invokedFunctionArn.split(":").length == 7 => invokedFunctionArn.length.split(":")[6] => lambda function name => search for well known names like "dev", "development", "prod", "production" (serverless appends -- to the lambda function name)

the invokedFunctionArn looks like this arn:aws:lambda:<REGION>:<ID>:function:<LAMBDA FUNCTION NAME>:<ALIAS, optional>

this feature is not eligible for the framework