Clear Session

Clear an authenticated session.

Source code

This action can only be used in CLI mode.

Usage

Input

Parameter Description Type Required Default value
debug Increase log verbosity bool No False
silent Decrease log verbosity bool No False

Output

Returns either Linux (bash) or Windows (powershell) commands to clear exported environment variables.

Linux

unset AWS_ACCESS_KEY_ID; 
unset AWS_SECRET_ACCESS_KEY; 
unset AWS_SESSION_TOKEN;

Windows

$Env:AWS_ACCESS_KEY_ID=''; 
$Env:AWS_SECRET_ACCESS_KEY='';
$Env:AWS_SESSION_TOKEN='';

Examples

Clear a session:

This will remove temporary credentials from the environment.

Linux

eval $(aaws sts clear_session)

Windows

aaws sts clear_session | Invoke-Expression