Skip to content

Commit

Permalink
Merge pull request #23 from onema/feature-improvements
Browse files Browse the repository at this point in the history
Updating cloud trail event and adding new one for lambda functions.
  • Loading branch information
onema authored Jan 15, 2019
2 parents 26fb5e5 + 634fe9c commit b67481c
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ThisBuild / organization := "io.onema"
ThisBuild / version := "0.1.1"
ThisBuild / version := "0.2.0"
ThisBuild / scalaVersion := "2.12.7"
ThisBuild / parallelExecution in Test := false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

package io.onema.userverless.events

object LogRegistration {
object CloudTrailCloudWatchEvent {
case class Attributes(mfaAuthenticated: String, creationDate: String)

case class SessionContext(attributes: Attributes)
Expand Down Expand Up @@ -50,7 +50,7 @@ object LogRegistration {

case class Resources()

case class LogCreationEvent(
case class CloudWatchLogEvent(
version: Option[String],
id: Option[String],
detailType: Option[String],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/**
* This file is part of the ONEMA uServerless Package.
* For the full copyright and license information,
* please view the LICENSE file that was distributed
* with this source code.
*
* copyright (c) 2019, Juan Manuel Torres (http://onema.io)
*
* @author Juan Manuel Torres <[email protected]>
*/

package io.onema.userverless.events

object CloudTrailLambdaEvent {
case class Attributes(mfaAuthenticated: String, creationDate: String)

case class SessionContext(attributes: Attributes)

case class UserIdentity(
`type`: Option[String],
principalId: Option[String],
arn: Option[String],
accountId: Option[String],
accessKeyId: Option[String],
userName: Option[String],
sessionContext: Option[SessionContext],
invokedBy: Option[String]
)

case class RequestParameters(
functionName: Option[String],
kMSKeyArn: Option[String],
role: Option[String],
memorySize: Option[Double],
code: Option[Code],
timeout: Option[Double],
environment: Option[Code],
deadLetterConfig: Option[Code],
tracingConfig: Option[TracingConfig],
publish: Option[Boolean],
description: Option[String],
handler: Option[String],
runtime: Option[String]
)

case class Detail(
eventVersion: Option[String],
userIdentity: Option[UserIdentity],
eventTime: Option[String],
eventSource: Option[String],
eventName: Option[String],
awsRegion: Option[String],
errorCode: Option[String],
errorMessage: Option[String],
sourceIPAddress: Option[String],
userAgent: Option[String],
requestParameters: Option[RequestParameters],
responseElements: Option[ResponseElements],
requestID: Option[String],
eventID: Option[String],
eventType: Option[String],
apiVersion: Option[String]
)

case class Resources()
case class Code()
case class TracingConfig(mode: String)
case class Environment()
case class ResponseElements(
role: Option[String],
revisionId: Option[String],
handler: Option[String],
memorySize: Option[Double],
runtime: Option[String],
functionArn: Option[String],
functionName: Option[String],
codeSize: Option[Double],
version: Option[String],
tracingConfig: Option[TracingConfig],
description: Option[String],
lastModified: Option[String],
codeSha256: Option[String],
environment: Option[Environment],
timeout: Option[Double]
)

case class LambdaEvent(
version: Option[String],
id: Option[String],
detailType: Option[String],
source: Option[String],
account: Option[String],
time: Option[String],
region: Option[String],
resources: Option[List[Resources]],
detail: Detail
)
}

0 comments on commit b67481c

Please sign in to comment.