Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Code to AWS SDK v3 #409

Closed
wants to merge 4 commits into from
Closed

Conversation

vikasperi
Copy link

What:

Upgrade AWS SDK from v2 to v3

WHY:

Incompatibility with Node 18 based platforms as AWS SDK v2 does not work well.

Note:
Thanks to this PR from @garrettheel.
I used your idea of converting the CapacityUnits into Number which saved me some work.

lib/backend.js Outdated Show resolved Hide resolved
@vikasperi
Copy link
Author

vikasperi commented Nov 22, 2023

I added a new flag to set dummy creds if we do not have local credentials. (--dummy_creds, -D)

Feel free to try again and review 😄 @rchl

bin/dynamodb-admin.js Outdated Show resolved Hide resolved
@vikasperi vikasperi requested a review from rchl November 23, 2023 02:47
@@ -38,15 +38,16 @@ parser.add_argument('-p', '--port', {
help: 'Port to run on (default: 8001)',
})

parser.add_argument('-D', '--dummy_creds', {
parser.add_argument('-l', '--local_config', {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more common to use dashes in command line options instead of underscores.

@@ -46,41 +46,41 @@ function loadDynamoEndpoint(env, dynamoConfig) {
* @param AWS - the AWS SDK object
* @returns {{endpoint: string, sslEnabled: boolean, region: string, accessKeyId: string}}
*/
function loadDynamoConfig(env, isDummy) {
function loadDynamoConfig(env, local_config) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camelCase convention is being used in Javascript

@zaun
Copy link

zaun commented Mar 22, 2024

Any update on this?

@@ -405,7 +405,7 @@

if (data.Items.length) {
$('#items-container').append(data.Items.map(item => {
const viewUrl = '/tables/<%= Table.TableName %>/items/' + encodeURIComponent(Object.values(item.__key).join(','))
const viewUrl = '/tables/<%= Table.TableName %>/items/' + encodeURIComponent(Object.values(Object.values(item.__key)[0]).join(','))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran this locally for my dataset, and this doesn't work properly when there are multiple keys involved, as this is only picking the first key.
I fixed this locally by doing:
Object.values(item.__key).map(function (i) { return Object.values(i)[0] }).join(',')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants