[{"data":1,"prerenderedAt":70},["ShallowReactive",2],{"pattern-cdk-fargate-s3":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":13,"deploy":15,"description":19,"extension":20,"framework":21,"gitHub":22,"highlight":6,"introBox":31,"language":39,"level":40,"meta":41,"patternArch":42,"resources":55,"s3URL":6,"services":63,"stem":64,"testing":65,"videoId":30,"__hash__":69},"patterns\u002Fpatterns\u002Fcdk-fargate-s3.json","AWS Fargate to Amazon S3",null,{"headline":8,"text":9},"Cleanup",[10,11,12],"1. Delete the stack: \u003Ccode>npx cdk destroy\u003C\u002Fcode>.","2. Confirm the stack has been deleted: \u003Ccode>aws cloudformation list-stacks --query \"StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus\"\u003C\u002Fcode>.","3. You see a message confirming DELETE_COMPLETE.",[14],"content\u002Fcontributors\u002Fglenn-chia-jin-wee.json",{"text":16},[17,18],"npm install","cdk deploy","Create an AWS Fargate service that reads and writes to S3","json","AWS CDK",{"template":23,"payloads":28},{"projectFolder":24,"repoURL":25,"templateURL":26,"templateFile":27},"fargate-s3-cdk","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Ffargate-s3-cdk","serverless-patterns\u002Ffargate-s3-cdk","cdk\u002Flib\u002Fcdk-stack.ts",[29],{"headline":30,"payloadURL":30},"",{"headline":32,"text":33},"How it works",[34,35,36,37,38],"This project contains a sample AWS Cloud Development Kit (AWS CDK) template for deploying an AWS Fargate service running on an Amazon Elastic Container Service (ECS) cluster with an Application Load Balancer in-front.","The AWS Fargate service has endpoints that provide examples to list and get objects from a bucket and put objects into a bucket. This template uses a custom image without having to pre-push the image to Amazon Elastic Container Registry (ECR) or another container library.","This makes use of the in-built ecs.ContainerImage.fromAsset method. The custom image has a base route \u002F for health checks, \u002Fputobject for adding objects, \u002Fgetobject for retrieving the contents of a specified object, and \u002Flistobjects for listing all the files in a bucket. Environment variables like the the S3 bucket name and AWS region are passed to the image to enable it to put items to the S3 bucket.","This project also shows how to set up a S3 Gateway Endpoint to the VPC and configure additional bucket policies that require actions to come from the S3 Gateway Endpoint. This is in addition to the built-in grantReadWrite that CDK provides.","To learn more, see the GitHub repo.","TypeScript","200",{},{"icon1":43,"icon2":48,"line1":52},{"x":44,"y":45,"service":46,"label":47},20,50,"fargate","AWS Fargate",{"x":49,"y":45,"service":50,"label":51},80,"s3","S3",{"from":53,"to":54,"label":30},"icon1","icon2",{"headline":56,"bullets":57},"Additional resources",[58,60],{"text":47,"link":59},"https:\u002F\u002Faws.amazon.com\u002Ffargate\u002F",{"text":61,"link":62},"S3 to Lambda patterns","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fs3-to-lambda-patterns",{"from":46,"to":50},"patterns\u002Fcdk-fargate-s3",{"headline":66,"text":67},"Testing",[68],"See the GitHub repo for detailed testing instructions.","87AhuGsyl3eE26enpO1p2GoloMKYWX9TKem52GwI8AA",1778846883540]