Giter Site home page Giter Site logo

aws-elixir's People

Contributors

bbtb1982 avatar brentonannan avatar cblavier avatar coryodaniel avatar hashnuke avatar jkakar avatar pauloancheta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-elixir's Issues

Error Message for Rekognition.detect_faces()

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"

successful request

 Client |> AWS.Rekognition.detect_faces(%{Image: %{S3Object: %{Bucket: "some_bucket", Name: "some_name" }}))

Previous to this I was getting this error:

{: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.

  • simple query example
  • error reponse from HTTPoison, Poison Encoder, and AWS CLI just enough to enlighten and give direction on what may be causing an error
  • update options parsing errors to be more descriptive.

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.

Using aws-elixir in a rebar3 Erlang project

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.

Temporary IAM security credentials won't work

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.

http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#UsingTemporarySecurityCredentials)

As an alternative it is possible to use https://github.com/erlcloud/erlcloud which allows the token to be passed.

ec2 client not available?

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?

Support Mechanical Turk sandbox mode

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.

problems with AWS.CloudSearch.Domain.upload_documents

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.

EC2 and S3?

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.)

Example fails to run

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

Error during compile project

Hi,

  • Elixir version (elixir -v):
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

Need HTTPoison

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

Link to AWS SDK for Go in README is broken

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.