# ValkeyResource

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

## Definition

```typescript
interface ValkeyResource
  extends IComputeResource,
    IManifestExpressionProvider,
    IResource,
    IResourceWithArgs,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IValueProvider,
    IValueWithReferences {
  readonly connectionStringExpression: ReferenceExpression;
  entrypoint: string;
  readonly host: EndpointReferenceExpression;
  readonly name: string;
  readonly passwordParameter: ParameterResource;
  readonly port: EndpointReferenceExpression;
  readonly primaryEndpoint: EndpointReference;
  shellExecution: boolean;
  readonly uriExpression: ReferenceExpression;
  withDataBindMount(
      source: string,
      isReadOnly?: boolean): ValkeyResource;
  withDataVolume(
      name?: string,
      isReadOnly?: boolean): ValkeyResource;
  withPersistence(
      interval?: timespan,
      keysChangedThreshold?: number): ValkeyResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the ConnectionStringExpression property
- `entrypoint`: `string` `get - set` -- Gets the Entrypoint property
- `host`: `EndpointReferenceExpression` `get` -- Gets the Host property
- `name`: `string` `get` -- Gets the Name property
- `passwordParameter`: `ParameterResource` `get` -- Gets the PasswordParameter property
- `port`: `EndpointReferenceExpression` `get` -- Gets the Port property
- `primaryEndpoint`: `EndpointReference` `get` -- Gets the PrimaryEndpoint property
- `shellExecution`: `boolean` `get - set` -- Gets the ShellExecution property
- `uriExpression`: `ReferenceExpression` `get` -- Gets the UriExpression property

## Methods

- [withDataBindMount](/reference/api/typescript/aspire.hosting.valkey/valkeyresource/withdatabindmount.md) -- `method` -- Adds a data bind mount for Valkey and enables persistence
    ```typescript
  withDataBindMount(source: string, isReadOnly?: boolean): ValkeyResource
  ```
- [withDataVolume](/reference/api/typescript/aspire.hosting.valkey/valkeyresource/withdatavolume.md) -- `method` -- Adds a data volume for Valkey and enables persistence
    ```typescript
  withDataVolume(name?: string, isReadOnly?: boolean): ValkeyResource
  ```
- [withPersistence](/reference/api/typescript/aspire.hosting.valkey/valkeyresource/withpersistence.md) -- `method` -- Configures Valkey persistence
    ```typescript
  withPersistence(interval?: timespan, keysChangedThreshold?: number): ValkeyResource
  ```
