python-lambda icon indicating copy to clipboard operation
python-lambda copied to clipboard

Accessing config.yaml parameters

Open baturorkun opened this issue 5 years ago • 2 comments

I want to access config.yaml parameters. For example "aws_access_key_id" or "description" or "timeout" etc.. I could not find any object for this.

baturorkun avatar Mar 18 '20 19:03 baturorkun

Define your variables preferably under environment_variables e.g. In config.yml

environment_variables:
  timeout: 5
  key: xxx

Then in your Python file

import os
timeout = os.environ.get("timeout")

ninurtalabs avatar Mar 22 '20 18:03 ninurtalabs

@baturorkun Can you describe your problem a little more if getting it through "os.envrion.get(<config_parameter_name>)" does not fully solve the issue.

bot2x avatar Aug 02 '22 18:08 bot2x