Skip to content

Commit 9b58569

Browse files
Create lambda-s3-download.json
1 parent f36eb59 commit 9b58569

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"title": "AWS Lambda to Amazon S3 — URL File Downloader",
3+
"description": "An AWS Lambda function that downloads a file from a URL and stores it in Amazon S3 using multipart upload with SHA256 checksums.",
4+
"language": "Python",
5+
"level": "300",
6+
"framework": "AWS SAM",
7+
"introBox": {
8+
"headline": "How it works",
9+
"text": [
10+
"This pattern deploys an AWS Lambda function that streams a file from a URL and stores it in Amazon S3 using multipart upload.",
11+
"The file is downloaded in configurable chunks (default 512 MB, clamped between 5 MB and 5 GB) and written to /tmp before being uploaded as individual parts. Each chunk is cleaned up from /tmp after upload, allowing the function to handle files larger than Lambda's memory or ephemeral storage limits.",
12+
"SHA256 checksums are calculated for each part and verified on completion. If any step fails, the multipart upload is automatically aborted to avoid orphaned parts."
13+
]
14+
},
15+
"gitHub": {
16+
"template": {
17+
"repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/lambda-s3-download",
18+
"templateURL": "serverless-patterns/lambda-s3-download",
19+
"projectFolder": "lambda-s3-download",
20+
"templateFile": "template.yaml"
21+
}
22+
},
23+
"resources": {
24+
"bullets": [
25+
{
26+
"text": "S3 Multipart Upload Overview",
27+
"link": "https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html"
28+
},
29+
{
30+
"text": "AWS Lambda - Configuring Ephemeral Storage",
31+
"link": "https://docs.aws.amazon.com/lambda/latest/dg/configuration-ephemeral-storage.html"
32+
}
33+
]
34+
},
35+
"deploy": {
36+
"text": [
37+
"sam build",
38+
"sam deploy --guided"
39+
]
40+
},
41+
"testing": {
42+
"text": [
43+
"See the GitHub repo for detailed testing instructions."
44+
]
45+
},
46+
"cleanup": {
47+
"text": [
48+
"Delete the stack: <code>sam delete</code>."
49+
]
50+
},
51+
"authors": [
52+
{
53+
"name": "Robert Meyer",
54+
"image": "",
55+
"bio": "Robert is a Partner Solutions Architect with AWS in EMEA.",
56+
"linkedin": "robert-meyer-phd-6a114a58",
57+
"twitter": "@robl_on_tour"
58+
}
59+
],
60+
"patternArch": {
61+
"icon1": {
62+
"x": 20,
63+
"y": 50,
64+
"service": "lambda",
65+
"label": "AWS Lambda"
66+
},
67+
"icon2": {
68+
"x": 80,
69+
"y": 50,
70+
"service": "s3",
71+
"label": "Amazon S3"
72+
},
73+
"line1": {
74+
"from": "icon1",
75+
"to": "icon2",
76+
"label": "Stream"
77+
}
78+
}
79+
}

0 commit comments

Comments
 (0)