2016 Utah Cloud Summit: AWS Lambda and API Gateway

Download 2016 Utah Cloud Summit: AWS Lambda and API Gateway

Post on 07-Jan-2017

329 views

Category:

Technology

0 download

Embed Size (px)

TRANSCRIPT

<p>PowerPoint Presentation</p> <p>LambdaJordan Farrer, 1Strategy</p> <p>2016, 1Strategy, All rights reserved</p> <p>1</p> <p>What is Lambda?Event-driven managed compute serviceStateless code execution, no affinity to underlying infrastructureAnnounced November 2014</p> <p>2</p> <p>Benefits of LambdaRun code without managing serversInfinitely scalableBuilt-in high availabilityPay only for what you useZero administration</p> <p>Sample Scenario</p> <p>The Traditional Approach</p> <p>Availability Zone</p> <p>Availability Zone</p> <p>Auto Scaling groupAuto Scaling group</p> <p>The Traditional Approach - ResponsibilitiesApplication CodeInfrastructure ProvisioningOS patchingSecurityServer bootstrappingCode deploymentMonitoringScaling (manual or autoscaling)Fault Tolerance/High Availability</p> <p>The Lambda Solution</p> <p>The Lambda Solution - ResponsibilitiesApplication Code</p> <p>Function Basics</p> <p>CodePermissionsEvent</p> <p>9</p> <p>Lambda Function CodeExecution EnvironmentRuns on Amazon LinuxAWS SDK included by defaultAvailable RuntimesNode.jsPython 2.7Java 8Bring your own librariesNative library support</p> <p>Lambda Function PermissionsIAM RoleBest Practice: Never hardcode username/password or Access/Secret keysSpecify granular permissions for each function to other AWS resourcesS3DynamoDBKinesisComing Soon: VPC</p> <p>Lambda Event SourcesS3</p> <p>Kinesis</p> <p>DynamoDB</p> <p>SNS</p> <p>SES</p> <p>CloudWatch Logs</p> <p>CloudFormation</p> <p>Scheduled</p> <p>Alexa Skills Kit</p> <p>12</p> <p>Lambda MonitoringBuilt in to LambdaCloudWatch MetricsInvocation CountDurationError RateLogs recorded to CloudWatch Logs</p> <p>Demo: Lambda</p> <p>Create EC2 instances firstCreate IAM RoleCreate Lambda functionDemo CloudWatch 14</p> <p>Example Use Case:Security Group Change Notifications</p> <p>http://www.1strategy.com/blog/security-group-change-notifications/</p> <p>15</p> <p>Lambda PricingPricing based on memory allocation and number of requestsCPU, network I/O, disk I/O determined by memory allocationBilled in 100ms incrementsNo hourly, daily, or monthly minimumsFree Tier400,000 GB-seconds every month</p> <p>16</p> <p>Sample Cost Comparison AssumptionsSample Scenario1 million requests1 second processing time per requestHighly-Available</p> <p>Sample Cost ComparisonUsing EC22x t2.micro$0.013/hour * 750 hoursTotal: $19.50</p> <p>Using Lambda1,000,000 requestsFirst million requests are free1,000,000 GB-seconds400,000 GB-seconds are free600,000 * $0.000001667 per 100msTotal: $10</p> <p>18</p> <p>API Gateway</p> <p>API Gateway OverviewCreate, publish, maintain, monitor and secure APIsWorks with EC2, Lambda, or any web application as the backendPay only for what you use</p> <p>API Gateway and LambdaBuilt-in controls for throttlingAutomatic monitoring through CloudWatchAPI VersioningUsing LambdaAPI Gateway becomes an Event Source</p> <p>21</p> <p>Demo: API Gateway</p> <p>Thank You</p>