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

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

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
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
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Codball
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
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

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New

We're in Beta

About us Mission Statement