Search code examples
aws-powershell

AWS SSO Login PowerShell


Due to security policy, connecting to AWS programmatically with PowerShell using an Access/Secret Key is not allowed at our organization anymore, and needs to be replaced with AWS SSO. But I didn't find any clear documentation on how to actually connect to AWS with PowerShell, using AWS SSO. On AWS official documentation for PowerShell Cmdlets, I can see a cmdlet named: Close-SSOSession, which is very straight forward about what is does. but which cmdlet is used to open the session in the first place? I would expect something like: Open-SSOSession. I also need to mention, that we are not allowed to install AWS CLI V2 on our Windows servers, as only the AWS PowerShell Module is approved to use by developers.


Solution

  • Please refer to https://docs.aws.amazon.com/powershell/latest/userguide/creds-idc.html.

    Initialize-AWSSSOConfiguration is an interactive cmdlet that lets you configure SSO profile. Please make sure that the AWS Tools modules version is 4.1.538 or above.