gpartha

gpartha

Using aws-elixir and local Minio

Hi,

I am trying to use aws-elixir to access local Minio, any example code to refer to?

Thanks,
Partha

Marked As Solved

gpartha

gpartha

Managed to get it working. Documenting the steps for others. If there is better way, please do let me know

  1. Running Minio locally at 9000
  2. Have the Client created as follows

iex(1)> client = AWS.Client.create(“id”, “key”, “localhost”)
iex(2)> client = %{client | port: 9000}
iex(3)> client = %{client | proto: “http”}
iex(4)> client = %{client | endpoint: “localhost”}

#AWS.Client<
  region: "localhost",
  service: nil,
  endpoint: "localhost",
  proto: "http",
  port: 9000,
  http_client: {AWS.HTTPClient.Hackney, []},
  json_module: {AWS.JSON, []},
  xml_module: {AWS.XML, []},
  ...

Then used it to invoke

iex(5)> AWS.S3.create_bucket(client, “mybucket”, %{})

{:ok, nil,
 %{
   body: "",
   headers: [
     {"Server", "nginx/1.19.2"},
     {"Date", "Tue, 03 Oct 2023 22:30:21 GMT"},
     {"Content-Length", "0"},
     {"Connection", "keep-alive"},
     {"Accept-Ranges", "bytes"},
     {"Location", "/mybucket"},
     {"Strict-Transport-Security", "max-age=31536000; includeSubDomains"},
     {"Vary", "Origin"},
     {"Vary", "Accept-Encoding"},
     {"X-Amz-Id-2",
      "e0c385c033c4356721cc9121d3109c9b9bfdefb22fd2747078acd22328799e36"},
     {"X-Amz-Request-Id", "178AB98C4ABCE5E0"},
     {"X-Content-Type-Options", "nosniff"},
     {"X-Xss-Protection", "1; mode=block"}
   ],
   status_code: 200
 }}

Also Liked

kip

kip

ex_cldr Core Team

Happy to help. What have you tried?

linusdm

linusdm

I guess OP was using this module? AWS.Client — aws-elixir v1.0.13

The library has evolved since October 2023, but this module still exists. (Didn’t try to run this code though.)

Last Post!

almir-neto

almir-neto

Nice, this works fine to me too!

Where Next?

Popular in Questions Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49134 226
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44167 214
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New

We're in Beta

About us Mission Statement