Fork me on GitHub
#aws
<
2018-12-13
>
aaelony23:12:28

hi! I’m trying out cognitect.aws.credentials and cognitect.aws.client.api for the first time. I think I’ve constructed my creds map properly, but I get a stacktrace when I attempt to create the client:

(type (credentials/basic-credentials-provider creds)) => cognitect.aws.credentials$basic_credentials_provider$reify__15156

(def client (aws/client {:api :ec2
                         :credentials-provider (credentials/basic-credentials-provider creds)
                         }))
Syntax error (ExceptionInfo) compiling at (REPL:31:13).
Cannot find resource cognitect/aws/ec2/service.edn. 
Please lmk how to remedy?

aaelony23:12:58

(keys creds) => (:access-key-id :secret-access-key)

aaelony23:12:10

thanks in advance

alexmiller23:12:59

Looks like maybe you don’t have the ec2 jar in your deps?

aaelony23:12:51

could be… my first foray using the deps.edn ecosystem rather than leiningen as well

alexmiller23:12:38

You should have at least 3 deps - api, endpoints, and whatever service(s) you’re hitting

aaelony19:12:21

Hi Alex, I have the api and endpoints resolving well. Could you give me a hint as to the correct way to specify the ec2 service?

aaelony19:12:50

or a simple example that launches an ec2 instance that I can ssh into then shutdown?

alexmiller19:12:20

sorry, I’m not an expert on ec2 - if you have something that isn’t working, you could post the code as an issue on the aws repo though

aaelony19:12:45

sure, will do. It’s basically the examples/ec2_examples.clj that doesn’t work

aaelony19:12:14

(at least for me)

alexmiller19:12:07

well please log so David or someone else can take a look

aaelony23:12:10

ah - I only have api, and credentials

aaelony23:12:17

that must be it

christian.gonzalez23:12:42

To use s3 I had to bring this into my project.clj [com.cognitect.aws/s3 “680.2.370.0”]

christian.gonzalez23:12:51

Does adding [com.cognitect.aws/ec2 “681.2.373.0”] make this work for you?

christian.gonzalez23:12:13

You might also have to provide region as well, if your creds/region aren’t configured in your environment.

aaelony23:12:45

I’ll need to read up a bit more before proceeding…

christian.gonzalez23:12:58

(aws/client {:api :ec2, :region "us-east-1", :credentials-provider (basic-credentials-provider {:access-key-id "" :secret-access-key ""})})

simon22323:12:33

hey @thedavidmeister