Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin-chappell committed Jan 22, 2024
1 parent 6e21a61 commit b0f930b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions app/load/AppComponents.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ class AppComponents(context: Context)

private val region = Region.EU_WEST_1

private val stage = context.initialConfiguration.getOptional[String]("stage").getOrElse("DEV")
private val stage = {
val x = context.initialConfiguration.getOptional[String]("stage").getOrElse("DEV")
println(s"*** Stage: $x")
x
}

private lazy val secretKey: String = {
val request = GetParameterRequest.builder
Expand All @@ -28,11 +32,16 @@ class AppComponents(context: Context)
}
}

override def configuration: Configuration =
override def configuration: Configuration = {
if (stage == "DEV")
super.configuration
else
Configuration("play.http.secret.key" -> secretKey).withFallback(super.configuration)
else {
println("*** Using SSM")
val y = secretKey
println(s"*** Got secret key: ${y.length} chars")
Configuration("play.http.secret.key" -> y).withFallback(super.configuration)
}
}

lazy val healthCheckController = new controllers.HealthCheckController(controllerComponents)
lazy val router: Routes = new Routes(httpErrorHandler, healthCheckController)
Expand Down

0 comments on commit b0f930b

Please sign in to comment.