I'm using the following way to create a botoclient
def create_boto_client(self, service_name: str):
return boto3.session.Session().client(
service_name=service_name
)
# or I can do: return boto3.client(service_name)
How I could set the "metadata_service_timeout" and "metadata_service_num_attempts" values?
I need to specify them, because otherwise boto can fail to fetch credentials in IAM role from Metadata server.
I read in doc that it's possible to specify this value like this:
# ~/.aws/config
[default]
metadata_service_timeout = 5.0
metadata_service_num_attempts = 10
but I don't have an ability to add this file to instance.