How to pass credentials in Glue Notebooks - Interactive Session using Magic Commands to override the 1 hour temporary token expiration

0

Hi, If I start the notebook via the console the token/credentials expire after one hour, Gives the following error "Exception encountered while retrieving session: An error occurred (ExpiredTokenException) when calling the GetSession operation: The security token included in the request is expired " .

I am guessing this is happening since its using temporary credentials by default. How does one pass the credentials using the magic commands such that credentials do not expire or workaround?

I can run notebooks locally using the profile in local .aws folder, but can't use TAGS for the sessions to account for costs.

질문됨 2년 전491회 조회
1개 답변
0

From the console Glue notebook, I tried running %iam_role my-glue-role magic to reset the IAM role and that seemed to do the trick.

You are already connected to session axxxxxxx-2xxxx-4xxx-bxxx-0xxxxxxx. Your change will not reflect in the current session, but it will affect future new sessions. 

Current iam_role is arn:aws:iam::xxxxxxxxx:role/my-glue-role
iam_role has been set to my-glue-role.

If you are doing it using an API in your computer, you can increase the maximum session duration expiration for temporary credentials for IAM roles using the DurationSeconds parameter for your use case.

profile pictureAWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