is there a way to read a .ini configuration file from s3 without downloading it?
What I have tried:
config.ini:
[DEFAULT]
test = test1
test1 = test2
[ME]
me = you
you = he
code:
import boto3
import io
import configparser
s3_boto = boto3.client('s3')
configuration_file_bucket = "mybucket"
configuration_file_key = "config.ini"
obj = s3_boto.get_object(Bucket=configuration_file_bucket, Key=configuration_file_key)
config = configparser.ConfigParser()
config.read(io.BytesIO(obj['Body'].read()))
It returns [].
I have tried to make sure that
obj['Body'].read()
is returning well a binary with content of config.ini. This is working. It breaks somewhere further.