Download server/providers/aws/client.py from Vishvam10/cloudenv: direct link, hf CLI and curl.
- Browser
- Download file 498 Bytes
-
https://huggingface.co/spaces/Vishvam10/cloudenv/resolve/main/server/providers/aws/client.py
- Command line
-
hf download hf://spaces/Vishvam10/cloudenv/server/providers/aws/client.py
-
curl -L -o client.py https://huggingface.co/spaces/Vishvam10/cloudenv/resolve/main/server/providers/aws/client.py
498 Bytes
| import boto3 | |
| from botocore.config import Config | |
| ENDPOINT = "http://localhost:4566" | |
| # Avoid long hangs when ministack is down (tests / dev). | |
| _BOTO_CFG = Config( | |
| connect_timeout=3, | |
| read_timeout=30, | |
| retries={"max_attempts": 3, "mode": "standard"}, | |
| ) | |
| def get_client(service): | |
| return boto3.client( | |
| service, | |
| endpoint_url=ENDPOINT, | |
| aws_access_key_id="test", | |
| aws_secret_access_key="test", | |
| region_name="us-east-1", | |
| config=_BOTO_CFG, | |
| ) | |