--- id: pymongo-auth-aws version: "1.3.0" license: Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) license_treatment: permissive maintenance: active --- # pymongo-auth-aws — MONGODB-AWS authentication support for PyMongo License: permissive · Maintenance: active · Downloads: 2.2M/mo ## What it is and what it does pymongo-auth-aws is a plugin that extends PyMongo's authentication capabilities to support AWS IAM-based credentials. It bridges PyMongo and AWS by using boto3 and botocore to obtain temporary security tokens and pass them to MongoDB's MONGODB-AWS authentication mechanism. This allows applications running on AWS (EC2, Lambda, ECS, etc.) or with AWS credentials configured locally to authenticate to MongoDB Atlas or self-hosted MongoDB instances without managing long-lived database passwords. The package is designed as a drop-in extension: once installed, you specify `authMechanism=MONGODB-AWS` in your MongoDB connection string, and pymongo-auth-aws handles credential retrieval and token generation transparently. It supports CPython 3.8+ and PyPy 3.7+, and is actively maintained by MongoDB. Use it for: - Authenticate Lambda functions or ECS tasks to MongoDB using their IAM roles without embedding database credentials. - Connect EC2 instances to MongoDB Atlas using temporary AWS STS tokens instead of static passwords. - Enable local development with AWS IAM credentials by leveraging boto3's credential chain (environment variables, config files, or IAM roles). - Simplify credential rotation in applications by relying on AWS IAM's built-in token expiration and refresh. - Integrate MongoDB authentication into AWS-native applications that already use boto3 for other AWS services. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Enables PyMongo to authenticate to MongoDB using AWS Identity and Access Management (IAM) credentials via the MONGODB-AWS authentication mechanism. Yes. Install this if you are using PyMongo with MongoDB Atlas or MongoDB instances that support MONGODB-AWS authentication and you want to authenticate using AWS IAM credentials. It has low install friction, is actively maintained, carries no known vulnerabilities, and is licensed permissively. The only prerequisite is that you have AWS credentials available in your environment. ## Install pip install pymongo-auth-aws uv add pymongo-auth-aws poetry add pymongo-auth-aws ## Installing pymongo-auth-aws Before you install: Low install friction with a pure-Python wheel distribution. Actively maintained as of 2026-08-14 with recent commits; no known vulnerabilities. License in practice: Apache License 2.0 is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install pymongo-auth-aws import pymongo_auth_aws from pymongo import MongoClient client = MongoClient('mongodb+srv://@/?authMechanism=MONGODB-AWS') Requires boto3 and botocore to be installed; AWS credentials must be available in the environment (via IAM role, environment variables, or AWS config file). Verify before relying: - Whether the package works with all PyMongo versions or requires a specific version range. - Whether AWS credentials must be configured in the environment or if they can be passed programmatically. ## Package facts - License: Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags mongodb aws authentication, pymongo iam credentials, mongodb-aws auth, aws iam mongodb driver, pymongo aws iam, mongodb authentication aws, boto3 mongodb auth, aws-iam, mongodb-auth [View on SkillFed](https://skillfed.io/packages/pymongo-auth-aws) · [View on PyPI](https://pypi.org/project/pymongo-auth-aws/)