abitdodgy

abitdodgy

New ExAws IAM service module

I wrote an IAM service module for ExAws. You can find it on GitHub.

It’s a work in progress, but I think I have the internal API figured out. Currently, the following services are supported:

* CreateAccessKey
* CreateUser
* DeleteAccessKey
* DeleteUser
* GetAccessKeyLastUsed
* GetUser
* ListAccessKeys
* ListUsers
* UpdateAccessKey
* UpdateUser

The API aims to be easy to use. For example:

  1. You can pass params as atoms and the lib converts them into the AWS IAM query format.
  2. Each operation has its own parser that translates the XML response into its equivalent map in Elixir.
  3. Helper functions are available to convert some responses into a data structure.
op = Iam.create_user("my_user", path: "/my/path/")

IO.inspect(op)
%ExAws.Operation.Query{
  action: "CreateUser",
  params: %{
    "Action" => "CreateUser",
    "Path" => "/my/path/",
    "UserName" => "my_user",
    "Version" => "2010-05-08"
  },
  parser: &ExAws.Iam.Parsers.User.create/2,
  path: "/my/path/",
  service: :iam
}

user = op |> ExAws.request() |> Iam.to_user()

IO.inspect(user)
%ExAws.Iam.User{
  arn: "arn:aws:iam::085326204011:user/my/path/my_user",
  create_date: "2018-10-18T15:47:08Z",
  path: "/my/path/",
  user_id: "AIDAIH3RMDWGIGEXAMPLE",
  username: "my_user"
}

Extending the library is straightforward. For example, adding a new operation is as easy as:

def create_group(name, opts \\ []) do
  :create_group
  |> to_params(opts, [group_name: name])
  |> to_op() 
end
Iam.create_group("my_group", path: "/my/path/")

You may need to write a parser, and, obviously, some tests, but it’s as easy as that.

I’ve not released the lib yet as I’d like to wait for some feedback before doing so.

Where Next?

Popular in Announcing Top

tmbb
PhoenixWS - Websockets over Phoenix Channels Source code on Github here: GitHub - tmbb/phoenix_ws: Websockets implemented over Phoenix Ch...
New
pkrawat1
Presenting Aviacommerce, open source e-commerce platform in Elixir Aviacommerce is an open source e-commerce platform in Elixir. We at...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 10167 134
New
alisinabh
Hey everyone i’ve developed a library for Jalaali calendar for elixir which supports converting Gregorian dates to Jalaali and vice vers...
New
woutdp
Hi! I wanted to introduce my latest project LiveSvelte. It allows you to render Svelte inside LiveView with end-to-end reactivity. It’s ...
New
tmbb
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps: bureaucrat - which contains a bunch ...
New
RobertDober
Earmark is a pure-Elixir Markdown converter. It is intended to be used as a library (just call Earmark.as_html), but can also be used as...
239 12560 134
New
michalmuskala
Another small library today. PersistentEts Hex: persistent_ets | Hex GitHub: GitHub - michalmuskala/persistent_ets · GitHub Ets table ...
New
michalmuskala
Hello everybody. I have just released Jason - a new JSON library. You might be wondering, why do we need a new library? The primary foc...
New
zachdaniel
Ash Framework What is Ash? Ash Framework is a declarative, resource-oriented application development framework for Elixir. A resource can...
New

Other popular topics Top

albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
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
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
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
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 47930 226
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

We're in Beta

About us Mission Statement