# GarnetResource

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

## Definition

```typescript
interface GarnetResource
  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): GarnetResource;
  withDataVolume(
      name?: string,
      isReadOnly?: boolean): GarnetResource;
  withPersistence(interval?: timespan): GarnetResource;
}
```

## 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.garnet/garnetresource/withdatabindmount.md) -- `method` -- Mounts a host directory as the Garnet data directory.
    ```typescript
  withDataBindMount(source: string, isReadOnly?: boolean): GarnetResource
  ```
- [withDataVolume](/reference/api/typescript/aspire.hosting.garnet/garnetresource/withdatavolume.md) -- `method` -- Adds a persistent data volume to the Garnet resource.
    ```typescript
  withDataVolume(name?: string, isReadOnly?: boolean): GarnetResource
  ```
- [withPersistence](/reference/api/typescript/aspire.hosting.garnet/garnetresource/withpersistence.md) -- `method` -- Configures snapshot persistence for the Garnet resource.
    ```typescript
  withPersistence(interval?: timespan): GarnetResource
  ```
