We're going in the same direction but we're using a bit different route: we started extending IaC with typed connections between services. For example - if you declare in your app that you want to consume API of another app, for example you say:
case class ServerConfig(
productServiceRef: OpenApiServiceReference[ProductsEndpoints.type]
) derives JsonReader
then in your code you can do:
lazy val productService = config.productServiceRef.toRequestThrowErrors
and then
val request = productService.getNutritionInfosEndpoint(productIds)
val productNutritionList = request.send(backend).body
and this will mark your service as impossible to deploy without providing a reference to service that actually serves a matching API in infra code:
val recipesApp = RecipesService("recipes-app",
RecipesServiceArgs(
// ...
runConfig = RecipesServerConfig(
productService = productApp.asServiceRef[example.products.ProductsEndpoints]
)
)
)
These infra entities get generated based on the shapes of what the service code demands and the metadata gets compiled into artifacts so you can even store jars in artifactory or docker images in a registry and they will still get typechecked at deployment compilation time.
Automatic resolution of policies is coming after this typed cross-service interface checking work is done but the true end goal for us is to have end-to-end typechecked cloud systems. I'm writing a blogpost on this as we speak. Should I notify you when it's done?