I'm trying to load properties file in my Lambda written in Java. I understand I can pass environment variables e.g env dev, test, stage, prod etc. and in lambda load respective properties file according to environment in which lambda is running. But this Lambda will be running under multiple AWS accounts in China region as well which currently do not support passing env variables to Lambda.
I was thinking I can figure out the AWS account number from API and based on account number I can load the correct properties file for that environment, will that be the right way to solve this issue. Suppose later I have to run the Lambda code in another environment that will require changing the code.
[Update]
Looks like I can extract the Account number from context variable available to handler
context.getInvokedFunctionArn()
e.g. arn:aws:lambda:us-east-1:999999999999:function:my_lambda_function