Ask questions on the official Q&A site at https://ask.datomic.com!
steveb8n 2021-03-18T07:20:52.000800Z

I do this by invoking the Ion Lambda using the AWS API. It was a bit tricky to get the request/response encoding right but, once done, it works great for internal Ion access

Joe Lane 2021-03-18T12:23:26.002100Z

He’s talking about http-direct though which will have much higher performance, especially in the same vpc.

zendevil 2021-03-18T18:57:12.006300Z

I’m trying to use datomic cloud and using the

[datomic.client.api :as d]
api for it. This is what I’ve done so far: Create a client:
(d/client {
  :server-type :ion
  :region "us-east-1"   
  :system "humboi-march-2021"
  :creds-profile "humboi"
  :endpoint "<http://entry.humboi-march-2021.us-east-1.datomic.net:8182>"
  :proxy-port 8182
And I evidently have the humboi named-profile in my ~/.aws/credentials:
aws_access_key_id = foobar
aws_secret_access_key = foobarbaz
But when I run this:
              {:db-name "humboi-march-2021"})
Amongst a lot of logs, I get this exception:
Execution error (ExceptionInfo) at datomic.client.api.async/ares (async.clj:58).
profile file cannot be null
Why am I getting this exception? Could it be possible that the database was in face created and that this exception be ignored or is that the app can genuinely not get the aws credentials? @jaret @lanejo01 @alexmiller thanks for your help so far.

Joe Lane 2021-03-18T18:59:00.007500Z

Your client cannot get aws credentials, we proved that everything else works by running with the ion-starter project vs your existing app.

zendevil 2021-03-18T19:01:03.008200Z

@lanejo01 if the credentials file can’t be read, can I put the key and the secret in the cfg map directly somehow?

Joe Lane 2021-03-18T19:01:48.008800Z

No, it doesn't work like that.

Joe Lane 2021-03-18T19:04:00.010Z

Random guess, datomic-cloud depends on a particular version of the AWS SDK, does Amazonica override that version to an incompatible version?

zendevil 2021-03-18T19:10:22.011900Z

@lanejo01 I don’t think so. I was using amazonica 0.3.153, which I removed from dependencies, along with the related code. I still see this error upon restarting the server

Joe Lane 2021-03-18T19:11:05.012400Z

did you lein clean?

zendevil 2021-03-18T19:14:01.013Z

@lanejo01, yes

zendevil 2021-03-18T20:05:16.014Z

@lanejo01 is the library supposed to work if only the environment variables AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=yyy are provided? Does it still look for ~/.aws/credentials?

Joe Lane 2021-03-18T20:07:02.014900Z

You already proved that you don't need those set a few days ago. https://clojurians.slack.com/archives/C03RZMDSH/p1615740607282600

Joe Lane 2021-03-18T20:07:43.015500Z

When ion-starter worked, you didn't set credentials directly at all.

zendevil 2021-03-18T20:09:48.016Z

@lanejo01 you mention this: “Also, when you deploy this, you will. need to remove that creds profile and use a different approach”. What’s the different approach? Maybe I can try it in this case?

Joe Lane 2021-03-18T20:12:31.016700Z

I don't think you'd want to deploy this on heroku. EC2 has iam roles baked in, you could use elastic-beanstalk for a heroku-like experience.

zendevil 2021-03-18T20:16:51.018100Z

I see, when I’d deploy to elastic-beanstalk, the iam roles will be “baked in”. I’ll look into it. But I’ve really hit a wall with my dev setup and getting the ~/.aws/credentials into the app