Skip to content
A template project for creating cloudwatch event driven applications
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
img
project
src/main/g8
.gitignore
.sbtopts
README.md
build.sbt
version.sbt

README.md

Logo image

sam-cloudwatch-seed.g8

A template project for quickly creating CloudWatch event handlers.

For more information see sbt-sam

Usage

Create a new template project by typing:

sbt new dnvriend/sam-cloudwatch-seed.g8

Usage

  • To deploy the project type samDeploy
  • To remove the project type samRemove
  • To get deployment information like available endpoints and stack information, type samInfo

Event Handler Configuration

Lets create the following event handler for the CloudWatch event source:

@CloudWatchConf(
  pattern =
    """{
    "source": [
      "aws.codebuild"
    ],
    "detail": {
      "build-status": [
        "FAILED"
      ],
      "project-name": [
        "SBT-SAM"
      ]
    }
  }""")
class CloudWatchLambda extends CloudWatchEventHandler {
  override def handle(event: CloudWatchEvent, ctx: SamContext): Unit = {
    println(s"Triggered by the following CloudWatchEvent: '$event'")
  }
}

Have fun!

You can’t perform that action at this time.