Set the maximum session duration for a RAM role by using the RAM console or an API. A longer session duration allows you to stay logged in for time-consuming tasks and obtain STS tokens with extended validity periods.
Limitations
-
The maximum session duration can be set to a value between 3,600 seconds (1 hour) and 43,200 seconds (12 hours). The default value is 3,600 seconds (1 hour).
-
You cannot set the maximum session duration for a service-linked role.
Console
-
Log in to the RAM console as a RAM administrator.
-
In the left-side navigation pane, choose .
-
On the Roles page, click the name of the target RAM role.
-
In the Basic Information section, click Edit next to Maximum Session Duration.
-
In the Edit Max Session Duration dialog box, enter the maximum session duration and click OK.
API
-
Call the CreateRole operation and set the
MaxSessionDurationparameter to specify the maximum session duration during role creation. -
Call the UpdateRole operation and set the
NewMaxSessionDurationparameter to update the maximum session duration for a RAM role.
Next steps
After you set the maximum session duration, you can assume the role by switching your identity, using role-based SSO, or calling an STS API operation. For more information, see the following topics:
Related topics
How do I adjust the login session duration and the validity period of an STS token?