Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithDataVolume

Method
📦 Aspire.Hosting.PostgreSQL v17.0.0
func (PostgresServerResource) WithDataVolume(options ...*WithDataVolumeOptions) PostgresServerResource

Signature

methodWithDataVolumebuilder
Adds a named volume for the data folder to a PostgreSQL container resource.
WithDataVolume(options ...*WithDataVolumeOptions) PostgresServerResource
options...*WithDataVolumeOptionsOptional settings, described under Options.

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

Name*stringThe name of the volume. Defaults to an auto-generated name based on the application and resource names.
IsReadOnly*boolA flag that indicates if this is a read-only volume.
PostgresServerResource

The resource builder.

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

Applies to

This method applies to the following types: