[{"data":1,"prerenderedAt":68},["ShallowReactive",2],{"pattern-cdk-fargate-dynamodb":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":37,"level":38,"meta":39,"patternArch":40,"resources":53,"s3URL":6,"services":61,"stem":62,"testing":63,"videoId":30,"__hash__":67},"patterns\u002Fpatterns\u002Fcdk-fargate-dynamodb.json","AWS Fargate to Amazon DynamoDB",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 puts to DynamoDB","json","AWS CDK",{"template":23,"payloads":28},{"projectFolder":24,"repoURL":25,"templateURL":26,"templateFile":27},"fargate-dynamodb-cdk","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Ffargate-dynamodb-cdk","serverless-patterns\u002Ffargate-dynamodb-cdk","cdk\u002Flib\u002Fcdk-stack.ts",[29],{"headline":30,"payloadURL":30},"",{"headline":32,"text":33},"How it works",[34,35,36],"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 makes puts to a DynamoDB table. 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 and \u002Fadditem for adding items. Environment variables like the DynamoDB table name and AWS region are passed to the image to enable it to put items to the DynamoDB table.","Node.js","200",{},{"icon1":41,"icon2":46,"line1":50},{"x":42,"y":43,"service":44,"label":45},20,50,"fargate","AWS Fargate",{"x":47,"y":43,"service":48,"label":49},80,"dynamodb","Amazon DynamoDB",{"from":51,"to":52,"label":30},"icon1","icon2",{"headline":54,"bullets":55},"Additional resources",[56,58],{"text":45,"link":57},"https:\u002F\u002Faws.amazon.com\u002Ffargate\u002F",{"text":59,"link":60},"Creating a single-table design with Amazon DynamoDB","https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fcompute\u002Fcreating-a-single-table-design-with-amazon-dynamodb\u002F",{"from":44,"to":48},"patterns\u002Fcdk-fargate-dynamodb",{"headline":64,"text":65},"Testing",[66],"See the GitHub repo for detailed testing instructions.","G890aj7r-Qdaci9gCdRmSkaqj6hkzjaUbfEgQSubu8o",1778846883532]