import * as azure from "@pulumi/azure" ; import * as k8s from "@pulumi/kubernetes" ; import * as pulumi from "@pulumi/pulumi" ; import { config } from "./config" ; import * as mongoHelpers from "./mongoHelpers" ; const name = pulumi . getProject ( ) ; const resourceGroup = new azure . core . ResourceGroup ( name ) ; const cosmosdb = new azure . cosmosdb . Account ( "k8s-az-mongodb" , { resourceGroupName : resourceGroup . name , kind : "MongoDB" , consistencyPolicy : { consistencyLevel : "Session" , } , offerType : "Standard" , geoLocations : [ { location : resourceGroup . location , failoverPriority : 0 } , ] , } ) ; const provider = new k8s . Provider ( `${ name }-aks` , { kubeconfig : config . kubeconfig , } ) ; const mongoConnStrings = new k8s . core . v1 . Secret ( "mongo-secrets" , { metadata : { name : "mongo-secrets" , namespace : config . appsNamespaceName } , data : mongoHelpers . parseConnString ( cosmosdb . connectionStrings ) , } , { provider } ) ;