How to change an IAM role session duration

0 votes

Hi Guys,

I have created an IAM role in AWS. Now I want to change an IAM role session duration from the command line. How can I do that?

Nov 4, 2020 in AWS by akhtar
• 38,170 points
124 views

1 answer to this question.

0 votes

Hi@akhtar,

You can update the IAM role from the AWS CLI. The following update-role command changes the description of the IAM role production-role to the Main production role and sets the maximum session duration to 12 hours.

$ aws iam update-role --role-name production-role --description 'Main production role' --max-session-duration 43200
answered Nov 4, 2020 by MD
• 95,160 points

Related Questions In AWS

0 votes
1 answer

How to launch an EC2 instance with IAM-Role?

The credentials you are using from your ...READ MORE

answered Sep 3, 2018 in AWS by Archana
• 4,150 points
1,404 views
0 votes
1 answer

How to add IAM role to an existing instance in aws?

As of AWS CLI v1.11.46,  you can ...READ MORE

answered Sep 6, 2018 in AWS by Archana
• 4,150 points
851 views
0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer

How to create an IAM user in AWS?

Hi@akhtar, To create new user in AWS, you ...READ MORE

answered Jun 1, 2020 in AWS by MD
• 95,160 points
213 views
0 votes
1 answer

How to add a role to an instance profile in AWS?

Hi@akhtar, You can add the specified IAM role ...READ MORE

answered Nov 3, 2020 in AWS by MD
• 95,160 points
58 views