mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-03-22 22:00:08 +00:00
23 lines
436 B
Python
23 lines
436 B
Python
import boto3
|
|
from botocore.exceptions import ClientError
|
|
|
|
BUCKET_NAME = "pocket-id-test"
|
|
|
|
|
|
def main() -> None:
|
|
s3 = boto3.client(
|
|
"s3",
|
|
endpoint_url="http://localhost:4566",
|
|
aws_access_key_id="test",
|
|
aws_secret_access_key="test",
|
|
region_name="us-east-1",
|
|
)
|
|
|
|
try:
|
|
s3.head_bucket(Bucket=BUCKET_NAME)
|
|
except ClientError:
|
|
s3.create_bucket(Bucket=BUCKET_NAME)
|
|
|
|
|
|
main()
|