Example: quiz answers

AWS Lambda - Developer Guide

AWS LambdaDeveloper GuideAWS Lambda Developer GuideAWS Lambda : Developer GuideAWS Lambda Developer GuideTable of ContentsWhat Is AWS Lambda ? .. 1 When Should I Use AWS Lambda ? .. 1 Are You a First-time User of AWS Lambda ? .. 2 Getting Started .. 3 Create a Function .. 4 Use the 4 Invoke the Lambda Function .. 4 Code Editor .. 7 Working with Files and Folders .. 7 Working with Code .. 9 Working in Fullscreen Mode .. 12 Working with Preferences .. 12 AWS CLI .. 13 Prerequisites .. 13 Create the Execution Role .. 13 Create the Function .. 13 List the Lambda Functions in Your Account .. 16 Retrieve a Lambda Function .. 17 Clean 17 Concepts .. 18 Function .. 18 Event .. 18 Concurrency .. 18 Trigger .. 18 Features .. 20 Programming Model .. 21 Deployment Package .. 21 Function Blueprints .. 21 Application Templates .. 21 Layers .. 22 Tools .. 23 AWS Command Line Interface .. 23 AWS Serverless Application Model .. 23 SAM 23 Code Authoring Tools .. 25 Permissions .. 27 Execution Role.

AWS Lambda Developer Guide When Should I Use AWS Lambda? What Is AWS Lambda? AWS Lambda is a compute service that lets you run code without provisioning or managing servers. AWS Lambda executes your code only when needed and scales automatically, from a few requests per day

Tags:

  Developer, Guide, Lambda, Aws lambda developer guide, Aws lambda

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of AWS Lambda - Developer Guide

1 AWS LambdaDeveloper GuideAWS Lambda Developer GuideAWS Lambda : Developer GuideAWS Lambda Developer GuideTable of ContentsWhat Is AWS Lambda ? .. 1 When Should I Use AWS Lambda ? .. 1 Are You a First-time User of AWS Lambda ? .. 2 Getting Started .. 3 Create a Function .. 4 Use the 4 Invoke the Lambda Function .. 4 Code Editor .. 7 Working with Files and Folders .. 7 Working with Code .. 9 Working in Fullscreen Mode .. 12 Working with Preferences .. 12 AWS CLI .. 13 Prerequisites .. 13 Create the Execution Role .. 13 Create the Function .. 13 List the Lambda Functions in Your Account .. 16 Retrieve a Lambda Function .. 17 Clean 17 Concepts .. 18 Function .. 18 Event .. 18 Concurrency .. 18 Trigger .. 18 Features .. 20 Programming Model .. 21 Deployment Package .. 21 Function Blueprints .. 21 Application Templates .. 21 Layers .. 22 Tools .. 23 AWS Command Line Interface .. 23 AWS Serverless Application Model .. 23 SAM 23 Code Authoring Tools .. 25 Permissions .. 27 Execution Role.

2 28 Resource-based Policies .. 29 Granting Function Access to AWS Services .. 29 Granting Function Access to Other Accounts .. 30 Granting Layer Access to Other Accounts .. 31 Cleaning up Resource-based Policies .. 32 User Policies .. 33 Function Development .. 33 Layer Development and Use .. 36 Cross-Account Roles .. 37 Resources and Conditions .. 38 Functions .. 39 Event Source Mappings .. 40 Layers .. 41 Permissions Boundaries .. 42iiiAWS Lambda Developer GuideManaging Functions .. 44 Function Configuration .. 45 Reserved Concurrency .. 47 Configuring Concurrency with the Lambda API .. 47 Environment Variables .. 49 Setting Up .. 49 Rules for Naming Environment Variables .. 51 Environment Variables and Function Versioning .. 52 Environment Variable Encryption .. 52 Tutorial - Environment Variables .. 53 Tutorial - Encryption Helpers .. 54 Function Versions .. 56 Managing Versions with the Lambda API .. 57 Using Versions .. 58 Resource Policies .. 58 Function Aliases .. 59 Managing Aliases with the Lambda 59 Using 60 Resource Policies.

3 60 Alias Routing Configuration .. 60 Rolling Deployments .. 63 Example AWS SAM Lambda Template .. 63 Layers .. 65 Configuring a Function to Use Layers .. 65 Managing Layers .. 66 Including Library Dependencies in a Layer .. 68 Layer Permissions .. 69 VPC Settings .. 70 Execution Role and User Permissions .. 70 Configuring Amazon VPC Access with the Lambda API .. 70 Internet and Service Access for VPC-Connected Functions .. 71 Sample VPC 71 Tagging .. 72 Tagging Lambda Functions for Billing .. 72 Applying Tags to Lambda Functions Using the Console .. 72 Applying Tags to Lambda Functions Using the CLI .. 73 Filtering on Tagged Lambda Functions .. 73 Tag Restrictions .. 75 Accessing AWS Resources .. 76 Accessing AWS Services .. 76 Accessing non AWS Services .. 76 Accessing Private Services or Resources .. 76 Invoking Functions .. 78 Synchronous Invocation .. 79 Asynchronous Invocation .. 81 Dead Letter Queues .. 82 Event Source Mapping .. 84 Function Scaling .. 86 Error Handling.

4 87 Mobile SDK for Android .. 89 Tutorial .. 89 Sample 95 Lambda 97 Environment Variables .. 99 Execution Context .. 101 Runtime Support Policy .. 102 Custom 103ivAWS Lambda Developer GuideUsing a Custom 103 Building a Custom 103 Runtime Interface .. 106 Next Invocation .. 106 Invocation Response .. 107 Invocation Error .. 107 Initialization Error .. 107 Tutorial Custom Runtime .. 109 Prerequisites .. 109 Create a Function .. 109 Create a Layer .. 111 Update the Function .. 112 Update the 112 Share the Layer .. 113 Clean 113 Lambda 115 Manage 116 Monitoring 116 Custom Monitoring Dashboards .. 116 Tutorial Create an Application .. 119 Prerequisites .. 120 Create an Application .. 120 Invoke the Function .. 120 Add an AWS Resource .. 121 Update the Permissions Boundary .. 122 Update the Function Code .. 122 Next Steps .. 123 Troubleshooting .. 124 Clean 125 Sample Error Processor .. 126 Architecture and Event Structure .. 126 Instrumentation with AWS X-Ray.

5 127 AWS CloudFormation Template and Additional Resources .. 128 Use 130 Example 1: Amazon S3 Pushes Events and Invokes a Lambda Function .. 130 Example 2: AWS Lambda Pulls Events from a Kinesis Stream and Invokes a Lambda Function .. 131 Best Practices .. 133 Function Code .. 133 Function Configuration .. 134 Alarming and 134 Stream Event Invokes .. 135 Working with Other Services .. 136 Application Load Balancer .. 138 Alexa .. 140 Amazon API Gateway .. 141 Tutorial .. 142 Sample 151 Microservice Blueprint .. 153 Sample Template .. 154 AWS CloudTrail .. 156 Tutorial .. 157 Sample 162 CloudWatch Events .. 164 Tutorial .. 165 Sample Template .. 167 Schedule Expressions .. 168 Amazon CloudWatch Logs .. 170vAWS Lambda Developer GuideAWS CloudFormation .. 171 CloudFront .. 173 AWS CodeCommit .. 176 Prerequisites .. 176 Create an AWS CloudFormation Role .. 177 Set Up a Repository .. 178 Create a Pipeline .. 179 Update the Build Stage Role .. 180 Complete the Deployment Stage.

6 180 Test The Application .. 181 Amazon Cognito .. 182 AWS Config .. 183 Amazon DynamoDB .. 184 Execution Role Permissions .. 185 Configuring a Stream as an Event Source .. 185 Event Source Mapping APIs .. 186 Amazon CloudWatch Metrics .. 187 Tutorial .. 187 Sample 191 Sample Template .. 194 Amazon ElastiCache .. 196 Prerequisites .. 196 Create the Execution Role .. 196 Create an ElastiCache Cluster .. 197 Create a Deployment Package .. 197 Create the Lambda Function .. 198 Test the Lambda Function .. 198 Amazon EC2 .. 199 Permissions .. 199 Tutorial Spot Instances .. 200 AWS IoT Events .. 211 Configuring Your Data Stream and Function .. 212 Execution Role Permissions .. 212 Configuring a Stream as an Event Source .. 213 Event Source Mapping APIs .. 213 Amazon CloudWatch Metrics .. 214 Tutorial .. 214 Sample 218 Sample Template .. 221 Kinesis Data Firehose .. 223 Amazon Lex .. 224 Amazon RDS .. 225 Tutorial: Amazon RDS .. 225 Amazon S3 .. 229 Tutorial .. 230 Sample 236 Sample Template.

7 243 Amazon SES .. 244 Amazon SNS .. 246 Tutorial .. 247 Sample 249 Amazon SQS .. 252 Configuring a Queue for Use with 253 Execution Role Permissions .. 253 Configuring a Queue as an Event Source .. 254viAWS Lambda Developer GuideEvent Source Mapping APIs .. 186 Tutorial .. 255 Sample 258 Sample Template .. 261 Working with .. 264 Async Functions .. 264 Non-Async Functions .. 265 Deployment Package .. 266 Updating a Function with No Dependencies .. 266 Updating a Function with Additional Dependencies .. 267 Context .. 271 Viewing Logs in the AWS Management Console .. 272 Using the AWS CLI .. 272 Deleting 273 Errors .. 274 Tracing .. 276 Working with Python .. 279 Deployment Package .. 280 Prerequisites .. 280 Updating a Function with No Dependencies .. 280 Updating a Function with Additional Dependencies .. 281 With a Virtual Environment .. 282 Context .. 286 Errors .. 288 Function Error Handling .. 289 Tracing .. 291 Working with Ruby .. 294 Deployment Package.

8 295 Updating a Function with No Dependencies .. 296 Updating a Function with Additional Dependencies .. 296 Context .. 298 Errors .. 299 Working with Java .. 301 Deployment Package .. 302 Maven .. 302 Maven and Eclipse .. 304 Gradle and 306 Eclipse IDE and AWS SDK Plugin .. 310 Handler Overload Resolution .. 311 Additional Information .. 311 Handler Input/Output Types (Java) .. 311 Leveraging Predefined Interfaces for Creating Handler (Java) .. 316 Context .. 322 Custom Appender for Log4j 323 Errors .. 325 Function Error Handling .. 325 Tracing .. 327 Sample Function .. 329viiAWS Lambda Developer GuideWorking with Go .. 330 Deployment Package .. 331 Creating a Deployment Package on Windows .. 333 Using Global 334 Context .. 336 Accessing Invoke Context Information .. 338 Errors .. 340 Function Error Handling .. 289 Handling Unexpected Errors .. 341 Tracing .. 342 Installing the X-Ray SDK for Go .. 342 Configuring the X-Ray SDK for Go .. 342 Create a subsegment.

9 342 Capture .. 342 Tracing HTTP Requests .. 343 Environment Variables .. 344 Working with C# .. 345 Deployment Package .. Core CLI .. 346 AWS Toolkit for Visual Studio .. 352 Handling Streams .. 352 Handling Standard Data Types .. 352 Handler Signatures .. 353 Serializing Lambda Functions .. 354 Lambda Function Handler Restrictions .. 355 Using Async in C# Functions with AWS Lambda .. 355 Context .. 358 Errors .. 360 Function Error Handling .. 362 Working with PowerShell .. 364 Development Environment .. 365 Deployment Package .. 368 Returning Data .. 368 Context .. 370 Errors .. 373 Monitoring 374 Lambda 375 AWS Lambda CloudWatch Metrics .. 375 AWS Lambda CloudWatch Dimensions .. 377 Accessing CloudWatch Logs .. 378 Using AWS X-Ray .. 380 Tracing Lambda -Based Applications with AWS X-Ray .. 380 Emitting Trace Segments from a Lambda Function .. 382 The AWS X-Ray Daemon in the Lambda Environment .. 382 Using Environment Variables to Communicate with AWS X-Ray.

10 382 Lambda Traces in the AWS X-Ray Console: Examples .. 383 Using CloudTrail .. 385 AWS Lambda Information in CloudTrail .. 385 Understanding AWS Lambda Log File Entries .. 386viiiAWS Lambda Developer GuideUsing CloudTrail to Track Function Invocations .. 387 Security .. 388 Data Protection .. 388 Encryption in Transit .. 389 Encryption at Rest .. 389 Identity and Access Management .. 389 Audience .. 390 Authenticating With 390 Managing Access Using Policies .. 392 How AWS Lambda Works with IAM .. 393 Identity-Based Policy Examples .. 393 Troubleshooting .. 395 Compliance Validation .. 397 Resilience .. 397 Infrastructure Security .. 398 Configuration and Vulnerability Analysis .. 398 Troubleshooting .. 400 Deployments .. 400 Invocation .. 400 Releases .. 402 Earlier 406 API Reference .. 411 Actions .. 411 AddLayerVersionPermission .. 413 AddPermission .. 417 CreateAlias .. 421 CreateEventSourceMapping .. 425 CreateFunction .. 438 DeleteEventSourceMapping .. 440 DeleteFunction.


Related search queries