1"use strict";(self.webpackChunkjreact_com_docsaurus_01=self.webpackChunkjreact_com_docsaurus_01||[]).push([[2429],{4365:(e,n,s)=>{s.d(n,{W:()=>c});var a=s(6540),t=s(502);const i=["zero","one","two","few","many","other"];function r(e){return i.filter((n=>e.includes(n)))}const o={locale:"en",pluralForms:r(["one","other"]),select:e=>1===e?"one":"other"};function l(){const{i18n:{currentLocale:e}}=(0,t.A)();return(0,a.useMemo)((()=>{try{return function(e){const n=new Intl.PluralRules(e);return{locale:e,pluralForms:r(n.resolvedOptions().pluralCategories),select:e=>n.select(e)}}(e)}catch(n){return console.error(`Failed to use Intl.PluralRules for locale "${e}".\nDocusaurus will fallback to the default (English) implementation.\nError: ${n.message}\n`),o}}),[e])}function c(){const e=l();return{selectMessage:(n,s)=>function(e,n,s){const a=e.split("|");if(1===a.length)return a[0];a.length>s.pluralForms.length&&console.error(`For locale=${s.locale}, a maximum of ${s.pluralForms.length} plural forms are expected (${s.pluralForms.join(",")}), but the message contains ${a.length}: ${e}`);const t=s.select(n),i=s.pluralForms.indexOf(t);return a[Math.min(i,a.length-1)]}(s,n,e)}}},7170:(e,n,s)=>{s.d(n,{A:()=>f});s(6540);var a=s(4164),t=s(7936),i=s(7634),r=s(4365),o=s(5242),l=s(9979),c=s(4861);const d={cardContainer:"cardContainer_fWXF",cardTitle:"cardTitle_rnsV",cardDescription:"cardDescription_PWke"};var h=s(4848);function m(e){let{href:n,children:s}=e;return(0,h.jsx)(i.A,{href:n,className:(0,a.A)("card padding--lg",d.cardContainer),children:s})}function x(e){let{href:n,icon:s,title:t,description:i}=e;return(0,h.jsxs)(m,{href:n,children:[(0,h.jsxs)(c.A,{as:"h2",className:(0,a.A)("text--truncate",d.cardTitle),title:t,children:[s," ",t]}),i&&(0,h.jsx)("p",{className:(0,a.A)("text--truncate",d.cardDescription),title:i,children:i})]})}function j(e){let{item:n}=e;const s=(0,t.Nr)(n),a=function(){const{selectMessage:e}=(0,r.W)();return n=>e(n,(0,l.T)({message:"1 item|{count} items",id:"theme.docs.DocCard.categoryDescription.plurals",description:"The default description for a category card in the generated index about how many items this category includes"},{count:n}))}();return s?(0,h.jsx)(x,{href:s,icon:"\ud83d\uddc3\ufe0f",title:n.label,description:n.description??a(n.items.length)}):null}function u(e){let{item:n}=e;const s=(0,o.A)(n.href)?"\ud83d\udcc4\ufe0f":"\ud83d\udd17",a=(0,t.cC)(n.docId??void 0);return(0,h.jsx)(x,{href:n.href,icon:s,title:n.label,description:n.description??a?.description})}function g(e){let{item:n}=e;switch(n.type){case"link":return(0,h.jsx)(u,{item:n});case"category":return(0,h.jsx)(j,{item:n});default:throw new Error(`unknown item type ${JSON.stringify(n)}`)}}function p(e){let{className:n}=e;const s=(0,t.$S)();return(0,h.jsx)(f,{items:s.items,className:n})}function f(e){const{items:n,className:s}=e;if(!n)return(0,h.jsx)(p,{...e});const i=(0,t.d1)(n);return(0,h.jsx)("section",{className:(0,a.A)("row",s),children:i.map(((e,n)=>(0,h.jsx)("article",{className:"col col--6 margin-bottom--lg",children:(0,h.jsx)(g,{item:e})},n)))})}},8453:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>o});var a=s(6540);const t={},i=a.createContext(t);function r(e){const n=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),a.createElement(i.Provider,{value:n},e.children)}},8893:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>x,frontMatter:()=>l,metadata:()=>a,toc:()=>h});const a=JSON.parse('{"id":"aws/aws-lambda/triggering-lambda-functions","title":"Triggering Lambda Functions","description":"Lambda integrates with other AWS services to invoke functions.","source":"@site/docs/aws/aws-lambda/triggering-lambda-functions.mdx","sourceDirName":"aws/aws-lambda","slug":"/aws/aws-lambda/triggering-lambda-functions","permalink":"/docs/aws/aws-lambda/triggering-lambda-functions","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":8,"frontMatter":{"sidebar_position":8},"sidebar":"tutorialSidebar","previous":{"title":"Lambda","permalink":"/docs/aws/aws-lambda"},"next":{"title":"Examples","permalink":"/docs/aws/aws-lambda/examples"}}');var t=s(4848),i=s(8453),r=s(7170),o=s(3304);const l={sidebar_position:8},c="Triggering Lambda Functions",d={},h=[{value:"Asynchronous (Event-based) Invocations",id:"asynchronous-event-based-invocations",level:3},{value:"Synchronous (Push-based) Invocations",id:"synchronous-push-based-invocations",level:3},{value:"Poll-based Invocations",id:"poll-based-invocations",level:3}];function m(e){const n={a:"a",code:"code",em:"em",h1:"h1",h3:"h3",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"triggering-lambda-functions",children:"Triggering Lambda Functions"})}),"\n",(0,t.jsxs)(n.p,{children:["Lambda integrates with other AWS services to invoke functions.",(0,t.jsx)("br",{}),"\nLambda function is the code and runtime that process events. ",(0,t.jsx)("br",{}),"\nTrigger is the AWS service or application which generates events that invoke the function."]}),"\n",(0,t.jsxs)(n.p,{children:["Lambda functions can be invoked manually by using the Lambda API - ",(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"asynchronously"})})," and ",(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"synchronously"})}),", or ",(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Lambda polls the supported services"})})," on your behalf and runs your functions."]}),"\n",(0,t.jsx)("br",{}),"\n",(0,t.jsx)(n.h3,{id:"asynchronous-event-based-invocations",children:"Asynchronous (Event-based) Invocations"}),"\n",(0,t.jsx)("img",{src:"/img/aws/lambda/asynchronous-invocation-01.png",alt:"asynchronous-invocation-01.png"}),"\n",(0,t.jsx)("br",{}),"\n",(0,t.jsx)(n.p,{children:"Here is an example of an asynchronous invoke using the CLI:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"\naws lambda invoke \u2014function-name MyLambdaFunction \u2014invocation-type Event \u2014payload \u201c[JSON string here]\u201d\n"})}),"\n",(0,t.jsx)(n.p,{children:"The following is a list of AWS services that invoke Lambda functions asynchronously:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-cloudwatchevents.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon EventBridge (CloudWatch Events)"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/with-sns.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon Simple Notification Service (SNS)"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon Simple Storage Service (S3)"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-config.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"AWS Config"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-cloudwatchlogs.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon CloudWatch Logs"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-ses.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon Simple Email Service (SES)"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-iot.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"AWS IoT"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-iotevents.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"AWS IoT Events"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-cloudformation.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"AWS CloudFormation"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-codecommit.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"AWS CodeCommit"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-codepipeline.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"AWS CodePipeline"})})})}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"synchronous-push-based-invocations",children:"Synchronous (Push-based) Invocations"}),"\n",(0,t.jsx)("img",{src:"/img/aws/lambda/synchronous-invocation-01.png",alt:"synchronous-invocation-01.png"}),"\n",(0,t.jsx)("br",{}),"\n",(0,t.jsx)(n.p,{children:"Here is an example of a synchronous invoke using the CLI:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"\naws lambda invoke \u2014function-name MyLambdaFunction \u2014invocation-type RequestResponse \u2014payload \u201c[JSON string here]\u201d\n"})}),"\n",(0,t.jsx)(n.p,{children:"The following is a list of AWS services that invoke Lambda functions synchronously:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon API Gateway"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Elastic Load Balancing (Application Load Balancer)"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon CloudFront (Lambda@Edge)"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-kinesisfirehose.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon Kinesis Data Firehose"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-cognito.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon Cognito"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-s3-batch.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon Simple Storage Service Batch"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/with-secrets-manager.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Secrets Manager"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-alexa.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon Alexa"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-lex.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon Lex"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-connect.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon Connect"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/services-vpc-lattice.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon VPC L
1attice"})})})}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"poll-based-invocations",children:"Poll-based Invocations"}),"\n",(0,t.jsx)("img",{src:"/img/aws/lambda/polling-invocation-01.png",alt:"polling-invocation-01.png"}),"\n",(0,t.jsx)("br",{}),"\n",(0,t.jsx)(n.p,{children:"The following are polling-based services:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon Simple Queue Service (SQS)"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon MQ"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon DynamoDB Streams"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon Kinesis"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Amazon Managed Streaming for Apache Kafka (MSK)"})})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html",children:(0,t.jsx)(n.em,{children:(0,t.jsx)(n.strong,{children:"Self-managed Apache Kafka"})})})}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)("br",{}),"\n",(0,t.jsx)("br",{}),"\n","\n",(0,t.jsx)(r.A,{items:(0,o.$S)().items})]})}function x(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(m,{...e})}):m(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.