Skip to content
This repository was archived by the owner on Sep 16, 2025. It is now read-only.

Conversation

@rromanchuk
Copy link

Theres no point in initializing the client like this, and super annoying in real world for people that don't pass keys. You get all these for free. The config is overloading these well-known environment var to manually pass through a signature.

It's also asserting NoCredentialsError(), which makes debugging super confusing because it's not even true, let aws raise that error.

AWS_ACCESS_KEY_ID
The access key for your AWS account.

AWS_SECRET_ACCESS_KEY
The secret key for your AWS account.

AWS_SESSION_TOKEN
The session key for your AWS account. This is only needed when you are using temporary credentials. The AWS_SECURITY_TOKEN environment variable can also be used, but is only supported for backward-compatibility purposes. AWS_SESSION_TOKEN is supported by multiple AWS SDKs in addition to Boto3.

AWS_DEFAULT_REGION
The default AWS Region to use, for example, us-west-1 or us-west-2.

AWS_PROFILE
The default profile to use, if any. If no value is specified, Boto3 attempts to search the shared credentials file and the config file for the default profile.

AWS_CONFIG_FILE
The location of the config file used by Boto3. By default this value is ~/.aws/config. You only need to set this variable if you want to change this location.

AWS_SHARED_CREDENTIALS_FILE
The location of the shared credentials file. By default this value is ~/.aws/credentials. You only need to set this variable if you want to change this location.

BOTO_CONFIG
The location of the Boto2 credentials file. This is not set by default. You only need to set this variable if you want to use credentials stored in Boto2 format in a location other than /etc/boto.cfg or ~/.boto.

AWS_CA_BUNDLE
The path to a custom certificate bundle to use when establishing SSL/TLS connections. Boto3 includes a CA bundle that it uses by default, but you can set this environment variable to use a different CA bundle.

AWS_METADATA_SERVICE_TIMEOUT
The number of seconds before a connection to the instance metadata service should time out. When attempting to retrieve credentials on an Amazon EC2 instance that is configured with an IAM role, a connection to the instance metadata service will time out after 1 second by default. If you know you’re running on an EC2 instance with an IAM role configured, you can increase this value if needed.

AWS_METADATA_SERVICE_NUM_ATTEMPTS
When attempting to retrieve credentials on an Amazon EC2 instance that has been configured with an IAM role, Boto3 will make only one attempt to retrieve credentials from the instance metadata service before giving up. If you know your code will be running on an EC2 instance, you can increase this value to make Boto3 retry multiple times before giving up.

AWS_DATA_PATH
A list of additional directories to check when loading botocore data. You typically don’t need to set this value. There are two built-in search paths: <botocoreroot>/data/ and ~/.aws/models. Setting this environment variable indicates additional directories to check first before falling back to the built-in search paths. Multiple entries should be separated with the os.pathsep character, which is : on Linux and ; on Windows.

AWS_STS_REGIONAL_ENDPOINTS
Sets AWS STS endpoint resolution logic. See the sts_regional_endpoints configuration file section for more information on how to use this.

AWS_MAX_ATTEMPTS
The total number of attempts made for a single request. For more information, see the max_attempts configuration file section.

AWS_RETRY_MODE
Specifies the types of retries the SDK will use. For more information, see the retry_mode configuration file section.

AWS_SDK_UA_APP_ID
AppId is an optional application specific identifier that can be set. When set it will be appended to the User-Agent header of every request in the form of App/{AppId}.

AWS_SIGV4A_SIGNING_REGION_SET
A comma-delimited list of regions to sign when signing with SigV4a. For more information, see the sigv4a_signing_region_set configuration file section.

AWS_REQUEST_CHECKSUM_CALCULATION
Determines when a checksum will be calculated for request payloads. For more information, see the request_checksum_calculation configuration file section.

AWS_RESPONSE_CHECKSUM_VALIDATION
Determines when checksum validation will be performed on response payloads. For more information, see the response_checksum_validation configuration file section.

Updated import statement for upload_file_to_s3.
Fix import path for upload_file_to_s3
annoying
Removed AWS access key environment variable retrieval.
Removed AWS access key and secret access key retrieval from environment variables.
Removed AWS access key and secret access key from Bedrock and S3 client initialization.
let boto raise, dont obfuscate details
@dvejsada
Copy link
Owner

dvejsada commented Sep 5, 2025

Thanks. However, due to lack of time, this repo will no longer be maintained and will be archived. Feel free to take over with your fork.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants