Skip to content

Commit 337086f

Browse files
committed
Added ACL args to upload file.
1 parent 7dc35c9 commit 337086f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/copy_spec.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ def upload_to_s3(file_path: Path, bucket_name: str, folder_name: str):
1010
s3 = boto3.client("s3")
1111
key = f"apis/{folder_name}/{file_path}"
1212

13-
try:
14-
s3.upload_file(str(file_path), bucket_name, key)
13+
try:
14+
s3.upload_file(
15+
str(file_path),
16+
bucket_name,
17+
key,
18+
ExtraArgs={'ACL': 'bucket-owner-full-control'}
19+
)
1520
print(f"[OK] Uploaded → s3://{bucket_name}/apis/{key}")
1621
except ClientError as e:
1722
print(f"[ERROR] Upload failed: {file_path} → s3://{bucket_name}/{key}")

0 commit comments

Comments
 (0)