[{"data":1,"prerenderedAt":72},["ShallowReactive",2],{"content-svc-lambda-guides-cost-optimization-7-direct-integrations":3},{"markdown":4,"frontMatterAttributes":5,"bodyRaw":8,"menu":9,"menuType":64,"isCollapseableMenu":12,"nextDocItem":58,"previousDocItem":48,"contributorPaths":65,"contentName":71,"slug":57,"readingTime":31},"\u003Cp>You can save costs by using direct integrations between services to completely eliminate entire Lambda functions from your workloads.\u003C\u002Fp>\n\u003Cp>Many services including \u003Ca href=\"https:\u002F\u002Faws.amazon.com\u002Fapi-gateway\u002F\">API Gateway\u003C\u002Fa>, \u003Ca href=\"https:\u002F\u002Faws.amazon.com\u002Fappsync\u002F\">AWS AppSync\u003C\u002Fa>, \u003Ca href=\"https:\u002F\u002Faws.amazon.com\u002Fstep-functions\u002F\">AWS Step Functions\u003C\u002Fa>, and \u003Ca href=\"https:\u002F\u002Faws.amazon.com\u002Feventbridge\u002F\">Amazon EventBridge\u003C\u002Fa> can directly integrate with other services. If you notice that you have Lambda functions that only serve as a bridge to transfer data between services you should determine if you can replace the Lambda function with a direct integration.\u003C\u002Fp>\n\u003Cp>API Gateway enables you to \u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002Fapigateway\u002Flatest\u002Fdeveloperguide\u002Fapi-gateway-integration-settings-integration-request.html\">create integration requests\u003C\u002Fa> with other services.\u003C\u002Fp>\n\u003Cimg src=\"\u002Fassets\u002Fexternal\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002Fassets\u002Fdirect-01.png\"\u002F>\n\n\u003Cp>AWS Step Functions has direct integrations with over 220 AWS services and over 10,000 API calls. If you find that you are using Lambda as a proxy between your Step Functions workflow and another AWS service, it&#39;s possible that a direct SDK integration might be a better fit.\u003C\u002Fp>\n\u003Cp>Example SDK integration in a Step Functions workflow: \n\u003Cimg src=\"\u002Fassets\u002Fexternal\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002Fassets\u002Fdirect-02.png\"\u002F>\u003C\u002Fp>\n\u003Cp>Resources: \u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fserverless-applications-lens\u002Fdirect-integrations.html\">Direct Integrations\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fserverless-applications-lens\u002Fdirect-integrations.html\">Step Functions AWS SDK service integrations\u003C\u002Fa>\u003C\u002Fli>\n\u003C\u002Ful>\n",{"title":6,"order":7},"7. Use direct integrations",7,"You can save costs by using direct integrations between services to completely eliminate entire Lambda functions from your workloads.\n\nMany services including [API Gateway](https:\u002F\u002Faws.amazon.com\u002Fapi-gateway\u002F), [AWS AppSync](https:\u002F\u002Faws.amazon.com\u002Fappsync\u002F), [AWS Step Functions](https:\u002F\u002Faws.amazon.com\u002Fstep-functions\u002F), and [Amazon EventBridge](https:\u002F\u002Faws.amazon.com\u002Feventbridge\u002F) can directly integrate with other services. If you notice that you have Lambda functions that only serve as a bridge to transfer data between services you should determine if you can replace the Lambda function with a direct integration.\n\nAPI Gateway enables you to [create integration requests](https:\u002F\u002Fdocs.aws.amazon.com\u002Fapigateway\u002Flatest\u002Fdeveloperguide\u002Fapi-gateway-integration-settings-integration-request.html) with other services.\n\n\u003Cimg src=\"\u002Fassets\u002Fexternal\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002Fassets\u002Fdirect-01.png\"\u002F>\n\nAWS Step Functions has direct integrations with over 220 AWS services and over 10,000 API calls. If you find that you are using Lambda as a proxy between your Step Functions workflow and another AWS service, it's possible that a direct SDK integration might be a better fit.\n\nExample SDK integration in a Step Functions workflow: \n\u003Cimg src=\"\u002Fassets\u002Fexternal\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002Fassets\u002Fdirect-02.png\"\u002F>\n\nResources: \n - [Direct Integrations](https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fserverless-applications-lens\u002Fdirect-integrations.html)\n - [Step Functions AWS SDK service integrations](https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fserverless-applications-lens\u002Fdirect-integrations.html)\n",[10],{"title":11,"collapsible":12,"isCollapsed":12,"content":13},"Top 8 Optimizations",false,[14,21,28,35,42,48,54,58],{"title":15,"order":16,"time":17,"path":18,"id":19,"link":20},"1. Fine-tune Lambda power",1,"4 min","1-fine-tuning","1-fine-tuning.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F1-fine-tuning",{"title":22,"order":23,"time":24,"path":25,"id":26,"link":27},"2. Switch to Graviton2",2,"2 min","2-graviton","2-graviton.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F2-graviton",{"title":29,"order":30,"time":31,"path":32,"id":33,"link":34},"3. Fine-tune CloudWatch Logs",3,"1 min","3-cloudwatch","3-cloudwatch.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F3-cloudwatch",{"title":36,"order":37,"time":38,"path":39,"id":40,"link":41},"4. Don't pay for idle",4,"3 min","4-avoid-idle","4-avoid-idle.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F4-avoid-idle",{"title":43,"order":44,"time":17,"path":45,"id":46,"link":47},"5. Filter and batch events",5,"5-filter-and-batch","5-filter-and-batch.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F5-filter-and-batch",{"title":49,"order":50,"time":38,"path":51,"id":52,"link":53},"6. Set realistic timeouts",6,"6-set-timeouts","6-set-timeouts.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F6-set-timeouts",{"title":6,"order":7,"time":31,"path":55,"id":56,"link":57},"7-direct-integrations","7-direct-integrations.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F7-direct-integrations",{"title":59,"order":60,"time":31,"path":61,"id":62,"link":63},"8. Use CloudWatch embedded metric format",8,"8-emf","8-emf.md","\u002Fcontent\u002Fservice\u002Flambda\u002Fguides\u002Fcost-optimization\u002F8-emf","LIST",[66,67,68,69,70],"content\u002Fcontributors\u002Fdan-fox.json","content\u002Fcontributors\u002Fanton-aleksandrov.json","content\u002Fcontributors\u002Fjosh-kahn.json","content\u002Fcontributors\u002Fdhiraj-mahapatro.json","content\u002Fcontributors\u002Fvamsi-vikash-ankam.json","Cost Optimization for AWS Lambda",1792665272253]