# PostaResource.WithDataVolume

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

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

## Definition

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

## Signature

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

## Defined on

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