Code Monkey home page Code Monkey logo

ciris-aws-secretsmanager's Introduction

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.

For Cats Effect 3:

libraryDependencies += "io.github.keirlawson" %% "ciris-aws-secretsmanager" % "7.0.0"

The library is published for Scala 2.12, 2.13 and 3.3.

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(key = "db-password-prod", version = "1.0"),
              secret(key = "api-key", version = "1.0")
            ).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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.