- class Pyjo.AWS.Config.Pyjo_AWS_Config(*, profile: str | None = None, config_file: str | None = None, credentials_file: str | None = None)[source]¶
Pyjo.AWS.Configinherits all attributes and methods fromPyjo.Baseand implements the following new ones.- __init__(*, profile: str | None = None, config_file: str | None = None, credentials_file: str | None = None) None[source]¶
config = Pyjo.AWS.Config.new() config = Pyjo.AWS.Config.new(profile='dev', config_file='/etc/aws/config')
Construct a new
Pyjo.AWS.Configobject.
- __weakref__¶
list of weak references to the object
- config_file¶
path = config.config_file config.config_file = '/etc/aws/config'
The
Pyjo.Fileobject of the configuration file, defaults to the value of theAWS_CONFIG_FILEenvironment variable or~/.aws/config.
- credentials_file¶
path = config.credentials_file config.credentials_file = '/etc/aws/credentials'
The
Pyjo.Fileobject of the file of the credentials, defaults to the value of theAWS_SHARED_CREDENTIALS_FILEenvironment variable or~/.aws/credentials.
- endpoint_url(service: str, profile: str | None = None) str | None[source]¶
url = config.endpoint_url('S3') url = config.endpoint_url('SSO OIDC', 'dev')
The endpoint of a service of its ID, as
S3,LambdaorSSO OIDC, which the environment or a profile,profileby default, configures, orNone: the value of theAWS_ENDPOINT_URL_<SERVICE>environment variable, of the settingendpoint_urlof the service in the sectionservicesof the profile, ofAWS_ENDPOINT_URL, or of the settingendpoint_urlof the profile, unlessAWS_IGNORE_CONFIGURED_ENDPOINT_URLSor the settingignore_configured_endpoint_urlsistrue.
- explicit_profile¶
boolean = config.explicit_profile
Whether the profile is the one of the argument
profile, as of the option--profileof the AWS CLI, not of the environment, so thatPyjo.AWS.Credentials.Chaintakes the credentials of the profile, and not the ones of the environment, as botocore does.
- get(name: str, profile: str | None = None) Any[source]¶
value = config.get('role_arn') s3 = config.get('s3', 'dev')
The value of a setting of a profile,
profileby default, a string, or adictof the settings of its indented lines, orNone.
- has_profile(profile: str | None = None) bool[source]¶
boolean = config.has_profile('dev')
Whether a profile,
profileby default, is in one of the files.
- profile¶
name = config.profile config.profile = 'dev'
The name of the profile, defaults to the value of the
AWS_PROFILEenvironment variable, or ofAWS_DEFAULT_PROFILE, which the AWS CLI reads too, ordefault.
- profiles() list[str][source]¶
names = config.profiles()
The names of the profiles of both files, sorted.
- region(profile: str | None = None) str | None[source]¶
region = config.region() region = config.region('dev')
The region, of the value of the
AWS_REGIONenvironment variable, ofAWS_DEFAULT_REGION, or of the settingregionof a profile,profileby default, orNone.
- services(name: str) dict[str, Any][source]¶
services = config.services('local')
The settings of a section
[services name]of the configuration file, of a service of its ID in lower case, with_in the place of the spaces, assso_oidc, or an emptydict.