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 Libraries Top

josevalim
Hi everyone, We would like to announce that Plataformatec is working on a new MySQL driver called MyXQL. Our goal is to eventually integ...
New
Qqwy
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects. Core ideas Type- and function specifications are const...
336 13801 100
New
kip
Image is an image processing library for Elixir. It is based upon the fabulous vix library that provides a libvips wrapper for Elixir. I...
574 16576 179
New
praveenperera
FastRSS Parse RSS feeds very quickly: This is rust NIF built using rustler Uses the RSS rust crate to do the actual RSS parsing Speed...
New
Antrater
Hi everyone! I’m thrilled to announce a huge thing. We have been developing Elixir Moon Design System for quite a while. We are finally ...
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
New
bryanjos
Hi, I wanted share a small library we at Revelry Labs made for rendering react components from the server side. There are instructions fo...
New
Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
New
maltoe
Hello! Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New
mplatts
With HEEX released we decided to start a components library using Tailwind CSS - check it out here: Petal Components. We also have a boi...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
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
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
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
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
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

Sub Categories:

We're in Beta

About us Mission Statement