MCPcopy Index your code
hub / github.com/99designs/iamy

github.com/99designs/iamy @v2.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.4.0 ↗ · + Follow
161 symbols 383 edges 21 files 17 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

IAMy

IAMy is a tool for dumping and loading your AWS IAM configuration into YAML files.

This allows you to use an Infrastructure as Code model to manage your IAM configuration. For example, you might use a github repo with a pull request model for changes to IAM config.

How it works

IAMy has two subcommands.

pull will sync IAM users, groups and policies from AWS to YAML files

push will sync IAM users, groups and policies from YAML files to AWS

For the push command, IAMy will output an execution plan as a series of aws cli commands which can be optionally executed. This turns out to be a very direct and understandable way to display the changes to be made, and means you can pick and choose exactly what commands get actioned.

Getting started

You can install IAMy on macOS with brew install iamy, or with the go toolchain go get -u github.com/99designs/iamy.

Because IAMy uses the aws cli tool, you'll want to install it first.

For configuration, IAMy uses the same AWS environment variables as the aws cli. You might find aws-vault an excellent complementary tool for managing AWS credentials.

Example Usage

$ iamy pull

$ find .
./myaccount-123456789/iam/user/joe.yml

$ mkdir -p myaccount-123456789/iam/user/foo

$ touch myaccount-123456789/iam/user/foo/bar.baz

$ cat << EOD > myaccount-123456789/iam/user/billy.blogs
Policies:
- arn:aws:iam::aws:policy/ReadOnly
EOD

$ iamy push
Commands to push changes to AWS:
        aws iam create-user --path /foo --user-name bar.baz
        aws iam create-user --user-name billy.blogs
        aws iam attach-user-policy --user-name billy.blogs --policy-arn arn:aws:iam::aws:policy/ReadOnly

Exec all aws commands? (y/N) y

> aws iam create-user --path /foo --user-name bar.baz
> aws iam create-user --user-name billy.blogs
> aws iam attach-user-policy --user-name billy.blogs --policy-arn arn:aws:iam::aws:policy/ReadOnly

Accurate cloudformation matching

By default, iamy will use a simple heuristic (does it end with an ID, eg -ABCDEF1234) to determine if a given resource is managed by cloudformation.

This behaviour is good enough for some cases, but if you want slower but more accurate matching pass --accurate-cfn to enumerate all cloudformation stacks and resources to determine exactly which resources are managed.

Inspiration and similar tools

  • https://github.com/percolate/iamer
  • https://github.com/hashicorp/terraform

Extension points exported contracts — how you extend this code

AwsResource (Interface)
(no doc) [1 implementers]
iamy/models.go

Core symbols most depended-on inside this repo

Add
called by 60
iamy/awsdiff.go
String
called by 28
iamy/awsdiff.go
JsonString
called by 15
iamy/policy.go
policyArnFromString
called by 12
iamy/models.go
stringSetDifference
called by 10
iamy/slice.go
isSkippableManagedResource
called by 8
iamy/aws.go
unmarshalYamlFile
called by 6
iamy/yaml.go
writeResource
called by 6
iamy/yaml.go

Shape

Method 79
Function 52
Struct 26
TypeAlias 3
Interface 1

Languages

Go100%

Modules by API surface

iamy/models.go46 symbols
iamy/awsdiff.go20 symbols
iamy/aws.go15 symbols
iamy/s3.go12 symbols
iamy/yaml.go11 symbols
iamy/policy.go9 symbols
iamy/cfn.go8 symbols
push.go6 symbols
iamy/awsaccountid.go6 symbols
iamy/iam.go5 symbols
iamy.go5 symbols
iamy/yaml_test.go3 symbols

For agents

$ claude mcp add iamy \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page