MongoDBServerResource.withKeyFile

Method
📦 Aspire.Hosting.MongoDB v17.0.0
interface MongoDBServerResource {
// ... omitted for brevity
withKeyFile(
keyValue: IExpressionValue,
keyFilePath?: string): MongoDBServerResource;
}

Signature

methodwithKeyFilebuilder
Sets up a keyfile for internal authentication between members of a MongoDB replica set, with the specified `keyValue` as the content of the file.
withKeyFile(
keyValue: IExpressionValue,
keyFilePath?: string): MongoDBServerResource
keyValueIExpressionValueThe content of the keyfile. This is a shared secret: every member of the replica set has to be given the same value, and anything holding it can authenticate as a member of the cluster.
keyFilePathstringoptional= /etc/rs.keyThe absolute path the keyfile is mounted at inside the container, which has to include a file name. Defaults to `/etc/rs.key`.
MongoDBServerResource

Defined on

This method is defined on the following type: