amazon-archives / aws-cognito-angular-quickstart

An Angular(v5)-based QuickStart single-page app utilizing Amazon Cognito, S3, and DynamoDB (Serverless architecture)
https://cognito.budilov.com
Apache License 2.0
689 stars 304 forks source link

DynamoDB Missing credentials #120

Closed nolafs closed 6 years ago

nolafs commented 6 years ago

Hi,

I am having issues with writing to the DynamoDB. It throws an error missing the region. Adding the region returns another error of missing credentials. Then I tried to add the creditionals to the options which returns the following:

DynamoDBService: wrote entry: {"message":"Missing credentials in config","code":"CredentialsError","time":"2017-11-02T18:17:35.670Z","originalError":{"message":"Could not load credentials from CognitoIdentityCredentials","code":"CredentialsError","time":"2017-11-02T18:17:35.670Z","originalError":{"message":"Missing region in config","code":"ConfigError","time":"2017-11-02T18:17:35.670Z"}}}

here is code for clientParam:

if (environment.dynamodb_endpoint) { clientParams.credentials = this.cognitoUtil.getCognitoCreds(); clientParams.region = environment.region; clientParams.endpoint = environment.dynamodb_endpoint; }

    console.log('clientParams', clientParams)

    var DDB = new DynamoDB(clientParams);

Any idea where I go wrong?

Cheers Olaf

nolafs commented 6 years ago

My mistake, I forgot to init the SDK