Pyjo.AWS.Credentials.Environment - Credentials of the environment¶
from Pyjo.AWS.Credentials.Environment import Environment
credentials = Environment().credentials()
# Or import the module, as in Google Python Style Guide
import Pyjo.AWS.Credentials.Environment
credentials = Pyjo.AWS.Credentials.Environment.new().credentials()
Pyjo.AWS.Credentials.Environment is the provider of the credentials
of the environment variables AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
and AWS_SESSION_TOKEN, with AWS_CREDENTIAL_EXPIRATION and
AWS_ACCOUNT_ID, as AWS Lambda, the OIDC of GitHub Actions and
aws configure export-credentials set them. An empty variable is none, and
an access key without its secret is an error.
See also¶
Classes¶
- class Pyjo.AWS.Credentials.Environment.Pyjo_AWS_Credentials_Environment(*, ua: Pyjo_UserAgent | None = None, refresh: float = 300)[source]¶
Pyjo.AWS.Credentials.Environmentinherits all attributes and methods fromPyjo.AWS.Credentials.Providerand implements the following new ones.- async fetch() Pyjo_AWS_Credentials | None[source]¶
credentials = await provider.fetch()
The credentials of the environment, or
NonewithoutAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY.