# ValkeyResource Constructors

- Package: [Aspire.Hosting.Valkey](/reference/api/csharp/aspire.hosting.valkey.md)
- Type: [ValkeyResource](/reference/api/csharp/aspire.hosting.valkey/valkeyresource.md)
- Kind: `Constructors`
- Members: `2`

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

## ValkeyResource(string)

- Name: `Constructor(string)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Valkey/ValkeyResource.cs#L11)

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

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

## Parameters

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

## ValkeyResource(string, ParameterResource)

- Name: `Constructor(string, ParameterResource)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Valkey/ValkeyResource.cs#L22-L25)

Initializes a new instance of the [ValkeyResource](/reference/api/csharp/aspire.hosting.valkey/valkeyresource.md) class.

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

## Parameters

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