how to retrieve aws batch parameter value in python?

徘徊边缘 提交于 2021-01-27 18:53:10

问题


Flow :- Dynamo DB --> Lambda --> Batch

If a role arn is inserted in dynamo DB, it is retrieved from lambda event, it is then submitted to batch using submit_job API with role arn being passed as

parameters={
    'role_arn': 'arn:aws:iam::accountid:role/role_name'
}

How to read the parameter value in python running in batch?


回答1:


First you need to specify the parameter reference in your docker file or in AWS Batch job definition command like this

/usr/bin/python/pythoninbatch.py Ref::role_arn

In your Python file pythoninbatch.py handle the argument variable using sys package or argparse libray.

sys.argv[1]


来源:https://stackoverflow.com/questions/48718444/how-to-retrieve-aws-batch-parameter-value-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!