Skip to content

Can we make MFA session tokens expire in less than 12 hours? #2177

Description

@gerrymiller

We are using IAM roles with CLI, as described in this article, by setting our ~/.aws/config file to look something like this:

[profile poweruser]
role_arn = arn:aws:iam::111111111111:role/PowerUser
source_profile = default
mfa_serial = arn:aws:iam::111111111111:mfa/johndoe

Is there a configuration setting we can use to make the resultant session token expire in less than the default 12 hours? I know that's an option in get-session-token (using the --duration-seconds parameter) but can't figure out if this is possible when configuring AWSCLI to prompt for an MFA code.

If this is currently not possible, it would make a great new feature!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions