简体   繁体   English

AWS Glue Job Python脚本Boto3-要隐藏凭证

[英]AWS Glue Job Python Script Boto3 - want to hide credentials

Has anyone found a way to hide boto3 credentials in a python script that gets called from AWS Glue? 有没有人找到一种方法来隐藏从AWS Glue调用的python脚本中的boto3凭证?

Right now I have my key and access_key embedded within my script, and I am pretty sure that this is not good practice... 现在,我在脚本中嵌入了key和access_key,我很确定这不是一个好习惯。

I found the answer! 我找到了答案! When I established the IAM role for my Glue services, I didn't realize I was opening that up to boto3 as well. 当我为Glue服务建立IAM角色时,我没有意识到我也向boto3开放了该角色。

The answer is that I don't need to pass my credentials. 答案是我不需要通过我的凭据。 I simply use this: 我只是用这个:

mySession = boto3.Session(region_name='my_region_name')

and it works like a charm! 它就像一个魅力!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM