iam2kotlin

a Kotlin mapping for AWS IAM

License

License

Categories

Categories

Kotlin Languages
GroupId

GroupId

com.typedpath
ArtifactId

ArtifactId

iam2kotlin
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

iam2kotlin
a Kotlin mapping for AWS IAM
Project URL

Project URL

https://github.com/typedpath/iam2kotlin
Source Code Management

Source Code Management

https://github.com/typedpath/iam2kotlin

Download iam2kotlin

How to add to project

<!-- https://jarcasting.com/artifacts/com.typedpath/iam2kotlin/ -->
<dependency>
    <groupId>com.typedpath</groupId>
    <artifactId>iam2kotlin</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.typedpath/iam2kotlin/
implementation 'com.typedpath:iam2kotlin:1.0.0'
// https://jarcasting.com/artifacts/com.typedpath/iam2kotlin/
implementation ("com.typedpath:iam2kotlin:1.0.0")
'com.typedpath:iam2kotlin:jar:1.0.0'
<dependency org="com.typedpath" name="iam2kotlin" rev="1.0.0">
  <artifact name="iam2kotlin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.typedpath', module='iam2kotlin', version='1.0.0')
)
libraryDependencies += "com.typedpath" % "iam2kotlin" % "1.0.0"
[com.typedpath/iam2kotlin "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.61

Project Modules

There are no modules declared in this project.

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

Versions

Version
1.0.0