I want to update path from python script i-e add /tmp in $PATH. Reason is I am using aws lambda and it looks for aws-iam-authenticator binary. Now this binary has to be in $PATH otherwise it throws error:
[Errno 2] No such file or directory: 'aws-iam-authenticator': 'aws-iam-authenticator'
Since only /tmp is writeable in aws-lambda I can not move this binary to any other /bin/* or PATH dir.
I tried doing this:
subprocess.call('PATH=$PATH:/tmp/',shell=True)
But it doesn't work.
Lambda path:
PATH=/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin
tmpfolder will be in yourPATHwhich may lead to problems when resolving executable real path. A better way to solve your issue would be to move theaws-iam-authenticatorbinary to a folder in your path (/opt/binfor instance). You may need to play around withchmodandchown./tmp/aws-iam-authenticatoraws-iam-authenticator, why are you installing it to/tmp, rather than somewhere already accessible?