# RedisResource

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

## Definition

```typescript
interface RedisResource
  extends IComputeResource,
    IManifestExpressionProvider,
    IResource,
    IResourceWithArgs,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IValueProvider,
    IValueWithReferences {
  readonly connectionStringExpression: ReferenceExpression;
  entrypoint: string;
  readonly host: EndpointReferenceExpression;
  readonly name: string;
  passwordParameter: ParameterResource;
  readonly port: EndpointReferenceExpression;
  readonly primaryEndpoint: EndpointReference;
  shellExecution: boolean;
  readonly tlsEnabled: boolean;
  readonly uriExpression: ReferenceExpression;
  withDataBindMount(
      source: string,
      isReadOnly?: boolean): RedisResource;
  withDataVolume(
      name?: string,
      isReadOnly?: boolean): RedisResource;
  withHostPort(port: number): RedisResource;
  withPassword(password: ParameterResource): RedisResource;
  withPersistence(
      interval?: timespan,
      keysChangedThreshold?: number): RedisResource;
  withRedisCommander(configureContainer?: (obj: RedisCommanderResource) => Promise<void>, containerName?: string): RedisResource;
  withRedisInsight(configureContainer?: (obj: RedisInsightResource) => Promise<void>, containerName?: string): RedisResource;
}
```

## 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 - set` -- 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
- `tlsEnabled`: `boolean` `get` -- Gets the TlsEnabled property
- `uriExpression`: `ReferenceExpression` `get` -- Gets the UriExpression property

## Methods

- [withDataBindMount](/reference/api/typescript/aspire.hosting.redis/redisresource/withdatabindmount.md) -- `method` -- Adds a data bind mount with persistence
    ```typescript
  withDataBindMount(source: string, isReadOnly?: boolean): RedisResource
  ```
- [withDataVolume](/reference/api/typescript/aspire.hosting.redis/redisresource/withdatavolume.md) -- `method` -- Adds a data volume with persistence
    ```typescript
  withDataVolume(name?: string, isReadOnly?: boolean): RedisResource
  ```
- [withHostPort](/reference/api/typescript/aspire.hosting.redis/redisresource/withhostport.md) -- `method` -- Sets the host port for Redis
    ```typescript
  withHostPort(port: number): RedisResource
  ```
- [withPassword](/reference/api/typescript/aspire.hosting.redis/redisresource/withpassword.md) -- `method` -- Configures the password for Redis
    ```typescript
  withPassword(password: ParameterResource): RedisResource
  ```
- [withPersistence](/reference/api/typescript/aspire.hosting.redis/redisresource/withpersistence.md) -- `method` -- Configures Redis persistence
    ```typescript
  withPersistence(interval?: timespan, keysChangedThreshold?: number): RedisResource
  ```
- [withRedisCommander](/reference/api/typescript/aspire.hosting.redis/redisresource/withrediscommander.md) -- `method` -- Adds Redis Commander management UI
    ```typescript
  withRedisCommander(configureContainer?: (obj: RedisCommanderResource) => Promise<void>, containerName?: string): RedisResource
  ```
- [withRedisInsight](/reference/api/typescript/aspire.hosting.redis/redisresource/withredisinsight.md) -- `method` -- Adds Redis Insight management UI
    ```typescript
  withRedisInsight(configureContainer?: (obj: RedisInsightResource) => Promise<void>, containerName?: string): RedisResource
  ```
