Skip to content

Commit 5eecb74

Browse files
committed
Update SAM template and function code
1 parent 4e11128 commit 5eecb74

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

lambda-s3-download/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Lambda S3 Download
1+
# AWS Lambda to Amazon S3 — URL File Downloader
22

3-
This pattern deploys a Lambda function that downloads a file from a URL and uploads it to an S3 bucket using multipart upload. It streams the file in configurable chunks through `/tmp`, making it capable of handling files larger than Lambda's memory and storage limits.
3+
This pattern deploys an AWS Lambda function that downloads a file from a URL and stores it in Amazon S3 using multipart upload. It streams the file in configurable chunks through `/tmp`, making it capable of handling files larger than Lambda's memory and storage limits.
44

55
Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example.
66

@@ -93,6 +93,6 @@ Optional event parameters:
9393
aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"
9494
```
9595
----
96-
Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
96+
Copyright 2026 Amazon.com, Inc. or its affiliates. All Rights Reserved.
9797

9898
SPDX-License-Identifier: MIT-0

lambda-s3-download/example-pattern.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"title": "Lambda S3 Download",
3-
"description": "A Lambda function that downloads a file from a URL and uploads it to S3 using multipart upload with SHA256 checksums.",
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.",
44
"language": "Python",
55
"level": "300",
66
"framework": "SAM",
77
"introBox": {
88
"headline": "How it works",
99
"text": [
10-
"This pattern deploys a Lambda function that streams a file from a URL and uploads it to an S3 bucket using multipart upload.",
10+
"This pattern deploys an AWS Lambda function that streams a file from a URL and stores it in Amazon S3 using multipart upload.",
1111
"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.",
1212
"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."
1313
]

lambda-s3-download/src/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def lambda_handler(event, context):
4949
return {
5050
"statusCode": 200,
5151
"body": json.dumps({
52-
"message": f"{download_filename} uploaded successfully",
52+
"message": f"{download_filename} downloaded and stored successfully",
5353
"bucket": target_bucket,
5454
"key": download_filename,
5555
"checksum_sha256": objectSummary["Checksum"]["ChecksumSHA256"],

lambda-s3-download/template.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AWSTemplateFormatVersion: '2010-09-09'
22
Transform: AWS::Serverless-2016-10-31
3-
Description: Lambda function that downloads a file from a URL and uploads it to S3 using multipart upload
3+
Description: AWS Lambda function that downloads a file from a URL and stores it in Amazon S3 using multipart upload
44

55
Parameters:
66
TargetBucketName:
@@ -14,8 +14,6 @@ Resources:
1414
Handler: app.lambda_handler
1515
Runtime: python3.12
1616
CodeUri: src/
17-
Architectures:
18-
- arm64
1917
Timeout: 900
2018
MemorySize: 1024
2119
EphemeralStorage:
@@ -29,5 +27,5 @@ Resources:
2927

3028
Outputs:
3129
DownloadFunctionArn:
32-
Description: Lambda function ARN
30+
Description: Serverless Downloader Lambda function ARN
3331
Value: !GetAtt DownloadFunction.Arn

0 commit comments

Comments
 (0)