# RedPandaServerResource.WithDataVolume

- Module: [CommunityToolkit.Aspire.Hosting.RedPanda](/reference/api/go/communitytoolkit.aspire.hosting.redpanda.md)
- Defined on: [RedPandaServerResource](/reference/api/go/communitytoolkit.aspire.hosting.redpanda/redpandaserverresource.md)
- Version: `13.6.1`
- Kind: `method`

Adds a named volume for the data folder to a Redpanda container resource.

## Definition

```go
type RedPandaServerResource interface {
    // ... omitted for brevity
    WithDataVolume(options ...*WithDataVolumeOptions) RedPandaServerResource
}
```

## Signature

```go
WithDataVolume(options ...*WithDataVolumeOptions) RedPandaServerResource
```

## Parameters

- `options` (`...*WithDataVolumeOptions`) -- optional settings, see [Options](#options)

## Options

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

- `Name` (`*string`) -- The name of the volume. Defaults to an auto-generated name based on the application and resource names.
- `IsReadOnly` (`*bool`) -- A flag that indicates if this is a read-only volume.

## Returns

[`RedPandaServerResource`](/reference/api/go/communitytoolkit.aspire.hosting.redpanda/redpandaserverresource.md) -- A reference to the `IResourceBuilder`.

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

## Defined on

- [RedPandaServerResource](/reference/api/go/communitytoolkit.aspire.hosting.redpanda/redpandaserverresource.md) -- `handle`
