jkakar / aws-elixir Goto Github PK
View Code? Open in Web Editor NEWThis project forked from aws-beam/aws-elixir
AWS clients for Elixir
License: Other
This project forked from aws-beam/aws-elixir
AWS clients for Elixir
License: Other
Would be great for aws-elixir to carry a dependency on Timex 2.x instead of 1.x.
Failed to use "poison" (version 2.2.0) because
aws (version 0.0.11) requires ~> 1.0
phoenix (version 1.2.0) requires ~> 1.5 or ~> 2.0
Locked to 2.2.0 in your mix.lock
For new projects with Phoenix, I can't use this library unless I downgrade Phoenix.
After extensive trial and error. I figured out that Rekognition.detect_faces() is expecting a map with these keys. I was able to easily determine from the response signature in the module that opts was to be a map but not the keys that were expected. Mostly that Image: and not "Image", "image", or "--image"
Client |> AWS.Rekognition.detect_faces(%{Image: %{S3Object: %{Bucket: "some_bucket", Name: "some_name" }}))
{:error, {"ValidationException", "1 validation error detected: Value null at 'image' failed to satisfy constraint: Member must not be null"}}
What I'm confused about is that the key specified is a string image (lowercase) not an Atom first letter capitalized. I even reviewed the docs for AWS Go and that didn't seem to help me understand the error messages. I'm assuming there are several sources for errors messages. HTTPoision, Poision and AWS cli. To make this repo more user friendly we need to add.
Let me know what you think on driving this forward. I would be willing to do some basic work documenting as figuring out this was a horribly time consuming.
I'm experienced with building Erlang with rebar3, but am inexperienced with Elixir and mix. I want to use aws-elixir from an Erlang project, but apparently rebar3 doesn't support Elixir dependencies. So I thought I'd just build aws-elixir manually, and then include the path to the .beam's when I start my Erlang VM (as mentioned at http://www.rebar3.org/discuss/55841dbbafccfd0d00fcb1f8)
My question is about the generated beam files in _build/dev/consolidated/ and _build/dev/lib/ I'd guess that I'd have to include _build/dev/consolidated/_beam and build/dev/lib//ebin/ in my VM codepath, unless there was some easier way.
Thanks for any recommendations.
Just a heads up to anyone trying to use this library with temporary IAM credentials obtained within an EC2 instance or ECS container. The temporary security token must be included in the request but that is currently not being done so the API request will fail authentication with a message saying the security token is invalid.
As an alternative it is possible to use https://github.com/erlcloud/erlcloud which allows the token to be passed.
New to elixir, would like some help in using the describe instances method to the ec2 client.
But it doesn't look like it's implemented yet, or am I missing something?
Currently the endpoint prefix is hardcoded for mturk:
host = get_host("mturk-requester", client)
...
defp get_host(endpoint_prefix, client) do
if client.region == "local" do
"localhost"
else
"#{endpoint_prefix}.#{client.region}.#{client.endpoint}"
end
end
Since there is a sandbox development endpoint, it would be nice to support the "mturk-requester-sandbox" prefix as well.
I'm new to Elixir and attempting to upload document to AWS CloudSearch.
The upload_documents
function is defined as follows:
def upload_documents(client, input, options \\ []) do
...
end
If I do this:
client = %AWS.Client{
access_key_id: access_key_id,
secret_access_key: secret_access_key,
region: "us-east-1",
endpoint: doc_endpoint
}
input = %{
"documents" => [
%{
"type" => "add",
"id" => "1",
"fields" => %{
"first_name" => "Your",
"last_name" => "Mom",
"phone_number" => "5551212"
}
}
]
}
AWS.CloudSearch.Domain.upload_documents(client, input)
Then I get this:
** (ArgumentError) argument error
:erlang.list_to_integer([])
src/hackney_url.erl:184: :hackney_url.parse_netloc/2
src/hackney.erl:334: :hackney.request/5
lib/httpoison/base.ex:396: HTTPoison.Base.request/9
lib/aws/cloud_search_domain.ex:124: AWS.CloudSearch.Domain.perform_request/6
options
defaults to []
, which seems to be the cause of the problem here. Is this a bug, or am I missing something?
Also, I'm not entirely certain what data should be sent for options
anyway.
Timex 3.x is out, what about supporting it?
Thanks
It seems that EC2 and S3 are missing from the generated modules. Was that intentional? (If so, might be good to update the README to note which parts of AWS are not supported.)
Language version: Elixir 1.4.2
OS: macOS Sierra 10.12.3
I created a sample project using mix and added {:aws, "~> 0.5.0"} to the project dependencies.
I launched a REPL using iex -S mix.
I created a client structure using
client = %AWS.Client{access_key_id: access_key_id,
secret_access_key: secret_access_key,
region: "us-east-1",
endpoint: "amazonaws.com"}
Where access_key_id
and secret_access_key
were bound to the appropriate values.
Then I tried to execute the demo in the README
{:ok, result, resp} = AWS.Kinesis.list_streams(client, %{})
I get the following error and stack trace:
** (exit) exited in: :gen_server.call(:hackney_manager, {:new_request, #PID<0.1614.0>, #Reference<0.0.8.8801>, {:client, :undefined, {:metrics_ng, :metrics_dummy}, :hackney_ssl, 'kinesis.us-east-1.amazonaws.com', 443, "kinesis.us-east-1.amazonaws.com", [], nil, nil, nil, true, :hackney_pool, 5000, false, 5, false, 5, nil, nil, nil, {0, {:dict, 0, 16, 16, 8, 80, 48, {[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []}, {{[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []}}}}, :undefined, :start, nil, :normal, false, false, false, :undefined, false, nil, :waiting, nil, 4096, "", [], :undefined, nil, nil, nil, nil, :undefined, nil}}, :infinity)
** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
(stdlib) gen_server.erl:212: :gen_server.call/3
/Users/jnorton/Elixir/rekog/deps/hackney/src/hackney_manager.erl:65: :hackney_manager.init_request/1
/Users/jnorton/Elixir/rekog/deps/hackney/src/hackney_manager.erl:55: :hackney_manager.new_request/1
/Users/jnorton/Elixir/rekog/deps/hackney/src/hackney_connect.erl:185: :hackney_connect.socket_from_pool/4
/Users/jnorton/Elixir/rekog/deps/hackney/src/hackney_connect.erl:37: :hackney_connect.connect/5
/Users/jnorton/Elixir/rekog/deps/hackney/src/hackney.erl:330: :hackney.request/5
lib/httpoison/base.ex:432: HTTPoison.Base.request/9
lib/aws/kinesis.ex:594: AWS.Kinesis.request/4
It would be great if the client would optionally pull credentials from EC2 instance metadata at the least, or optimally mimic the default credential provider chain:
Hi,
Erlang/OTP 19 [erts-8.0.2] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Elixir 1.3.2
== Compilation error on file lib/combine/parsers/text.ex ==
** (CompileError) Elixir.Combine.Parsers.Text: function float_impl/1+43:
Internal consistency check failed - please report this bug.
Instruction: {call,4,{f,129}}
Error: {multiple_match_contexts,[{x,0},1]}:
(stdlib) lists.erl:1338: :lists.foreach/2
(stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
could not compile dependency :combine, "mix compile" failed. You can recompile this dependency with "mix deps.compile combine", update it with "mix deps.update combine" or clean it with "mix deps.clean combine"
And updating httpoison deps solved the problem.
diff --git a/mix.exs b/mix.exs
index 1460398..5cb3d59 100644
--- a/mix.exs
+++ b/mix.exs
@@ -35,7 +35,7 @@ defmodule AWS.Mixfile do
[{:dialyxir, "~> 0.3", only: [:dev]},
{:earmark, "~> 0.2.0", only: [:dev]},
{:ex_doc, "~> 0.11.3", only: [:dev]},
- {:httpoison, "~> 0.8.0"},
+ {:httpoison, "~> 0.9.0"},
{:poison, "~> 1.5 or ~> 2.0"},
{:timex, "~> 2.1"}]
end
It may be helpful to clarify that the httpoison application needs to be setup to avoid error messages like this from the example:
* (exit) exited in: :gen_server.call(:hackney_manager, {:new_request, #PID<0.263.0>, #Reference<0.0.5.143>, {:client, :undefined, :hackney_dummy_metrics, :hackney_ssl_transport, 'kinesis.us-east-1.amazonaws.com', 443, "kinesis.us-east-1.amazonaws.com", [], nil, nil, nil, true, :hackney_pool, 5000, false, 5, false, 5, nil, nil, nil, :undefined, :start, nil, :normal, false, false, false, :undefined, false, nil, :waiting, nil, 4096, "", [], :undefined, nil, nil, nil, nil, :undefined, nil}}, :infinity)
** (EXIT) no process
(stdlib) gen_server.erl:212: :gen_server.call/3
src/hackney_manager.erl:66: :hackney_manager.init_request/1
src/hackney_manager.erl:56: :hackney_manager.new_request/1
src/socket/hackney_connect.erl:183: :hackney_connect.socket_from_pool/4
src/socket/hackney_connect.erl:36: :hackney_connect.connect/5
src/hackney.erl:321: :hackney.request/5
lib/httpoison/base.ex:395: HTTPoison.Base.request/9
lib/aws/kinesis.ex:534: AWS.Kinesis.request/4
Was looking for an SQS module and couldn't find it. Any plans to add support for it?
Hi @jkakar,
I've just landed on this repo and I'm wondering if having some kind of auto-update once a release on Go upstream project is planned/feasible?
Thanks
I was trying to figure out if it was possible to support SNS with this library, but am unfamiliar with SDK. With the link in the README being broken, it's hard to tell what can be supported, and what can't.
Would love more explanation on how the code is generated, and how to go about getting support for SNS if it's possible.
Cheers.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.