# RedisResource Constructors

- Package: [Aspire.Hosting.Redis](/reference/api/csharp/aspire.hosting.redis.md)
- Type: [RedisResource](/reference/api/csharp/aspire.hosting.redis/redisresource.md)
- Kind: `Constructors`
- Members: `2`

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

## RedisResource(string)

- Name: `Constructor(string)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Redis/RedisResource.cs#L16-L82)

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

```csharp
public class RedisResource
{
    public RedisResource(
        string name)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the resource.

## Remarks

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

## RedisResource(string, ParameterResource)

- Name: `Constructor(string, ParameterResource)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Redis/RedisResource.cs#L23-L27)

Initializes a new instance of the [RedisResource](/reference/api/csharp/aspire.hosting.redis/redisresource.md) class.

```csharp
public class RedisResource
{
    public RedisResource(
        string name,
        ParameterResource password)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the resource.
- `password` (`ParameterResource`)
  A parameter that contains the Redis server password.
