-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement file set (video) download route
- Loading branch information
Showing
24 changed files
with
14,841 additions
and
2,308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nodejs 16.14.0 | ||
java corretto-19.0.1.10.1 | ||
aws-sam-cli 1.97.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
sam local start-lambda --host 0.0.0.0 --port 3005 --env-vars env.json --log-file lambda.log & lambda_pid=$! | ||
sam local start-api --host 0.0.0.0 --log-file dc-api.log & api_pid=$! | ||
docker run --rm -p 8083:8083 -e LAMBDA_ENDPOINT=http://172.17.0.1:3005/ amazon/aws-stepfunctions-local | ||
kill $api_pid $lambda_pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* istanbul ignore file */ | ||
const { getSignedUrl } = require("@aws-sdk/s3-request-presigner"); | ||
const { S3Client, GetObjectCommand } = require("@aws-sdk/client-s3"); | ||
|
||
module.exports.handler = async (event) => { | ||
|
||
console.log("PRESIGNED URL LAMBDA") | ||
console.log(event) | ||
|
||
const clientParams = {} | ||
|
||
const getObjectParams = { | ||
"Bucket": event.bucket, | ||
"Key": event.key | ||
} | ||
|
||
const client = new S3Client(clientParams); | ||
const command = new GetObjectCommand(getObjectParams); | ||
const url = await getSignedUrl(client, command, { expiresIn: 3600 }); | ||
|
||
console.log("url", url) | ||
|
||
return {downloadLink: url} | ||
|
||
}; | ||
|
||
|
Oops, something went wrong.