# WithDataVolume

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

Adds a named volume for Posta's filesystem-backed attachment data.

## Definition

```go
func (PostaResource) WithDataVolume(options ...*WithDataVolumeOptions) PostaResource
```

## 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`) -- Indicates whether the volume should be read-only.

## Returns

[`PostaResource`](/reference/api/go/communitytoolkit.aspire.hosting.posta/postaresource.md) -- A reference to the `IResourceBuilder` for further resource configuration.

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

## Applies to

- [`PostaResource`](/reference/api/go/communitytoolkit.aspire.hosting.posta/postaresource.md)
