amazon-dynamodb

AWS Lambda keeps returning “\”Hello from Lambda!\"

旧城冷巷雨未停 提交于 2021-01-20 04:58:49
问题 I'm having some issues with AWS Lambda for Python 3.8. No matter what code I try running, AWS Lambda keeps returning the same response. I am trying to retrieve a information from a DynamoDB instance with the code below: import json import boto3 dynamodb = boto3.resource('dynamodb') table = dynamodb.Table('planets') def lambda_handler(event, context): response = table.get_item( Key = { 'id':'mercury' } ) print(response) # TODO implement return { 'statusCode': 200, 'body': response) } I am

AWS Lambda keeps returning “\”Hello from Lambda!\"

我们两清 提交于 2021-01-20 04:57:06
问题 I'm having some issues with AWS Lambda for Python 3.8. No matter what code I try running, AWS Lambda keeps returning the same response. I am trying to retrieve a information from a DynamoDB instance with the code below: import json import boto3 dynamodb = boto3.resource('dynamodb') table = dynamodb.Table('planets') def lambda_handler(event, context): response = table.get_item( Key = { 'id':'mercury' } ) print(response) # TODO implement return { 'statusCode': 200, 'body': response) } I am

AWS Lambda keeps returning “\”Hello from Lambda!\"

≯℡__Kan透↙ 提交于 2021-01-20 04:57:06
问题 I'm having some issues with AWS Lambda for Python 3.8. No matter what code I try running, AWS Lambda keeps returning the same response. I am trying to retrieve a information from a DynamoDB instance with the code below: import json import boto3 dynamodb = boto3.resource('dynamodb') table = dynamodb.Table('planets') def lambda_handler(event, context): response = table.get_item( Key = { 'id':'mercury' } ) print(response) # TODO implement return { 'statusCode': 200, 'body': response) } I am

Run Crawler using custom resource Lambda

久未见 提交于 2021-01-07 16:31:51
问题 I am trying to create and invoke an AWS Glue crawler using cloud formation. The creation part of the crawler(dynamo DB as target) is in lambda function. how can I achieve all this using cloud formation? i.e creation of lambda function from cod present in s3 , After lambda function is created, it should get triggered to create crawler and then crawler should be invoked to create targted tables. I want all of this is cloud formation. link for reference: Is it possible to trigger a lambda on

Run Crawler using custom resource Lambda

£可爱£侵袭症+ 提交于 2021-01-07 16:27:56
问题 I am trying to create and invoke an AWS Glue crawler using cloud formation. The creation part of the crawler(dynamo DB as target) is in lambda function. how can I achieve all this using cloud formation? i.e creation of lambda function from cod present in s3 , After lambda function is created, it should get triggered to create crawler and then crawler should be invoked to create targted tables. I want all of this is cloud formation. link for reference: Is it possible to trigger a lambda on

Run Crawler using custom resource Lambda

左心房为你撑大大i 提交于 2021-01-07 16:25:23
问题 I am trying to create and invoke an AWS Glue crawler using cloud formation. The creation part of the crawler(dynamo DB as target) is in lambda function. how can I achieve all this using cloud formation? i.e creation of lambda function from cod present in s3 , After lambda function is created, it should get triggered to create crawler and then crawler should be invoked to create targted tables. I want all of this is cloud formation. link for reference: Is it possible to trigger a lambda on

Adding new attribute to DynamDB table with updateItem

╄→尐↘猪︶ㄣ 提交于 2021-01-05 11:26:31
问题 I have table already and I want to add a new attribute to that table. I am trying to do that with the update_item functionality of dynamDB. use case: Bid table holds details on the bid of the product. The user accepts the bid, once the bid is accepted, have to add a few attributes to that record like the user information. Not sure if it is the right way or should I have a new table for this. pratition key is : Pickup, sort key is : DropOff A Demo example that I am trying currently currently

Athena DDL for Ion format?

五迷三道 提交于 2021-01-05 07:22:46
问题 I'm trying to use Athena to query some files that are in Ion format produced by the recently added Export To S3 feature of DynamoDB backups. This is a blatantly stupid format which is basically the string $ion_1_0 followed by json. The unquoted $ion_1_0 string at the front makes the data invalid json . I tried using the Ion Serde from here: CREATE EXTERNAL TABLE mydb.mytable ( `myfields` string, ... ) ROW FORMAT SERDE 'com.amazon.ionhiveserde.IonHiveSerDe' LOCATION 's3:/.../dynamodb-export

Do Global Secondary Indexes suffer from hot key issues

瘦欲@ 提交于 2021-01-02 20:49:45
问题 I know tables in DynamoDB require even distribution between shards to utilize read/write capacity, is this true for Global Secondary Indexes too? 回答1: Yes, GSIs have the same guidelines as regular table indexes. You should follow the same guidelines described in Guidelines for Working with Tables. The Guidelines for Global Secondary Indexes documentation gives an example where a poorly chosen key can lead to hot-spotting and uneven activity accross partitions.: For example, suppose you have

Lambda and DynamoDB : is not authorized to perform: dynamodb:Scan

耗尽温柔 提交于 2020-12-29 09:22:31
问题 I've created my API with serverless, after I deployed my API into lambda, and we I try to test the endpoint via the "Test" button in the GatewayAPI, I get the error: "User: arn:aws:sts::245912153055:assumed-role/pets-service-dev-us-east-1-lambdaRole/pets-service-dev-listPets is not authorized to perform: dynamodb:Scan on resource: arn:aws:dynamodb:us-east-1:245912153055:table/Pets" I should probably need to give the permission to Lambda, but I'm a little bit lost ... 回答1: As already stated,