I’ve created the dynamodb table using serverless.yml as below: But I’ve got this issue: An error occurred: myTable – One or more parameter values were invalid: Number of attributes in KeySchema does not exactly match number of attributes defined in AttributeDefinitions (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException; Request ID: PEI9OT7E72HQN4N5MQUOIUQ18JVV4KQNSO5AEMVJF66Q9ASUAAJG; Proxy: null). Could you help me creating the
Tag: aws-lambda
Extracting Parameters from POST Request in Python Lambda
Context: I’m trying to make a POST request to a AWS lambda function written in python from JavaScript. I will then enter the information in the POST request into a Database. Problem: I can’t seem to figure out how to get the information out of the POST request. and store it into variables. I’ve tried to use the event[‘Username’] which
ClientError: An error occurred (InternalFailure) when calling the Publish operation (reached max retries: 4)
I am simply trying to publish to an SNS topic using a lambda function. The function code as follows, with ARN being the actual SNS topic ARN: The function execution role as access to SNS. In fact I even gave SNS full access. But I keep getting the error: I do not find any access denied errors in cloudtrail either.
Unable to create AWS Lambda Deployment Package for ipopt, pyomo, cython
I’m trying to create an AWS Lambda Deployment Package, so I can use it as an AWS Lambda Layer. Specifically, I’m trying to use the ipopt sovler, in conjuction with the pyomo and cython. I can get the pyomo packaged without issue, but when I try to pip install ipopt for the package I get an error: I am trying
How to install external modules in a Python Lambda Function created by AWS CDK?
I’m using the Python AWS CDK in Cloud9 and I’m deploying a simple Lambda function that is supposed to send an API request to Atlassian’s API when an Object is uploaded to an S3 Bucket (also created by the CDK). Here is my code for CDK Stack: The lambda function code uses the requests module which I’ve imported. However, when
For loop is taking only the last element in the list
I am sorry for a simple question, but tried multiple options without any solution. he Problem I have is the for loop is taking only the last value in the list(Regions). This is the list and it takes only the last value It has to take all the values in the list(Regions) and display the result. But it takes only
How to describe snapshots by OwnerIds and Filters using boto3
How to describe snapshots owned by me and filtering by tag simultaneously? It describe snapshots owned by me with code below: But when I add “Filters”, its starts ignoring “OwnerIds” and filtering only by tag. I’m follow an official boto3 documentation: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.describe_snapshots Answer I think the Filters and OwnerIds options are working separately. I expect that the OwnerIds option is
Python boto3 SNS email formatting (each string in new line)
How to print each string in a new line in an email using AWS SNS service. If I print a message in Python output all strings is in new lines: but in an email it is all in one line: Answer replace ‘n’ by “.n” and after that in an email – each string is in a new line.
Lambda Function to write to csv and upload to S3
I have a Python Script that gets the details of the unused security groups. I want that to write into a CSV file and upload to S3 Bucket. When I test it in local machine it writes to CSV in the local machine. But when I execute that as a lambda function, it needs a place to save the CSV.
Unable to invoke second lambda within VPC – Python AWS Lamba Function
I have two simple lambda functions. Lambda 1 is invoking lambda 2 (both do a simple print for text). If both lambdas are outside of a VPC then the invocation succeeds, however as soon as I set them both in to access a VPC (I need to test within a VPC as the full process will be wtihin a VPC)