andrewshih
andrewshih

Reputation: 527

Configure a threshold used on AWS Lambda

I have a program running on AWS Lambda like the following.

threshold = 10
def alerting(x, y):
    ans = x + y
    return True if ans > threshold else False

There is one problem that I need to change the program and deploy if I want to use another number as a threshold. I'd like to change the threshold dynamically. What kinda AWS solutions can be used for that? I thought I should put a config file on S3 and then the program on Lambda tries to read it to use as a parameter when it is invoked for example.

Is there any better solution with AWS?

Upvotes: 0

Views: 111

Answers (1)

Hossam ELMansy
Hossam ELMansy

Reputation: 516

For this simple case you can either use Environment Variables or Systems Manager Parameter Store and attach to your Lambda function's execution role a policy to access this parameter.

Upvotes: 2

Related Questions