https://github.com/eigo-mt-fuji/ex-awsconf
Elixir cli tool for generating aws-cli config
https://github.com/eigo-mt-fuji/ex-awsconf
aws docker elixir elixir-lang
Last synced: about 1 year ago
JSON representation
Elixir cli tool for generating aws-cli config
- Host: GitHub
- URL: https://github.com/eigo-mt-fuji/ex-awsconf
- Owner: Eigo-Mt-Fuji
- License: other
- Created: 2020-02-28T06:20:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-01T05:57:12.000Z (over 6 years ago)
- Last Synced: 2025-03-10T01:28:36.829Z (over 1 year ago)
- Topics: aws, docker, elixir, elixir-lang
- Language: Elixir
- Homepage:
- Size: 3.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# README
[](https://hex.pm/packages/ex_awsconf)
[](https://github.com/Eigo-Mt-Fuji/ex-awsconf/blob/master/LICENSE.md)
Simple cli-tool for generating aws config.
(and also generating AWS switch role login links markdown file.)
## Installation
If [available Docker](https://hub.docker.com/r/efgriver/ex-awsconf), the docker image can be installed by `docker pull efgriver/ex-awsconf` command on terminal.
If [available in Hex](https://hexdocs.pm/ex_awsconf), the package can be installed by adding `ex_awsconf` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:ex_awsconf, "~> 0.1.2"}
]
end
```
## Require
* elixir version 1.9 (or later)
* erlang version 21 (or later)
## How to use
* Clone Repository and Get Dependencies
```bash
$ git clone git@github.com:Eigo-Mt-Fuji/ex-awsconf.git
$ cd ex-awsconf/
$ mix deps.get
```
* Prepare csv file(with your aws accounts, save into files directory)
```bash
mkdir -p files/
cat < files/my-accounts.csv
"","","aws IAM-Role name","profile name(aws-cli )","display name(for browser)"
EOF
```
* Build escript
```bash
MIX_ENV=prod mix escript.build
```
* Prepare artifacts directory (results will be saved into this directory.)
```bash
rm -rf ./artifacts
mkdir -p ./artifacts
```
* Execute
```bash
./ex_awsconf ./files ./artifacts json arn:aws:iam:::mfa/
```
- with Docker.
```bash
docker run \
-v $(pwd)/files:/usr/local/src/files:ro \
-v $(pwd)/artifacts:/usr/local/src/artifacts:rw \
efgriver/ex-awsconf:latest \
/usr/local/src/files /usr/local/src/artifacts \
arn:aws:iam:::mfa/ \
```
* Execute Output is JSON format like following.
```json
{
"artifacts": [
{
"aws_config": "./artifacts/my-accounts/config",
"src": "./files/my-accounts.csv",
"switch_role_link_md": "./artifacts/my-accounts/switch_role_link.md"
},
..
],
"status": "ok"
}
```
* aws-cli's config, markdown(for aws switch-role login) should be exists (per each csv file in files directory)
```bash
$ find -type f $(pwd)/artifacts
/Users/fujikawa/Documents/git/ex-awsconf/artifacts/my-accounts/config
/Users/fujikawa/Documents/git/ex-awsconf/artifacts/my-accounts/switch_role_link.md
```