[Solved] Scan of data of a specific column in DynamoDB table – Reserved Keyword [closed]

Sometimes there is a need for everyone to use DynamoDB’s reserved keyword names on their attribute names. In such cases, they can utilize the expression attribute names to map the reserved keyword name with another alternative name. You can use the expression attribute names in your code as like below: … response = table.scan( ExpressionAttributeNames … Read more

[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 case, adding a required events tag should solve your problem. … functions: smartHome: handler: ${file(./${env:DEPLOY_FILE_NAME_STAGE}):handler} … Read more

[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 call to ec2_resource.instances.all() retrieves a list of all instances, and there is a state attribute … Read more

[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 the following example to add the file to the default classpath: classpath files(…) // without … Read more