Emulating Lambda to speed up development. Kevin Epstein CTO CorpInfo AWS Premier Partner

Similar documents
Amazon Web Services. Block 402, 4 th Floor, Saptagiri Towers, Above Pantaloons, Begumpet Main Road, Hyderabad Telangana India

AWS Solutions Architect Associate (SAA-C01) Sample Exam Questions

SAA-C01. AWS Solutions Architect Associate. Exam Summary Syllabus Questions

AWS Solution Architect Associate

At Course Completion Prepares you as per certification requirements for AWS Developer Associate.

PrepAwayExam. High-efficient Exam Materials are the best high pass-rate Exam Dumps

Amazon Web Services (AWS) Solutions Architect Intermediate Level Course Content

Amazon Web Services (AWS) Training Course Content

Amazon Web Services Training. Training Topics:

How can you implement this through a script that a scheduling daemon runs daily on the application servers?

Introduction to Cloud Computing

Training on Amazon AWS Cloud Computing. Course Content

ActiveNET. #202, Manjeera Plaza, Opp: Aditya Park Inn, Ameerpetet HYD

High School Technology Services myhsts.org Certification Courses

LINUX, WINDOWS(MCSE),

About Intellipaat. About the Course. Why Take This Course?

Enroll Now to Take online Course Contact: Demo video By Chandra sir

Serverless Computing. Redefining the Cloud. Roger S. Barga, Ph.D. General Manager Amazon Web Services

AWS_SOA-C00 Exam. Volume: 758 Questions

AWS Administration. Suggested Pre-requisites Basic IT Knowledge

Network Security & Access Control in AWS

AWS 101. Patrick Pierson, IonChannel

How to go serverless with AWS Lambda

