simonjpegg / sbt-aws

An SBT plugin for creating AWS resources

GitHub

SBT-AWS

A collection of SBT plugins for creating AWS resources.

EcrPlugin

An SBT plugin for managing Docker images within Amazon ECR.

Commands

  • Create ECR repositories using ecr:createRepository
  • Login to the remote registry using ecr:login
  • Push local images using ecr:push

Installation

Add the following to your project/plugins.sbt file:

addSbtPlugin("org.antipathy" % "sbt-aws" % "0.3")

Configuration

Add the following settings to your build.sbt. The commands below assume a docker image has been built that matches your project name:

import com.amazonaws.regions.Regions
import org.antipathy.sbtaws._

enablePlugins(EcrPlugin)

ecrRegion in Ecr := Regions.EU_WEST_1
ecrRepository in Ecr := ECRRepository(name.value)
ecrDockerImage in Ecr := DockerImage(
  name.value,
  Seq(DockerTag("latest"), DockerTag(version.value))
)

each of ecrRegion, ecrRepository and ecrDockerImage do not provide any default values, so must be set.

S3Plugin

An SBT plugin for creating and destroying S3 Buckets in AWS.

Commands

  • Create S3 buckets using s3:createBuckets
  • Delete S3 buckets using s3:deleteBuckets

Installation

Add the following to your project/plugins.sbt file:

addSbtPlugin("org.antipathy" % "sbt-aws" % "0.3")

Configuration

Add the following settings to your build.sbt and change as required.

import com.amazonaws.regions.Regions
import org.antipathy.sbtaws._

enablePlugins(S3Plugin)

s3Region in S3 := Regions.EU_WEST_1
s3Buckets in S3 := Seq(
	S3Bucket("sbtawsbucket1"), 
	S3Bucket("sbtawsbucket2")
  )

The following defaults have been set:

  • s3Region : EU_WEST_1
  • s3Buckets : an empty collection.

DynamoPlugin

An SBT plugin for creating and destroying Tables in Dynamo0.3DB.

Commands

  • Create tables using dynamodb:createTables
  • Drop tables using dynamodb:dropTables

Installation

Add the following to your project/plugins.sbt file:

addSbtPlugin("org.antipathy" % "sbt-aws" % "0.3")

Configuration

Add the following settings to your build.sbt and change as required.

import com.amazonaws.regions.Regions
import org.antipathy.sbtaws._

enablePlugins(DynamoPlugin)

dynamoDBRegion in DynamoDB := Regions.EU_WEST_1
dynamoDBTables in DynamoDB := Seq(
  DynamoTable(name = "TestTable1",
              attributes = DynamoAttributes(Map("attr1" -> "S")),
              keySchemas = DynamoKeySchemas(Map("attr1" -> "HASH")),
              readUnits = DynamoReadUnits(5),
              writeUnits = DynamoWriteUnits(5)),
  DynamoTable(name = "TestTable2",
              attributes = DynamoAttributes(Map("attr1" -> "S")),
              keySchemas = DynamoKeySchemas(Map("attr1" -> "HASH")),
              readUnits = DynamoReadUnits(5),
              writeUnits = DynamoWriteUnits(5))
)

Useful links:

The following defaults have been set:

  • dynamoDBRegion : EU_WEST_1
  • dynamoDBTables : an empty collection.

RDSPlugin

An SBT plugin for creating and destroying RDS instances in AWS.

Commands

  • Create RDS instances using rds:createInstances
  • Delete RDS instances using rds:deleteInstances
  • List RDS instances using rds:listInstances

Installation

Add the following to your project/plugins.sbt file:

addSbtPlugin("org.antipathy" % "sbt-aws" % "0.3")

Configuration

Add the following settings to your build.sbt and change as required.

import com.amazonaws.regions.Regions
import org.antipathy.sbtaws._

enablePlugins(RDSPlugin)
rdsRegion in Rds := Regions.EU_WEST_1
rdsInstances in Rds := Seq(
  RDSInstanceDetails(
    allocatedStorageGB = 20,
    instanceName = "TestInstance",
    instanceType = "db.t2.small",
    instanceEngine = "postgres",
    isMultiAZ = false,
    masterUsername = "someuser",
    masterPassword = "somepass",
    publiclyAccessible = false,
    databaseName = Some("testDb"),
    storageType = "gp2",
    securityGroups = Seq()
  )
)

The following defaults have been set:

  • rdsRegion : EU_WEST_1
  • rdsInstances : an empty collection.

...

More to come...