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?(keys creds) => (:access-key-id :secret-access-key)
thanks in advance
Looks like maybe you don’t have the ec2 jar in your deps?
could be… my first foray using the deps.edn ecosystem rather than leiningen as well
thanks
You should have at least 3 deps - api, endpoints, and whatever service(s) you’re hitting
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?
or a simple example that launches an ec2 instance that I can ssh into then shutdown?
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
sure, will do. It’s basically the examples/ec2_examples.clj that doesn’t work
(at least for me)
well please log so David or someone else can take a look
will do
thx
ah - I only have api, and credentials
that must be it
btw, I was literally just following https://github.com/cognitect-labs/aws-api/blob/master/examples/ec2_examples.clj
To use s3 I had to bring this into my project.clj [com.cognitect.aws/s3 “680.2.370.0”]
Does adding [com.cognitect.aws/ec2 “681.2.373.0”] make this work for you?
You might also have to provide region as well, if your creds/region aren’t configured in your environment.
I’ll need to read up a bit more before proceeding…
(aws/client {:api :ec2, :region "us-east-1", :credentials-provider (basic-credentials-provider {:access-key-id "" :secret-access-key ""})})
hey @thedavidmeister
howdy