# WithDataVolume

- Module: [CommunityToolkit.Aspire.Hosting.LavinMQ](/reference/api/go/communitytoolkit.aspire.hosting.lavinmq.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: [`LavinMQContainerResource`](/reference/api/go/communitytoolkit.aspire.hosting.lavinmq/lavinmqcontainerresource.md)
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Configures a data volume for the LavinMQ container resource by specifying its name and read-only status.

## Definition

```go
func (LavinMQContainerResource) WithDataVolume(
    name string,
    options ...*WithDataVolumeOptions,
) LavinMQContainerResource
```

## Parameters

- `name` (`string`) -- The name of the data volume to be attached to the LavinMQ container resource.
- `options` (`...*WithDataVolumeOptions`) -- optional settings, see [Options](#options)

## Options

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

- `IsReadOnly` (`*bool`) -- Indicates whether the data volume should be mounted as read-only. Default is false.

## Returns

[`LavinMQContainerResource`](/reference/api/go/communitytoolkit.aspire.hosting.lavinmq/lavinmqcontainerresource.md) -- The updated resource builder for the LavinMQ container resource.

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

## Applies to

- [`LavinMQContainerResource`](/reference/api/go/communitytoolkit.aspire.hosting.lavinmq/lavinmqcontainerresource.md)
