Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

AddSecret

Method
📦 Aspire.Hosting.Docker v17.0.0
func (ComposeFile) AddSecret(
name string,
options ...*AddSecretOptions,
) ComposeFile

Signature

methodAddSecret
Adds a top-level secret definition to the Docker Compose file.
AddSecret(
name string,
options ...*AddSecretOptions,
) ComposeFile
namestringThe name of the secret.
options...*AddSecretOptionsOptional settings, described under Options.

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

File*stringThe path to the secret file.
External*boolA value indicating whether the secret is managed outside the generated Compose file.
Configurefunc(obj Secret)callbackAn optional callback for further secret customization.
ComposeFile

The updated Docker Compose file.

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

Applies to

This method applies to the following types: