Код: Выделить всё
[profile my_profile]
output = json
region = us-east-1
role_arn = arn:aws:iam::yyyyyyyyyyyy:role/my_awesome_role
[profile my_profile_exec]
output = json
region = us-east-1
role_arn = arn:aws:iam::xxxxxxxxxxxx:role/my_awesome_role
source_profile = my_profile
При создании учетных данных (
Код: Выделить всё
aws_access_key_idПосле всего этого, когда я запускаю команду AWS CLI: aws s3 ls --profile=my_profile_exec, я получаю правильный результаты.
В чистом Python соединение также работает и выглядит так (сокращенно):
Код: Выделить всё
>>> session = boto3.Session(profile_name=my_profile_exec)
>>> s3_client = session.client("s3")
>>> # do stuff with s3_client
Код: Выделить всё
D LOAD httpfs;
D CREATE SECRET secret (
TYPE S3,
PROVIDER CREDENTIAL_CHAIN,
CHAIN 'config',
PROFILE 'my_profile_exec');
|----------|
| Success |
| boolean |
|----------|
| true |
|-----------|
D SELECT * FROM read_csv(s3://bucket/path/to/file);
HTTP Error: HTTP GET error on 'https://bucket/path/to/file' (HTTP 400)
Вот мой среда. Если кто-то может помочь, мы будем очень признательны:
- MacOS 15.2
- MacBook Pro, 2021 г., Apple M1 Pro
- duckdb --version = 1.1.3 19864453f7
- aws-cli/2.13.29 Python/3.11.6 Darwin/24.2.0 exe/x86_64 приглашение/отключение
- Python 3.13.1
- boto3 = 1.35.97
- botocore = 1.35.97
- duckdb = 1.1.3
Подробнее здесь: https://stackoverflow.com/questions/793 ... redentials
Мобильная версия