[{"data":1,"prerenderedAt":64},["ShallowReactive",2],{"pattern-s3-upload-presignedurl-api-cdk-ts":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":15,"extension":16,"framework":17,"gitHub":18,"highlight":6,"introBox":24,"language":29,"level":30,"meta":31,"patternArch":32,"resources":51,"s3URL":6,"services":6,"stem":59,"testing":60,"videoId":6,"__hash__":63},"patterns\u002Fpatterns\u002Fs3-upload-presignedurl-api-cdk-ts.json","Amazon API Gateway and AWS Lambda to generate Amazon S3 pre-signed URLS",null,{"text":8},[9],"Delete the stack: \u003Ccode>cdk destroy\u003C\u002Fcode>.",[11],"content\u002Fcontributors\u002Fjerome-van-der-linden.json",{"text":13},[14],"cdk deploy","Secured REST API that expose a Lambda function to generate S3 pre-signed URLs","json","AWS CDK",{"template":19},{"repoURL":20,"templateURL":21,"projectFolder":22,"templateFile":23},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fs3-upload-presignedurl-api-cdk-ts","serverless-patterns\u002Fs3-upload-presignedurl-api-cdk-ts","s3-upload-presignedurl-api-cdk-ts","lib\u002Fs3-upload-presignedurl-api-cdk-stack.ts",{"headline":25,"text":26},"How it works",[27,28],"Web and mobile applications often provide their users ability to upload files, documents or pictures. A good and now common practice is to upload them directly to Amazon S3, using pre-signed URLs. To generate this pre-signed URL, you have to use the AWS SDK (generally in an AWS Lambda function), and expose the feature to the client through an API (with Amazon API Gateway).","The infrastructure deployed by this pattern contains an API Gateway REST API, exposing a Lambda function that will generate the S3 pre-signed URL and return it to the client. The API, the Lambda function and the S3 bucket handle CORS headers so that there is no error on the client side. The API is protected by a Cognito User Pool.","TypeScript","300",{},{"icon1":33,"icon2":38,"icon3":41,"line1":45,"line2":49},{"x":34,"y":35,"service":36,"label":37},20,50,"apigw","API Gateway",{"x":35,"y":35,"service":39,"label":40},"lambda","Lambda",{"x":42,"y":35,"service":43,"label":44},80,"s3","S3",{"from":46,"to":47,"label":48},"icon1","icon2","",{"from":47,"to":50,"label":48},"icon3",{"bullets":52},[53,56],{"text":54,"link":55},"S3 Presigned URLs documentation","https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002FPresignedUrlUploadObject.html",{"text":57,"link":58},"Blog post on S3 pre-signed URLs","https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fcompute\u002Fuploading-to-amazon-s3-directly-from-a-web-or-mobile-application\u002F ","patterns\u002Fs3-upload-presignedurl-api-cdk-ts",{"text":61},[62],"See the GitHub repo for detailed testing instructions.","2CBXusO3_Y-iV0SV0vh-_wIYlOmBoTXTx3qCUdOfmmY",1779273339037]