Tag aws-lambda

[Solved] serverless events are missing

You need to add events to your functions. Have a read through the serverless documentation for events. Currently serverless supports lambdas to be invoked by API GateWay, Kinesis, DynamoDB, S3, Schedule, SNS, and Alexa Skill. (read more) So in this…

[Solved] Count Running and Stopped Ec2 Instances with AWS Lambda

Here’s some code that retrieves a list of instances and count the number of stopped and running instances: import boto3 def lambda_handler(event, context): ec2_resource = boto3.resource(‘ec2’) instances = [instance.state[“Name”] for instance in ec2_resource.instances.all()] print(‘Running: ‘, instances.count(‘running’)) print(‘Stopped: ‘, instances.count(‘stopped’)) The…

[Solved] AWS Dev env setup with Gradle

The = operator invokes the set<Field> method in Groovy. This is the reason why the classpath of the runDynamoDB task only contains a single file. You should use the classpath(Object… paths) which appends to the classpath: Change the line to…