# YarpCluster

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

Represents a cluster for YARP routes

## Definition

```go
type YarpCluster interface{}
```

## Methods

- [WithForwarderRequestConfig](/reference/api/go/aspire.hosting.yarp/yarpcluster/withforwarderrequestconfig.md) -- `method` -- Set the forwarder request configuration for the cluster.
  ```go
  WithForwarderRequestConfig(config *YarpForwarderRequestConfig) YarpCluster
  ```
- [WithHealthCheckConfig](/reference/api/go/aspire.hosting.yarp/yarpcluster/withhealthcheckconfig.md) -- `method` -- Set the health check configuration for the cluster.
  ```go
  WithHealthCheckConfig(config *YarpHealthCheckConfig) YarpCluster
  ```
- [WithHttpClientConfig](/reference/api/go/aspire.hosting.yarp/yarpcluster/withhttpclientconfig.md) -- `method` -- Set the HTTP client configuration for the cluster.
  ```go
  WithHttpClientConfig(config *YarpHttpClientConfig) YarpCluster
  ```
- [WithLoadBalancingPolicy](/reference/api/go/aspire.hosting.yarp/yarpcluster/withloadbalancingpolicy.md) -- `method` -- Set the LoadBalancingPolicy for the cluster.
  ```go
  WithLoadBalancingPolicy(policy string) YarpCluster
  ```
- [WithMetadata](/reference/api/go/aspire.hosting.yarp/yarpcluster/withmetadata.md) -- `method` -- Set the Metadata for the cluster.
  ```go
  WithMetadata(metadata map[string]string) YarpCluster
  ```
- [WithSessionAffinityConfig](/reference/api/go/aspire.hosting.yarp/yarpcluster/withsessionaffinityconfig.md) -- `method` -- Set the session affinity configuration for the cluster.
  ```go
  WithSessionAffinityConfig(config *YarpSessionAffinityConfig) YarpCluster
  ```
