# FlociGcpContainerResource.WithDataVolume

- Module: [CommunityToolkit.Aspire.Hosting.Floci](/reference/api/go/communitytoolkit.aspire.hosting.floci.md)
- Defined on: [FlociGcpContainerResource](/reference/api/go/communitytoolkit.aspire.hosting.floci/flocigcpcontainerresource.md)
- Version: `13.6.1`
- Kind: `method`

Configures a named data volume for persistent Floci GCP state.

## Definition

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

## Signature

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

## Parameters

- `name` (`string`) -- The name of the volume to mount.
- `options` (`...*WithDataVolumeOptions`) -- optional settings, see [Options](#options)

## Options

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

- `IsReadOnly` (`*bool`) -- Whether the volume should be read-only.

## Returns

[`FlociGcpContainerResource`](/reference/api/go/communitytoolkit.aspire.hosting.floci/flocigcpcontainerresource.md) -- A reference to the `IResourceBuilder` for further configuration.

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

## Defined on

- [FlociGcpContainerResource](/reference/api/go/communitytoolkit.aspire.hosting.floci/flocigcpcontainerresource.md) -- `handle`
