MongoDBServerResource.WithKeyFile

Method
📦 Aspire.Hosting.MongoDB v17.0.0
type MongoDBServerResource interface {
// ... omitted for brevity
WithKeyFile(
keyValue ExpressionValue,
options ...*WithKeyFileOptions,
) 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 ExpressionValue,
options ...*WithKeyFileOptions,
) MongoDBServerResource
keyValueExpressionValueThe 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.
options...*WithKeyFileOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithKeyFileOptions argument.

KeyFilePath*stringThe absolute path the keyfile is mounted at inside the container, which has to include a file name. Defaults to /etc/rs.key.
MongoDBServerResource

The resource builder.

Returns a handle; failures surface later via Err().

Defined on

This method is defined on the following type: