# ValkeyResource

- Module: [Aspire.Hosting.Valkey](/reference/api/go/aspire.hosting.valkey.md)
- Version: `17.0.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

A resource that represents a Valkey resource independent of the hosting model.

## Definition

```go
type ValkeyResource interface {
    ExpressionValue
    IComputeResource
    Resource
    ResourceWithArgs
    ResourceWithConnectionString
    ResourceWithEndpoints
    ResourceWithEnvironment
    ResourceWithWaitSupport
}
```

## Embeds

- `ExpressionValue`
- `IComputeResource`
- `Resource`
- `ResourceWithArgs`
- `ResourceWithConnectionString`
- `ResourceWithEndpoints`
- `ResourceWithEnvironment`
- `ResourceWithWaitSupport`

## Properties

- `ConnectionStringExpression`: `*ReferenceExpression` `get` -- Gets the connection string expression for the Valkey server.
- `Host`: `EndpointReferenceExpression` `get` -- Gets the host endpoint reference for this resource.
- `PasswordParameter`: `ParameterResource` `get` -- Gets the parameter that contains the Valkey server password.
- `Port`: `EndpointReferenceExpression` `get` -- Gets the port endpoint reference for this resource.
- `PrimaryEndpoint`: `EndpointReference` `get` -- Gets the primary endpoint for the Valkey server.
- `ResourceTypeDisplayName`: `string` `get` -- Gets the ResourceTypeDisplayName property
- `UriExpression`: `*ReferenceExpression` `get` -- Gets the connection URI expression for the Valkey server.

## Methods

- [WithDataBindMount](/reference/api/go/aspire.hosting.valkey/valkeyresource/withdatabindmount.md) -- `method` -- Adds a bind mount for the data folder to a Valkey container resource and enables Valkey persistence.
  ```go
  WithDataBindMount(source string, options ...*WithDataBindMountOptions) ValkeyResource
  ```
- [WithDataVolume](/reference/api/go/aspire.hosting.valkey/valkeyresource/withdatavolume.md) -- `method` -- Adds a named volume for the data folder to a Valkey container resource and enables Valkey persistence.
  ```go
  WithDataVolume(options ...*WithDataVolumeOptions) ValkeyResource
  ```
- [WithPersistence](/reference/api/go/aspire.hosting.valkey/valkeyresource/withpersistence.md) -- `method` -- Configures a Valkey container resource for persistence.
  ```go
  WithPersistence(options ...*WithPersistenceOptions) ValkeyResource
  ```
- [WithRepl](/reference/api/go/aspire.hosting.valkey/valkeyresource/withrepl.md) -- `method` -- Adds a REPL command that opens an authenticated Valkey shell in the dashboard terminal dock.
  ```go
  WithRepl() ValkeyResource
  ```
