Skip to main content

boto3auth

CircleCI PyPI version

boto3auth is a simple (Python 3) wrapper for starting clients/resources with Boto3.

Installation

Requires boto3.

pip install boto3auth

Usage

import boto3auth

b3a = boto3auth.Boto3Auth(region, account_id, role, sts)

Properties:

  • region: AWS region (e.g. us-east-1, ca-central-1, etc.)
    • Defaults to us-east-1, if not set.
  • account_id: AWS account number (if assuming role)
  • role: AWS IAM role (if assuming role)
  • sts: Boto3 STS credentials (if assuming a secondary role)

Auth

b3a.auth(resource, type)

Arguments:

  • resource: AWS resource (e.g. ec2, dynamodb, sqs, etc.)
  • type: Boto3 Session type (resource or client)

boto3auth will use local AWS credentials (works well with aws-vault).

import boto3auth

# EC2 resource in us-east-1, with local credentials.
b3a = boto3auth.Boto3Auth()
resource = b3a.auth('ec2')

# DynamoDB resource in us-west-2, with assumed role.
b3a = boto3auth.Boto3Auth('us-west-2', '123412341234', 'my-cool-role')
resource = b3a.auth('dynamodb', 'resource')

# EC2 client in ca-central-1 that requires two assumed roles.
# e.g. Local -> Account #1 -> Account #2
first = boto3auth.Boto3Auth('ca-central-1', '123412341234', 'first-role')
first.creds() # creds() runs sts.AssumeRole and sets result to self.sts.

second = boto3auth.Boto3Auth('ca-central-1', '456745674567', 'second-role', first.sts)
client = second.auth('ec2', 'client')

Metadata

Release files for boto3auth 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for boto3auth 1.2.0
File Size Uploaded Provenance Actions
boto3auth-1.2.0.tar.gz 2.4 kB Without provenance Details for boto3auth-1.2.0.tar.gz

Release files / boto3auth-1.2.0.tar.gz

Download URL boto3auth-1.2.0.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1cb773b39a4b6a16800f604171af36b89ba3340c8320db35c82427d1ea52677c
BLAKE2b-256 checksum
How to use checksums
39438b9236db19ed75a88e9389241e12114c082b98461a0551642e73dc4c7bdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Security for boto3auth 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page