# LavinMQContainerResource.WithDataVolume

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

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

## Definition

```go
type LavinMQContainerResource interface {
    // ... omitted for brevity
    WithDataVolume(
        name string,
        options ...*WithDataVolumeOptions,
    ) LavinMQContainerResource
}
```

## Signature

```go
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()`.

## Defined on

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