KillTest *KIJGT 3WCNKV[ $GVVGT 5GTXKEG Q&A NZZV ]]] QORRZKYZ IUS =K ULLKX LXKK [VJGZK YKX\OIK LUX UTK _KGX

AWS Solution Architect (AWS SA)

Immersion Day. Getting Started with AWS Lambda. August Rev

AWS Course Syllabus. Linux Fundamentals. Installation and Initialization:

Containers or Serverless? Mike Gillespie Solutions Architect, AWS Solutions Architecture

Cloud Computing. Amazon Web Services (AWS)

Certificate of Registration

AWS Lambda: Event-driven Code in the Cloud

Monitoring Serverless Architectures in AWS

AWS Well Architected Framework

Amazon AWS-Solution-Architect-Associate Exam

Cloud Computing /AWS Course Content

AWS Certifications. Columbus Amazon Web Services Meetup - February 2018

Building a Microservices Platform, Patterns and Best Practices

HPE Digital Learner AWS Certified SysOps Administrator (Intermediate) Content Pack

ARCHITECTING WEB APPLICATIONS FOR THE CLOUD: DESIGN PRINCIPLES AND PRACTICAL GUIDANCE FOR AWS

Microservices on AWS. Matthias Jung, Solutions Architect AWS

Design Patterns for the Cloud. MCSN - N. Tonellotto - Distributed Enabling Platforms 68

Amazon Search Services. Christoph Schmitter

BERLIN. 2015, Amazon Web Services, Inc. or its affiliates. All rights reserved

AWS IoT Overview. July 2016 Thomas Jones, Partner Solutions Architect

CPM. Quick Start Guide V2.4.0

AWS Agility + Splunk Visibility = Cloud Success. Splunk App for AWS Demo. Laura Ripans, AWS Alliance Manager

Store, Protect, Optimize Your Healthcare Data in AWS

MONITORING SERVERLESS ARCHITECTURES

2013 AWS Worldwide Public Sector Summit Washington, D.C.

Microservices Architekturen aufbauen, aber wie?

CLOUD AND AWS TECHNICAL ESSENTIALS PLUS

AWS Solutions Architect Exam Tips

Building a Modular and Scalable Virtual Network Architecture with Amazon VPC

Werden Sie ein Teil von Internet der Dinge auf AWS. AWS Enterprise Summit 2015 Dr. Markus Schmidberger -

We are ready to serve Latest IT Trends, Are you ready to learn? New Batches Info

DevOps Tooling from AWS

Introduction to cloud computing

AWS: Basic Architecture Session SUNEY SHARMA Solutions Architect: AWS

PRAGMATIC SECURITY AUTOMATION FOR CLOUD

Getting Started with AWS Security

AWS Certified Solutions Architect - Associate 2018 (SAA-001)

Amazon Web Services Course Outline

Amazon Web Services 101 April 17 th, 2014 Joel Williams Solutions Architect. Amazon.com, Inc. and its affiliates. All rights reserved.

8/3/17. Encryption and Decryption centralized Single point of contact First line of defense. Bishop

AWS London Loft: CloudFormation Workshop

Introduction to AWS GoldBase. A Solution to Automate Security, Compliance, and Governance in AWS

AWS Lambda in (a bit of) theory and in action. Adam Smolnik

AWS Lambda. 1.1 What is AWS Lambda?

Accenture Cloud Platform Serverless Journey

What is Cloud Computing? What are the Private and Public Clouds? What are IaaS, PaaS, and SaaS? What is the Amazon Web Services (AWS)?

The Orion Papers. AWS Solutions Architect (Associate) Exam Course Manual. Enter

Gabriel Villa. Architecting an Analytics Solution on AWS

Serverless Architecture Hochskalierbare Anwendungen ohne Server. Sascha Möllering, Solutions Architect

Serverless Architectures with AWS Lambda. David Brais & Udayan Das

PracticeDump. Free Practice Dumps - Unlimited Free Access of practice exam

What s New at AWS? A selection of some new stuff. Constantin Gonzalez, Principal Solutions Architect, Amazon Web Services

Pass4test Certification IT garanti, The Easy Way!

Netflix OSS Spinnaker on the AWS Cloud

TestkingPass. Reliable test dumps & stable pass king & valid test questions

Amazon. Exam Questions AWS-Certified-Solutions-Architect- Professional. AWS-Certified-Solutions-Architect-Professional.

What s New at AWS? looking at just a few new things for Enterprise. Philipp Behre, Enterprise Solutions Architect, Amazon Web Services

EC2 and VPC Deployment Guide

Video on Demand on AWS

Understanding Perimeter Security

CPM Quick Start Guide V2.2.0

Securing Serverless Architectures

Minfy MS Workloads Use Case

PARTLY CLOUDY DESIGN & DEVELOPMENT OF A HYBRID CLOUD SYSTEM

FAST TRACK YOUR AMAZON AWS CLOUD TECHNICAL SKILLS. Enterprise Website Hosting with AWS

MyIGW Main. Oregon. MyVPC /16. MySecurityGroup / us-west-2b. Type Port Source SSH /0 HTTP

Amazon AWS-Solutions-Architect-Professional Exam

Diving into AWS Lambda

Manage AWS Services. Cost, Security, Best Practice and Troubleshooting. Principal Software Engineer. September 2017 Washington, DC

VMware Cloud on AWS. A Closer Look. Frank Denneman Senior Staff Architect Cloud Platform BU

Splunk & AWS. Gain real-time insights from your data at scale. Ray Zhu Product Manager, AWS Elias Haddad Product Manager, Splunk

Startups and Mobile Apps on AWS. Dave Schappell, Startup Business Development Manager, AWS September 11, 2013

Scaling on AWS. From 1 to 10 Million Users. Matthias Jung, Solutions Architect

Level Up Your CF Apps with Amazon Web Services

Automate best practices and operational health for your AWS resources with Trusted Advisor and AWS Health

Confluence Data Center on the AWS Cloud

Transcription:

Emulating Lambda to speed up development Kevin Epstein CTO CorpInfo AWS Premier Partner

What is Lambda? Scalable, Highly Available, Stateless, event driven computing Fully managed runtime environment Python Node.js Java

Why emulate Lambda? Lambda functions are usually relatively small, discreet pieces of code, so why emulate Lambda? So what? Just because Lambda functions are small pieces of code doesn t mean we should treat this code any differently to any other. Test your Lambda code locally. Automate testing - Integrate with your CI/CD Not a completely foreign idea to emulate AWS Services. DynamoDB has a local environment for testing too.

But I can test my Lambda locally sort of #!/usr/bin/python def lambda_handler(event, context): # Lambda execution entry point print "Hello World!" if name == ' main ': # Local testing entry point print "Hello World!"

But I can test my Lambda locally sort of The problem with this approach is we don t fully test Lambda functionality. Passing events to the Lambda function aren t easily testing. Context cannot be testing. Doesn t test IAM Packaging your code and uploading becomes painful quickly! http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html http://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html

Emulambda Emulabda is an opensource project that attempts to emulate the Lamdba environment as closely as possible. Test your Lambda locally without packaging and deploying to AWS Lambda. Shorten your feedback loops on lambda execution Some basic execution profiling. Supports IAM Lambda Execution Roles pip install -e git+https://github.com/fugue/emulambda#egg=emulambda

A practical example Development of a simple Amazon Alexa Skill If you want your skill published in the Skills portal, you need to test, test, test! Every interaction is called an Intent Every time you add new intents you have to resubmit for approval Skills can have lots of intents they all need to be tested. We want to make sure we get expected responses We want to evaluate the session state of the skill. Pair BATS (Bash Automated TestingSystem) with Emulambda

Using Emulambda to test an Alexa Skills Demo

Configuring a Lambda Function to Access Resources in an Amazon VPC Punitha Atluru Cloud Engineer CorpInfo AWS Premier Partner

Introduction AWS service resources, such as Redshift, ElastiCache, RDS or any other services running on EC2 instances are created inside Amazon Virtual Private Cloud (Amazon VPC) so that they cannot be directly accessed over the public Internet. Lambda functions are deployed outside of any VPC by default, restricting access to the private resources. Lambda function might require Internet access to fetch resources from public internet and inject into AWS services that don't have VPC endpoints, such as Amazon Kinesis or RDS

What To Do? VPC-specific configuration information (VPC subnet IDs and security group IDs) must be provided in order to enable your Lambda function to access resources inside your private VPC. AWS Lambda uses this information to set up elastic network interfaces (ENIs) that enable your function to connect securely to other resources within your private VPC. Note: Lambda function execution role must have permissions to create ENIs. AWS Lambda provides a predefined/managed policy, AWSLambdaVPCAccessExecutionRole giving the function access to CloudWatch Logs, and ec2 ENI related permissions

Problem ENI's attached to a Lambda functions do not get Elastic IP's. So even if we were to deploy the Lambda ENI into the public subnet, the function will not be able to reach the internet because the default route in a public subnet is the Internet Gateway.

Solution If your Lambda function needs access to private resources and Internet, choose to deploy the Lambda function in private subnets that have NAT (NAT instance or an Amazon VPC NAT gateway) as a default route to reach internet.

GOTCHA s Consider provisioning dedicated private subnets for your lambda functions. Especially if you anticipate very high concurrency a /24 subnet can only support 254 concurrent lambda executions. /23 would support 510 concurrent lambda executions, etc. Dedicated subnets for Lambda also gives you some protections. You have greater control over what the function can communicate with. You can leverage both NACL s and SG s. If you put your lambda function in the same subnet as your database, you cannot use NACL s. Reference security groups not IP s to give lambda functions access. The security group governing RDS should have a rule that references the security group-id of the lambda function.

CloudWatch Events

CloudWatch Events New Service announced in January 2016 Near real-time stream of system events that describe changes in Amazon Web Services Comprised of three main components Events Based on resource state changes Rules Match events to targets for processing Targets Process events and are specified in the rules (Current supported targets are SNS topics, SQS queues, Kinesis steams, Lambda functions, and built-in targets

Demo Demo Time Demonstrate an event (new instance being launched) Rules matches a new instance being run Target is a Lambda function which adds tags to the new instance

Use Cases Scheduled Execution of Lambda scripts (such as for EBS volume backups) Watching EC2 health to trigger functions to take corrective actions Lambda function that can debug application Public to SNS topic to notify a distribution list Public to SQS queue to inspect health-check statuses Publish autoscaling events to CloudWatch logs using Lambda

Relaunch Instance in 5 Minutes Rick Winkler Lead Solutions Architect CorpInfo AWS Premier Partner

Relaunch Instance in 5 Minutes Need to modify instance after it has launched? IAM Role Dedicated Host Subnets Etc? Creating an AMI from snapshots takes too long?

Relaunch Instance in 5 Minutes Overview Source Instance New Instance EBS Volumes

Relaunch Instance in 5 Minutes DEMO

Relaunch Instance in 5 Minutes Repository: https://github.com/corpinfo/relaunch_with_disks