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

Where Next?

Popular in Questions Top

Tee
can someone please explain to me how Enum.reduce works with maps
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a &gt; b) do {:ok, "a"} end if (a &lt; b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39297 209
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New

We're in Beta

About us Mission Statement