Version Matrix

Ciris AWS Secrets Manager

AWS Secrets Manager support for Ciris.

This module is heavily derived from the existing Ciris SSM module.

Getting Started

To get started with sbt, simply add the following lines to your build.sbt file.

libraryDependencies += "com.ovoenergy" %% "ciris-aws-secretsmanager" % "3.0.1"

The library is published for Scala 2.12 and 2.13.

Example

import cats.effect.{Blocker, ExitCode, IO, IOApp}
import cats.implicits._
import ciris._
import ciris.aws.secretsmanager._

final case class Passwords(
  dbPassword: Secret[String],
  apiKey: Secret[String],
)

object Main extends IOApp {
  def run(args: List[String]): IO[ExitCode] = {
      val password =
        for {
          region <- env("AWS_REGION").as[Region].default(Region.EU_WEST_1)
          secret <- secrets(region)
          passwords <- (
              secret("db-password-prod"),
              secret("api-key")
            ).parMapN { (dbPassword, apiKey) =>
              Passwords(
                dbPassword = dbPassword,
                apiKey = apiKey
              )
            }
        } yield passwords

      password.load[IO].as(ExitCode.Success)
    }
}

Release

To release a new version, use the following command.

$ sbt release