Skip to content

typedpath/iam2kotlin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iam2kotlin

this is a kotlin mapping for AWS IAM
The data is taken from https://github.com/widdix/complete-aws-iam-reference/tree/master/services which is presented at https://iam.cloudonaut.io/ which ultimately derives from https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_actions-resources-contextkeys.html

Action Mappings

e.g.
LogsAction.CreateLogGroup.id => "logs:CreateLogGroup"
S3Action.All => "s3:*"

Resource Mapping

e.g.
S3Action.PutObjectTagging.byBucketnameKeyname("mybucket", "*") => "arn:aws:s3:::mybucket/*"

IamPolicy model

    val codeBuildPolicyDocument = IamPolicy {
        statement {
            action ( LogsAction.CreateLogGroup)
            action ( LogsAction.CreateLogStream)
            action ( LogsAction.PutLogEvents)
            effect = IamPolicy.EffectType.Allow
            resource ( IamPolicy.Resource("*"))
        }
        statement {
            action ( CodecommitAction.GitPull)
            effect = IamPolicy.EffectType.Allow
            resource (CodecommitAction.GitPush.byRegionAccountRepositoryname("us-east-1", "987654321", "myrepo")
)
        }
        statement {
            action ( S3Action.PutObject)
            action ( S3Action.GetObject)
            action ( S3Action.GetObjectVersion)
            effect = IamPolicy.EffectType.Allow
            resource (S3Action.PutObject.byBucketnameKeyname("mybucket", "*"))
        }
    }

maven artifact

<dependency>
  <groupId>com.typedpath</groupId>
  <artifactId>iam2kotlin</artifactId>
  <version>1.0.0</version>
</dependency>

TODO

Conditions

About

Kotlin mapping for Iam Actions and Resources

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages