Lfs S3 Account | 1080p — HD |
Log into your AWS S3 account and create a bucket with the following settings:
Security Tip: Never make your LFS bucket public. Git LFS uses authentication tokens.
You need a user (or role) that can read and write to this bucket. lfs s3 account
Example IAM Policy:
"Version": "2012-10-17",
"Statement": [
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::my-company-lfs-bucket/*"
,
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::my-company-lfs-bucket"
]
Save the Access Key ID and Secret Access Key generated for this user. IAM Permission Headaches:
An LFS S3 Account typically involves:
awscli, s3cmd, or rclone installed inside the LFS chroot or final system.Configure concurrent transfers:
Example AWS CLI upload (for manual object upload):
Verbose debug for LFS:
Generate pre-signed URL in Python (boto3):
import boto3
s3 = boto3.client('s3')
url = s3.generate_presigned_url('put_object',
Params='Bucket': 'my-lfs-bucket', 'Key': key,
ExpiresIn=3600)
oid = "<sha256-hash>"
key = f"LFS_S3_PREFIX/oid[0:2]/oid[2:4]/oid"
s3.put_object(Bucket=LFS_S3_BUCKET, Key=key, Body=object_bytes)