github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/processors/lambda.md (about) 1 --- 2 title: lambda 3 type: processor 4 status: deprecated 5 categories: ["Integration"] 6 --- 7 8 <!-- 9 THIS FILE IS AUTOGENERATED! 10 11 To make changes please edit the contents of: 12 lib/processor/lambda.go 13 --> 14 15 import Tabs from '@theme/Tabs'; 16 import TabItem from '@theme/TabItem'; 17 18 :::warning DEPRECATED 19 This component is deprecated and will be removed in the next major version release. Please consider moving onto [alternative components](#alternatives). 20 ::: 21 22 Invokes an AWS lambda for each message. The contents of the message is the 23 payload of the request, and the result of the invocation will become the new 24 contents of the message. 25 26 27 <Tabs defaultValue="common" values={[ 28 { label: 'Common', value: 'common', }, 29 { label: 'Advanced', value: 'advanced', }, 30 ]}> 31 32 <TabItem value="common"> 33 34 ```yaml 35 # Common config fields, showing default values 36 label: "" 37 lambda: 38 parallel: false 39 function: "" 40 region: eu-west-1 41 ``` 42 43 </TabItem> 44 <TabItem value="advanced"> 45 46 ```yaml 47 # All config fields, showing default values 48 label: "" 49 lambda: 50 parallel: false 51 function: "" 52 rate_limit: "" 53 region: eu-west-1 54 endpoint: "" 55 credentials: 56 profile: "" 57 id: "" 58 secret: "" 59 token: "" 60 role: "" 61 role_external_id: "" 62 timeout: 5s 63 retries: 3 64 ``` 65 66 </TabItem> 67 </Tabs> 68 69 ## Alternatives 70 71 This processor has been renamed to [`aws_lambda`](/docs/components/processors/aws_lambda). 72 73 It is possible to perform requests per message of a batch in parallel by setting 74 the `parallel` flag to `true`. The `rate_limit` 75 field can be used to specify a rate limit [resource](/docs/components/rate_limits/about) 76 to cap the rate of requests across parallel components service wide. 77 78 In order to map or encode the payload to a specific request body, and map the 79 response back into the original payload instead of replacing it entirely, you 80 can use the [`branch` processor](/docs/components/processors/branch). 81 82 ### Error Handling 83 84 When all retry attempts for a message are exhausted the processor cancels the 85 attempt. These failed messages will continue through the pipeline unchanged, but 86 can be dropped or placed in a dead letter queue according to your config, you 87 can read about these patterns [here](/docs/configuration/error_handling). 88 89 ### Credentials 90 91 By default Benthos will use a shared credentials file when connecting to AWS 92 services. It's also possible to set them explicitly at the component level, 93 allowing you to transfer data across accounts. You can find out more 94 [in this document](/docs/guides/cloud/aws). 95 96 ## Examples 97 98 <Tabs defaultValue="Branched Invoke" values={[ 99 { label: 'Branched Invoke', value: 'Branched Invoke', }, 100 ]}> 101 102 <TabItem value="Branched Invoke"> 103 104 105 This example uses a [`branch` processor](/docs/components/processors/branch/) to map a new payload for triggering a lambda function with an ID and username from the original message, and the result of the lambda is discarded, meaning the original message is unchanged. 106 107 ```yaml 108 pipeline: 109 processors: 110 - branch: 111 request_map: '{"id":this.doc.id,"username":this.user.name}' 112 processors: 113 - lambda: 114 function: trigger_user_update 115 ``` 116 117 </TabItem> 118 </Tabs> 119 120 ## Fields 121 122 ### `parallel` 123 124 Whether messages of a batch should be dispatched in parallel. 125 126 127 Type: `bool` 128 Default: `false` 129 130 ### `function` 131 132 The function to invoke. 133 134 135 Type: `string` 136 Default: `""` 137 138 ### `rate_limit` 139 140 An optional [`rate_limit`](/docs/components/rate_limits/about) to throttle invocations by. 141 142 143 Type: `string` 144 Default: `""` 145 146 ### `region` 147 148 The AWS region to target. 149 150 151 Type: `string` 152 Default: `"eu-west-1"` 153 154 ### `endpoint` 155 156 Allows you to specify a custom endpoint for the AWS API. 157 158 159 Type: `string` 160 Default: `""` 161 162 ### `credentials` 163 164 Optional manual configuration of AWS credentials to use. More information can be found [in this document](/docs/guides/cloud/aws). 165 166 167 Type: `object` 168 169 ### `credentials.profile` 170 171 A profile from `~/.aws/credentials` to use. 172 173 174 Type: `string` 175 Default: `""` 176 177 ### `credentials.id` 178 179 The ID of credentials to use. 180 181 182 Type: `string` 183 Default: `""` 184 185 ### `credentials.secret` 186 187 The secret for the credentials being used. 188 189 190 Type: `string` 191 Default: `""` 192 193 ### `credentials.token` 194 195 The token for the credentials being used, required when using short term credentials. 196 197 198 Type: `string` 199 Default: `""` 200 201 ### `credentials.role` 202 203 A role ARN to assume. 204 205 206 Type: `string` 207 Default: `""` 208 209 ### `credentials.role_external_id` 210 211 An external ID to provide when assuming a role. 212 213 214 Type: `string` 215 Default: `""` 216 217 ### `timeout` 218 219 The maximum period of time to wait before abandoning an invocation. 220 221 222 Type: `string` 223 Default: `"5s"` 224 225 ### `retries` 226 227 The maximum number of retry attempts for each message. 228 229 230 Type: `int` 231 Default: `3` 232 233