# RedisResource

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

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

## Remarks

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

## Definition

```go
type RedisResource 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 Redis server.
- `Host`: `EndpointReferenceExpression` `get` -- Gets the host endpoint reference for this resource.
- `PasswordParameter`: `ParameterResource` `get/set` -- Gets the parameter that contains the Redis server password.
- `Port`: `EndpointReferenceExpression` `get` -- Gets the port endpoint reference for this resource.
- `PrimaryEndpoint`: `EndpointReference` `get` -- Gets the primary endpoint for the Redis server.
- `ResourceTypeDisplayName`: `string` `get` -- Gets the ResourceTypeDisplayName property
- `TlsEnabled`: `bool` `get` -- Indicates whether TLS is enabled for the Redis server.
- `UriExpression`: `*ReferenceExpression` `get` -- Gets the connection URI expression for the Redis server.

## Methods

- [WithDataBindMount](/reference/api/go/aspire.hosting.redis/redisresource/withdatabindmount.md) -- `method` -- Adds a bind mount for the data folder to a Redis container resource and enables Redis persistence.
  ```go
  WithDataBindMount(source string, options ...*WithDataBindMountOptions) RedisResource
  ```
- [WithDataVolume](/reference/api/go/aspire.hosting.redis/redisresource/withdatavolume.md) -- `method` -- Adds a named volume for the data folder to a Redis container resource and enables Redis persistence.
  ```go
  WithDataVolume(options ...*WithDataVolumeOptions) RedisResource
  ```
- [WithHostPort](/reference/api/go/aspire.hosting.redis/redisresource/withhostport.md) -- `method` -- Configures the host port that the Redis resource is exposed on instead of using randomly assigned port.
  ```go
  WithHostPort(port *float64) RedisResource
  ```
- [WithModule](/reference/api/go/aspire.hosting.redis/redisresource/withmodule.md) -- `method` -- Configures the Redis resource to use the specified Redis module by providing its path inside the container.
  ```go
  WithModule(path string) RedisResource
  ```
- [WithPassword](/reference/api/go/aspire.hosting.redis/redisresource/withpassword.md) -- `method` -- Configures the password that the Redis resource is used.
  ```go
  WithPassword(password ParameterResource) RedisResource
  ```
- [WithPersistence](/reference/api/go/aspire.hosting.redis/redisresource/withpersistence.md) -- `method` -- Configures a Redis container resource for persistence.
  ```go
  WithPersistence(options ...*WithPersistenceOptions) RedisResource
  ```
- [WithRedisCommander](/reference/api/go/aspire.hosting.redis/redisresource/withrediscommander.md) -- `method` -- Adds Redis Commander management UI
  ```go
  WithRedisCommander(options ...*WithRedisCommanderOptions) RedisResource
  ```
- [WithRedisInsight](/reference/api/go/aspire.hosting.redis/redisresource/withredisinsight.md) -- `method` -- Adds Redis Insight management UI
  ```go
  WithRedisInsight(options ...*WithRedisInsightOptions) RedisResource
  ```
- [WithRepl](/reference/api/go/aspire.hosting.redis/redisresource/withrepl.md) -- `method` -- Adds a REPL command that opens an authenticated Redis shell in the dashboard terminal dock.
  ```go
  WithRepl() RedisResource
  ```
