ecret-rotation.aws-parameterstore-sdk-v1_3.10.0.0.source-code.AwsSdkV1.scala Maven / Gradle / Ivy
package com.gu.play.secretrotation.aws.parameterstore
import com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagement
import com.amazonaws.services.simplesystemsmanagement.model.GetParametersRequest
import scala.jdk.CollectionConverters._
case class AwsSdkV1(ssmClient: AWSSimpleSystemsManagement) extends MinimalAwsSdkWrapper {
override def fetchValues(parameters: Seq[String]): Iterable[ParameterValue] = ssmClient.getParameters(
new GetParametersRequest()
.withWithDecryption(true)
.withNames(parameters.asJavaCollection)
).getParameters.asScala.map(p => ParameterValue(p.getValue, Metadata(p.getVersion, p.getLastModifiedDate.toInstant)))
}