{"id":45126,"library":"iam-rolesanywhere-session","title":"IAM Roles Anywhere Session Creator","description":"Creates a boto3 session using IAM Roles Anywhere for authenticating workloads outside AWS with temporary credentials. Version 2.3.0 supports both synchronous and async session creation. Release cadence is irregular.","status":"active","version":"2.3.0","language":"python","source_language":"en","source_url":"https://github.com/aws-samples/iam-rolesanywhere-session","tags":["aws","iam","roles-anywhere","boto3"],"install":[{"cmd":"pip install iam-rolesanywhere-session","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"wrong":"from iam_rolesanywhere_session import IamRolesAnywhereSession","symbol":"IAMRolesAnywhereSession","correct":"from iam_rolesanywhere_session import IAMRolesAnywhereSession"}],"quickstart":{"code":"import os\nfrom iam_rolesanywhere_session import IamRolesAnywhereSession\n\nsession = IamRolesAnywhereSession(\n    profile_arn=os.environ.get('PROFILE_ARN', ''),\n    role_arn=os.environ.get('ROLE_ARN', ''),\n    trusted_anchor_arn=os.environ.get('TRUSTED_ANCHOR_ARN', ''),\n    certificate_arn=os.environ.get('CERTIFICATE_ARN', ''),\n    private_key=os.environ.get('PRIVATE_KEY', ''),\n    duration_seconds=3600,\n)\n\n# Get a boto3 client\ns3_client = session.get_client('s3')\nprint(s3_client.list_buckets())","lang":"python","description":"Create a session with IAM Roles Anywhere and get a boto3 client."},"warnings":[{"fix":"Install iam-rolesanywhere-session and change imports to use iam_rolesanywhere_session.","message":"Version 2.0 renamed the package from boto3-rolesanywhere-session to iam-rolesanywhere-session. Update imports and install commands.","severity":"breaking","affected_versions":"<2.0"},{"fix":"Use 'duration_seconds' instead of 'session_duration'.","message":"The parameter 'session_duration' was renamed to 'duration_seconds' in v2.0. Using the old name will raise an error.","severity":"deprecated","affected_versions":">=2.0"},{"fix":"Read the private key file contents and pass the string: open('key.pem').read().","message":"The private_key parameter expects the raw key string, not a file path. Passing a path will fail silently or cause authentication errors.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Ensure the certificate ARN references an ACM Private CA certificate.","message":"When providing a certificate via certificate_arn, the corresponding certificate must be stored in AWS Certificate Manager (ACM) Private CA, not self-managed.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Use asyncio.run() or ensure an event loop is running when creating the async session.","message":"Async session creation (AsyncIamRolesAnywhereSession) requires an event loop. Calling without an active loop will raise a RuntimeError.","severity":"breaking","affected_versions":">=2.0"}],"env_vars":null,"search_vec":"'2.3.0':23 'anywher':3,13,39 'async':28 'authent':15 'aw':18,35 'boto3':8,40 'cadenc':32 'creat':6 'creation':30 'creator':5 'credenti':21 'iam':1,11,36 'irregular':34 'outsid':17 'releas':31 'role':2,12,38 'roles-anywher':37 'session':4,9,29 'support':24 'synchron':26 'temporari':20 'use':10 'version':22 'workload':16","created_at":"2026-06-07T12:53:28.924937+00:00","updated_at":"2026-06-07T12:53:28.924937+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["security","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}