{"id":23312,"library":"aws2-wrap","title":"aws2-wrap","description":"A wrapper for executing a command with AWS CLI v2 and SSO. Current version 1.4.0, requires Python >=3.8. Released irregularly as needed.","status":"active","version":"1.4.0","language":"python","source_language":"en","source_url":"https://github.com/linaro-its/aws2-wrap","tags":["aws","sso","cli","wrapper"],"install":[{"cmd":"pip install aws2-wrap","lang":"bash","label":"Pip install"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"Aws2Wrap","correct":"from aws2-wrap import Aws2Wrap"},{"note":"","wrong":"","symbol":"ProcessError","correct":"from aws2-wrap import ProcessError"}],"quickstart":{"code":"from aws2-wrap import Aws2Wrap\n\n# Use with AWS SSO profile\naws = Aws2Wrap(profile='my-sso-profile')\n# Execute an AWS CLI command\nresult = aws.run(['s3', 'ls'])\nprint(result.stdout)","lang":"python","description":"Basic usage: instantiate Aws2Wrap with an AWS SSO profile and run AWS CLI commands."},"warnings":[{"fix":"Install AWS CLI v2 separately via official instructions.","message":"The AWS CLI v2 must be installed and in PATH. aws2-wrap does not bundle it.","severity":"gotcha","affected_versions":"all"},{"fix":"Run `aws sso login --profile <profile-name>` before using aws2-wrap.","message":"The profile must already have valid SSO credentials cached (e.g., from `aws sso login`).","severity":"gotcha","affected_versions":"all"},{"fix":"Use `from aws2-wrap import Aws2Wrap` instead of calling the command-line tool.","message":"The previous CLI-style usage via `aws2-wrap` command may be removed or changed in future versions. Prefer the Python API.","severity":"deprecated","affected_versions":"<2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install aws2-wrap` in the correct Python environment.","cause":"The package is not installed or installed in a different environment.","error":"ModuleNotFoundError: No module named 'aws2-wrap'"},{"fix":"Use `aws2-wrap --profile <profile-name> <command>` or use the Python API with profile parameter.","cause":"Missing profile argument when using CLI tool.","error":"aws2-wrap: error: argument --profile: expected one argument"},{"fix":"Run `aws sso login --profile <profile-name>` and try again.","cause":"The SSO token is expired or not cached.","error":"The SSO session associated with this profile is invalid. Please run 'aws sso login'."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}