Questions tagged [amazon-dynamodb]

1

votes
1

answer
798

Views

stopping duplicate entry in dynamodb

I have a table called followProduct in Dynamodb and it has following strucure id - item id email - user email product - product id Whenever a user follows a product I am making an entry in the table. I am trying to stop duplicate entry and using the following code let params = { TableName: 'followPr...
Rishabh Jain
1

votes
1

answer
70

Views

DynamoDB query equivalent to “WHERE author IN [..]”?

Given the following data structure; { 'author': 'USERNAME', 'caption': 'Caption of video', 'createdAt': 1531260177951, 'id': '03290200-848d-12e8-a1b5-bb9570f524f1', // Current primary key 's3Bucket': 's3-bucket-name', 's3Key': 'USERNAME/1521260163051.mp4', 'updatedAt': 1531260177951 } I am trying to...
Automatico
1

votes
2

answer
38

Views

DynamodDB: How to update sort key?

The table has two keys: filename (partition key) and eventTime (sort key). I want to update eventTime for certain filename. Tried put_item() and update_item() sending the same filename with new eventTime but those functions add a new item instead of update. What should I use for that purpose?
Putnik
0

votes
0

answer
4

Views

Error creating bean with name 'accountController': Unsatisfied dependency expressed through field 'Service_functions'

Trying to connect to aws DynamoDB but currently running into the error shown in the title. What am i going wrong? I've looked at other solutions online to which i did not find an answer that worked for me. Full Error - org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating...
stackoverflown
1

votes
0

answer
8

Views

I am trying to get individual attributes from a DynamoDB table and turn them into variables before callback

I am trying to get individual attributes from a DynamoDB table and turn the into variables before callback. I want to callback an Html with the attributes as variables inside the Html document, but I only managed to callback either the whole Item, or a few specific attributes with 'ProjectionExpress...
Adpy
1

votes
2

answer
1k

Views

DynamoDB Schema Design

I'm thinking of using Amazon AWS DynamoDB for a project that I'm working on. Here's the gist of the situation: I'm going to be gathering a ton of energy usage data for hundreds of machines (energy readings are taken around every 5 minutes). Each machine is in a zone, and each zone is in a network. I...
s_dolan
1

votes
2

answer
976

Views

DynamoDB; Fetch all data in a table - PHP

I found some help in how to get this done via the answer linked here. But it doesn't fit my use case. My goal is to fetch all records in a DynamoDB Table (usernames and emails). Looking through doc I have to use LastEvaluatedKey or ExclusiveStartKey to implement pagination. Any guidance will be appr...
moh_abk
1

votes
3

answer
625

Views

Calling getItem() on DynamoDB object from AWS Lambda, why doesn't my callback execute?

I'm trying to get an item from my DynamoDB database. The way my code is presently written, I fail to retrieve any data from DynamoDB. I must be doing something wrong, because as far as I can tell from my test, my callback is not being called. I spent all day on this yesterday and have been tinkering...
Kevin Glick
1

votes
3

answer
1.4k

Views

Best way to inject instance of DynamoDBContext in .NET Core

Currently working on a web services project for my class and have decided to make a web API using .NET Core and DynamodDB. I was just curious what the best way to inject the DynamoDBContext is? I currently am doing it like this: public void ConfigureServices(IServiceCollection services) { services.A...
wjvukasovic
1

votes
2

answer
327

Views

Efficient substring Search in DynamoDB

This is the context of my situation: I have a huge DB in dynamoDB with 250.000 items. (Example) table I want to be able to 'substring search' through 3 attributes, getting the list of all items that match the substrings. The attributes i want to be able to search can have the same value among differ...
Diego Leonvendagar
1

votes
1

answer
49

Views

DynamoDB slow scan query

When I do this query in AWS console it returns immediately: But from the Java code, it never completes: final List tx = dynamoDBMapper // .scan(TransactionDetails.class, new DynamoDBScanExpression() // .withConsistentRead(false) .withLimit(maxRecords) // .withFilterConditionEntry('time', new Conditi...
serg.nechaev
1

votes
2

answer
63

Views

DynamoDB query by secondary index only

I store user accounts in DynamoDB: { email: '[email protected]', expires: 1548807053247, } My hash key is the email field. I want to add a daily cron job which will send a reminder email for all accounts about to expire (in the next 14 days). For that, I need to query on expires field alone - without us...
Gilad Novik
1

votes
1

answer
65

Views

How to get all records from a table in DynamoDb using query

Newbie to DynamoDb I have a table in AWS DynamoDb as below tblCustomer Id Name Email 1 Abc [email protected] 2 Xyz [email protected] It's a huge table. While exploring on around it. Query is better than Scan. So I chose Query over Scan. This is how my C# function looks like. AmazonDynamoDBClient client...
Kgn-web
1

votes
2

answer
167

Views

Micronaut serverless application using DynamoDB and Graal custom runtime throws Cannot construct instance of com.amazonaws.partitions.model.Partitions

SAMPLE PROJECT AVAILABLE HERE: https://github.com/codependent/micronaut-aws-lambda-proxy-graal I have a Micronaut application deployed on Amazon AWS as a Lambda function. It is compiled into a GraalVM native image and run using an AWS Lambda Custom Runtime. If the application doesn't use DynamoDB it...
codependent
1

votes
1

answer
34

Views

Separating Environments in AWS

Is there a best practice around separating environments in AWS? I've got a solution that employs the following services: Lambda SNS SQS DyanmoDB API Gateway S3 IAM We're not live yet, but we're getting close. By the time we go-live, I'd like a proper production, test, and development environment wit...
Adam
0

votes
1

answer
4

Views

dynamodb timestamp reserved name expression-attribute-name

DynamoDb table structure: Primary key: userId, Sort key: timestamp I created this query: aws dynamodb query \ --table-name QAClusteredData \ --key-condition-expression 'userId= :user_id AND timestamp BETWEEN :t1 AND :t2' \ --expression-attribute-values '{ ':user_id': {'S': 'ec2e598f-cff8-4648-a120-3...
user829174
1

votes
2

answer
595

Views

How to implement TTL on column in DynamoDB?

After reading DynamoDB(DDB) doc, I know there is only builtin TTL for item/row. Then I wonder if there is a convenient way to implement TTL for column? When a TTL expires, the value in the column of an item (if any) will be eliminated. The general use case is that some field of a row is of limited d...
jun shen
1

votes
1

answer
192

Views

Lambda function using Dynamodb and SNS - timed out

Am trying to use a DynamoDb Item value in the SNS service to send the notification. Its failing with the timeout error however fetch from Dynamodb is successful and notification is also sent. But it keep retrying and timeout after processing multiple times. { 'errorMessage': '2018-01-02T10:14:55.46...
arj13
1

votes
1

answer
291

Views

DynamoDb documentClient.update or delete StringSet throws ValidationException

I successfully update and delete an item from a StringSet in a dynamoDb table when called from my test app running on localhost. I then upload the app to LightSail but now when I call the same function to update or delete an item it throws a ValidationException!: { 'message': 'Invalid UpdateExpressi...
Clive Sargeant
1

votes
0

answer
85

Views

AWS - DynamoDB - CRUD methods doesn't work correctly

I really need Your help, I'm trying to create simple kitchen management application. I decided to use AWS with DynamoDB, I stucked with CRUD methods: add and delete methods seems to work fine, but I have big problems with editing database records. Error message in log file: 'Can not deserialize inst...
D.Zet
1

votes
1

answer
53

Views

AWS DynamoDB and PhP - Forbidden Error

Am using Amazon Elastic beanstalk and running a php server. Simple application program running fine however whenever am trying to connect to AWS DynamoDB, its giving me error Forbidden You don't have permission to access / on this server. Below is the code Not sure if I need to set-up some IAM role...
arj13
1

votes
1

answer
68

Views

Dynamodb: No defined key schema. A key schema containing at least a hash key must be defined for all tables

When i tried creating a dynamodb table from C# using DocumentObject model. I encountered this error, did some search in internet but couldnt find the exact problem solved. The error is No defined key schema. A key schema containing at least a hash key must be defined for all tables during creating...
Arul Manivannan
1

votes
1

answer
531

Views

Pagination with spring-boot and dynamoDB

I'm working on a spring boot application which queries a DynamoDB to retrieve a list of items. I want to use pagination and jump to a particular page. Eg. url: /items?pageno=10&pagesize=20 response: { items:[{item1}, {item2}, {item3}...{item10}], 'page':3, 'perPage': 10, 'total': 4000} Does dynamoD...
Arun Selin
1

votes
0

answer
104

Views

Display a DynamoDB tabel on a S3 Static website

Hi I want to display a complete DynamoDB tabel on a static website hostet on a S3 bucket. The tabel looks like: Id---Name---Surname---Date of Birth Is there an html statement that reads form the dynamo db and displays its content on the site? Later i would like to search or only display some entries...
Vend
1

votes
1

answer
729

Views

Fetching data by composite primary key in dynamodb

I am using following function -> const params = { TableName: process.env.dummyTable, Key: { outlet_id:event.pathParametrs.id, id:{'S':'default'} } } dynamoDb.get(params).promise() .then(result => { console.log('-->',result); const response = { statusCode: 200, body: JSON.stringify(result), }; callb...
Dnyanesh
1

votes
1

answer
195

Views

boto3 support for role_arn

I want to insert data from AWS Lambda to AWS DynamoDB and upload a file from Lambda to AWS S3. Currently, I'm using Access Key and Secret Key to do this from boto3. But, due to security issues, I had to change this approach to role-based approach. (i.e) To insert data in DDB or uploading a file to...
Droid
1

votes
1

answer
587

Views

How to pass variable key value in dynamodb

Am trying to get the items from DynamoDB table based on the current date. Using the date value in string format when am trying to run the below piece of code, its error out saying: { 'errorMessage': 'ERROR: Dynamo failed: TypeError: Cannot read property 'datatype' of undefined' } Below is the piece...
arj13
1

votes
1

answer
106

Views

AWS: getting limited IAM credentials for DynamoDB without JS SDK

What I want to achieve: My case described in this article but I do not want to use SDK on my webpage - I want to keep my app simple and fast, but as it turned out - it is hard to find an example that does not use SDK. I stumped with http call from which I need to get limited IAM credentials for Dyna...
Vitaly Zdanevich
1

votes
2

answer
261

Views

AWS DynamoDB queries using Swift

I am using swift and AWS DynamoDB for mobile app. I followed the tutorial and can save data successfully. However , when I try to load data , i found I the saving and loading data always come after all tasks in the viewdidload finished, so I can not pass the data out in the same view? Is there any...
jing
1

votes
2

answer
222

Views

Javascript, Tesseract, AWS IoT, Dynamodb & Buffers

Im working and testing on a small Tesseract project and with full credit to http://aalvarez.me/blog/posts/building-an-ocr-service-with-tesseractjs-in-aws-lambda.html I've got a Tesseract project running in Lambda that takes s3 events and processes the image that was uploaded to s3. The next objectiv...
Mark Lloyd
1

votes
0

answer
430

Views

AWS Cloudformation DynamoDB Alarms

I am unable to properly create/link a CloudWatch alarm with a DynamoDB Table using CloudFormation. DynamoDBTable: Type: AWS::DynamoDB::Table Properties: AttributeDefinitions: - AttributeName: 'Bucket' AttributeType: 'S' - AttributeName: 'Key' AttributeType: 'S' - AttributeName: 'IngestedDate' Attri...
Alessandroempire
1

votes
1

answer
244

Views

DynamoDBVersion Attribute with Conditional Update

I am using the .NET object persistence model with DynamoDB, and am making use of the built in optimistic locking using the DynamoDBVersion attribute. [DynamoDBTable('items')] public class MyItem { [DynamoDBHashKey] public string Id { get; set; } [DynamoDBVersion] public int? Version { get; set; } }...
Matt Cole
1

votes
1

answer
182

Views

'Type is unsupported' error when trying to save Enum in DynamoDb

I have the below class that I have decorated with DynamoDb attributes: [DynamoDBTable('Orders')] public class OrderDynamoModel { [DynamoDBHashKey] public int OrderId { get; set; } [DynamoDBProperty] public DateTime DateTimeUtc { get; set; } [DynamoDBProperty] public int TId { get; set; } [DynamoDBPr...
Shaun Ros
1

votes
0

answer
196

Views

Insert IoT message array as multiple rows in DynamoDB

I'm starting a new project that involves some IoT devices sending every 5 minutes their status and other info to AWS IoT. The structure of the message is the following: { 'SNC':'C_SN_15263217541', 'STATUS':'enable', 'PLANT':{ 'PNAME':'nomeimpianto', 'DVS':{ 'SD':[{ 'SDSN':'LD_SN_15263987543', 'TT':'...
Mattia Costamagna
1

votes
0

answer
81

Views

Connect to existing DynamoDB Tables from iOS App

I have a web app that makes use of DynamoDB as a backend. I can set up the connection like this: AWS.config.update({ region: region, accessKeyId: accessKeyId, secretAccessKey: secretAccessKey }); Using JavaScript I can easily retrieve data from a table like so: var docClient = new AWS.DynamoDB.Docum...
Adam Zarn
1

votes
1

answer
364

Views

AWS - dynamodb - How to do a search in similar text?

I have a table in dynamodb, and I store in it a content similar to this: Product Code | Title 1 | Computer 2 | Notebook But when I use the SCAN function to fetch the records, it only finds if I put 'Computer' (Exactly the same) If I put 'computer' do not think anything. Json being sent to SCAN: { 'T...
Charles Macetko
1

votes
1

answer
242

Views

dynamodb scan not working with IN condition

I'm failing to get the IN condition in my dynamodb scan call to work correctly. Background I'm trying to collect all permissions a user have based on the the roles associated with him, based on this data structure: # Users | user | roles | admin | ['system-admin', 'basic-user'] # Roles | role...
Martin Schulze
1

votes
1

answer
450

Views

AWS boto3 — Difference between `batch_writer` and `batch_write_item`

I'm currently applying boto3 with dynamodb, and I noticed that there are two types of batch write batch_writer is used in tutorial, and it seems like you can just iterate through different JSON objects to do insert (this is just one example, of course) batch_write_items seems to me is a dynamo-speci...
JChao
1

votes
1

answer
414

Views

How to display the content of a DynamoDB table

My DynamoDB table has the following attritubes sales_id: hashkey created_date: rangekey sales_employee_id:IndexedHashKey I am trying to get all the data of the table Sales just as in MySQL select * from Sales How can I query DynamoDB. I am trying with the below AWS CLI query but it fails everytime w...
J123
1

votes
1

answer
447

Views

What to use to read/write from dynamodb from Spark?

I'd like to know what's the best to use to read/write from dynamodb from Spark. I've tried with the official API from dynamodb, also with the emr connector(hadoop and also with hive) and others. But i've found (among other problems) that to perform a query a full scan is needed, and that's not somet...
ibk_jj

View additional questions