aws-credentials-imds
This package provides an EC2 instance metadata (IMDSv2) credential resolver and chain provider.
Installation
uv pip install aws-credentials-imds
Once installed, the provider registers itself with the SDK's modular credential chain. When a client resolves credentials through the default chain, it will attempt to fetch credentials from the EC2 Instance Metadata Service when running on an EC2 instance, unless a higher-precedence source resolves credentials first.
Client Configuration
To use this resolver explicitly, set the aws_credentials_identity_resolver
property on a service client's config to an IMDSCredentialsResolver instance:
from aws_credentials_imds import IMDSCredentialsResolver
service_client = ServiceClient(
config=ServiceClientConfig(
aws_credentials_identity_resolver=IMDSCredentialsResolver(),
)
)
Endpoint mode, token TTL, and other options can be customized through an
IMDSConfig:
from aws_credentials_imds import IMDSConfig, IMDSCredentialsResolver
resolver = IMDSCredentialsResolver(
config=IMDSConfig(endpoint_mode="IPv6", token_ttl=300),
)
Standalone
The resolver can also be used on its own to fetch credentials directly:
import asyncio
from aws_credentials_imds.aio import AsyncIMDSCredentialsResolver
async def main() -> None:
resolver = AsyncIMDSCredentialsResolver()
identity = await resolver.get_identity(properties={})
asyncio.run(main())
Metadata
Release files for aws-credentials-imds 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aws_credentials_imds-0.5.0.tar.gz | 10.9 kB | Without provenance | Details for aws_credentials_imds-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aws_credentials_imds-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for aws_credentials_imds-0.5.0-py3-none-any.whl |
Total release size: 26.5 kB
Release files / aws_credentials_imds-0.5.0.tar.gz
| Download URL | aws_credentials_imds-0.5.0.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5df03b83665d43d07664052af99cfe9431e7b0553240abdd7f1afe0a59a33c25
|
|
BLAKE2b-256 checksum How to use checksums |
1ada3ffb826c0a550481cbc8191ee8edbfc5b431950e1f76683e539e4736d089
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / aws_credentials_imds-0.5.0-py3-none-any.whl
| Download URL | aws_credentials_imds-0.5.0-py3-none-any.whl |
|---|---|
| Size | 15.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d29135af774b7e4fa0b92d918d1859094c53e8fe575673739e7a953350f2c2f8
|
|
BLAKE2b-256 checksum How to use checksums |
020c373ed8b463cb6b22749aa549995cd7ba5ce6ee36553399e1b7003a872e1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for aws-credentials-imds 0.5.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.