Skip to content

Conversation

@frank-bee
Copy link

@frank-bee frank-bee commented Dec 1, 2025

Summary

This PR adds significant enhancements to the AWS SSO Profile Tool:

  • PowerShell support: New cross-platform PowerShell script (awsssoprofiletool.ps1) for Windows users
  • Non-interactive mode: -y flag (Bash) / -NoPrompt (PowerShell) for automation and CI/CD pipelines
  • Account name mapping: --map "FROM:TO" option to create shorter/custom profile names
  • Default profile creation: --default <profile> option to create a [default] profile mirroring a specific profile

Changes

New Files

  • awsssoprofiletool.ps1 - Full-featured PowerShell implementation with feature parity to Bash script

Enhanced Features (awsssoprofiletool.sh)

  • Added -y flag for non-interactive mode (overwrites config and creates all profiles without prompts)
  • Added --map "FROM:TO" option to map account names to shorter names in profile names
    • Example: --map "Infrastructure:Infra" creates InfraFooAccess instead of InfrastructureFooAccess
    • Can be specified multiple times
  • Added --default <profile> option to create a [default] section mirroring a specific profile
    • Enables AWS CLI commands without --profile flag
  • Improved argument parsing with proper validation
  • Added trap handlers for proper temp file cleanup on SIGINT/SIGTERM
  • Bash 3.x compatibility (for macOS default shell)

Documentation Updates (README.md)

  • Added "Quick Start" section with one-liner installation examples for both Bash and PowerShell
  • Updated usage syntax to document new options
  • Added examples for account name mappings and default profile configuration

Usage Examples

Bash (One-liner)

bash <(curl -fsSL https://raw.githubusercontent.com/frank-bee/aws-sso-profile-tool/main/awsssoprofiletool.sh) \
  -y \
  --map "Infrastructure:Infra" \
  --map "Development:Dev" \
  --default "DevAdministratorAccess" \
  us-east-1 "https://mycompany.awsapps.com/start"

PowerShell (One-liner)

& ([scriptblock]::Create((irm https://raw.githubusercontent.com/frank-bee/aws-sso-profile-tool/main/awsssoprofiletool.ps1))) `
  -Region us-east-1 `
  -StartUrl "https://mycompany.awsapps.com/start" `
  -NoPrompt `
  -Map "Infrastructure:Infra","Develop:Dev" `
  -Default "BarFooAccess"

Test Plan

  • macOS (Bash 3.x)
  • Windows (PowerShell)
  • Linux

- Add PowerShell version (awsssoprofiletool.ps1)
- Add --default flag to set default AWS profile
- Add --map parameter for configurable account name mappings
- Add -y flag for non-interactive mode
- Fix region and starturl variable storage
- Fix process substitution for curl execution
- Fix /dev/tty read for SSO login wait
- Update copyright to Frank Bernhardt
- Remove company-specific references
- Update documentation
@frank-bee frank-bee marked this pull request as ready for review December 1, 2025 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant