github1 / ccnext

Event driven call center prototype
1 stars 0 forks source link

17 setup persistent eventstore #44

Closed gcottrell1 closed 6 years ago

github1 commented 6 years ago

Is there a way to set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY values with this?

github1 commented 6 years ago

The reason being for the above is if we wanted to use different accounts with specific limited permissions (e.g. one for Lex and one for DynamoDB).

gcottrell1 commented 6 years ago

Ahh right, so eventstore uses the aws-sdk and that pulls the access key id and secret access key from the environment config. I will have a look into how we could prevent it from doing this automatically

gcottrell1 commented 6 years ago

As I read yesterday, the norm when using multiple AWS services with different users is to do say:

const s3 = AWS.S3({region:"us-east-1", accessKeyId="1234..."});
const ec2 = AWS.EC2({region:"us-west-2", accessKeyId="5678..."});

so eventstore automatically pulling them from environment config could cause some issues

github1 commented 6 years ago

Looks like we may just be able to pass that configuration into the hash based on https://github.com/adrai/node-eventstore/blob/21e0fbfb2dcd58b47c79500f82d770de2770181a/lib/databases/dynamodb.js#L39. It isn't documented but based on reading the code I think it will work.

gcottrell1 commented 6 years ago

Is this something you want to me to implement/try out now or are you just thinking for the future?

github1 commented 6 years ago

We can hold off for now