{"id":22725443,"url":"https://github.com/ovotech/ciris-aws-ssm","last_synced_at":"2025-04-13T20:33:21.721Z","repository":{"id":24396394,"uuid":"101386482","full_name":"ovotech/ciris-aws-ssm","owner":"ovotech","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-28T10:37:21.000Z","size":78,"stargazers_count":11,"open_issues_count":27,"forks_count":6,"subscribers_count":40,"default_branch":"master","last_synced_at":"2023-06-28T11:27:32.860Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ovotech.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2017-08-25T09:03:41.000Z","updated_at":"2023-05-14T15:38:47.000Z","dependencies_parsed_at":"2023-02-18T18:46:17.016Z","dependency_job_id":null,"html_url":"https://github.com/ovotech/ciris-aws-ssm","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovotech%2Fciris-aws-ssm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovotech%2Fciris-aws-ssm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovotech%2Fciris-aws-ssm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovotech%2Fciris-aws-ssm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ovotech","download_url":"https://codeload.github.com/ovotech/ciris-aws-ssm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229089204,"owners_count":18018391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T16:10:44.833Z","updated_at":"2024-12-10T16:10:45.477Z","avatar_url":"https://github.com/ovotech.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Ciris AWS SSM\n\n[Amazon EC2 Systems Manager](https://aws.amazon.com/ec2/systems-manager/?nc2=h_m1) (also known as Simple Systems Manager or SSM) support for [Ciris](https://cir.is).\n\nEnables us to load parameters of type \"string\" or \"secure string\" from the SSM parameter store.\n\nSee [this blog](https://medium.com/@mda590/simple-secrets-management-via-aws-ec2-parameter-store-737477e19450) for more information about using SSM's parameter store to manage secrets.\n\n### Getting Started\n\nTo get started with [sbt](https://www.scala-sbt.org), simply add the following lines to your `build.sbt` file.\n\n```scala\nresolvers += \"Kaluza artifactory\" at \"https://kaluza.jfrog.io/artifactory/maven\"\n\nlibraryDependencies += \"com.ovoenergy\" %% \"ciris-aws-ssm\" % \"LATEST_VERSION\"\n```\n\nThe library is published against cats effect 3, for both Scala 2.12 and 2.13.\n\n### Usage\n\n```scala\nimport cats.effect.{IO, IOApp}\nimport cats.implicits._\nimport ciris.Secret\nimport ciris.aws.ssm._\n\nobject Main extends IOApp.Simple {\n\n  final case class Config(\n     username: String,\n     password: Secret[String],\n     port: Int,\n     apiKey: Option[String]\n  )\n\n  def loadConfig: IO[Config] = \n    params[IO].flatMap { param =\u003e\n      (\n        param(\"/myapp/password\").secret,\n        param(\"/myapp/port\").as[Int],\n        param(\"/myapp/api-key\").option\n        ).parMapN { (password, port, apiKey) =\u003e\n        Config(username = \"Dave\", password = password, port = port, apiKey = apiKey)\n      }\n    }.load\n\n  override def run: IO[Unit] =\n    loadConfig.flatMap(cfg =\u003e IO.println(s\"Config loaded: $cfg\"))\n\n}\n```\nThe `params[F]` function returns a ciris `ConfigValue` loader.  On invocation of the (flatMapped) `param(name)`\nfunction, this loader will make a `GetParameterRequest` to the underlying\n[SsmAsyncClient](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/ssm/SsmAsyncClient.html),\n(decrypting the value if encrypted).\n\n\nThe `params[F]` function uses the AWS SDK's default `SsmAsyncClient` configuration, but there are alternate\nfunctions for construction:\n\n```scala\nimport ciris.aws.ssm._\nimport cats.effect.IO\nimport software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider\nimport software.amazon.awssdk.regions.Region\nimport software.amazon.awssdk.services.ssm.SsmAsyncClient\n\n// use the default client, but with a region\nparams[IO](Region.EU_WEST_1)\n\n// also define a custom creds provider\nval customCreds = DefaultCredentialsProvider.builder().profileName(\"foo\").build()\nparams[IO](Region.EU_WEST_1, customCreds)\n\n// for most flexibility, configure the entire client yourself\nval client = SsmAsyncClient.builder().httpClient(customClient).build()\nparams[IO](client)\n```\n\n### Release\n\nTo release a new version use the following commands.\n\n```\n$ ./tag.sh\n$ sbt +publish\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovotech%2Fciris-aws-ssm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovotech%2Fciris-aws-ssm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovotech%2Fciris-aws-ssm/lists"}