# IYarpConfigurationBuilder

- Kind: `interface`
- Package: [Aspire.Hosting.Yarp](/reference/api/csharp/aspire.hosting.yarp.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Yarp/ConfigurationBuilder/IYarpConfigurationBuilder.cs)

Interface to build a configuration file for YARP

## Definition

```csharp
namespace Aspire.Hosting;

public interface IYarpConfigurationBuilder
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting.Yarp/IYarpConfigurationBuilder`

## Methods

- [AddCluster(EndpointReference)](/reference/api/csharp/aspire.hosting.yarp/iyarpconfigurationbuilder/methods.md#addcluster-endpointreference) : [YarpCluster](/reference/api/csharp/aspire.hosting.yarp/yarpcluster.md) `abstract` `ats ignored` -- Add a new cluster to YARP.
- [AddCluster(IResourceBuilder<IResourceWithServiceDiscovery>)](/reference/api/csharp/aspire.hosting.yarp/iyarpconfigurationbuilder/methods.md#addcluster-iresourcebuilder-iresourcewithservicediscovery) : [YarpCluster](/reference/api/csharp/aspire.hosting.yarp/yarpcluster.md) `abstract` `ats ignored` -- Add a new cluster to YARP based on a resource that supports service discovery.
- [AddCluster(IResourceBuilder<ExternalServiceResource>)](/reference/api/csharp/aspire.hosting.yarp/iyarpconfigurationbuilder/methods.md#addcluster-iresourcebuilder-externalserviceresource) : [YarpCluster](/reference/api/csharp/aspire.hosting.yarp/yarpcluster.md) `abstract` `ats ignored` -- Add a new cluster to YARP based on an external service resource.
- [AddCluster(string, object[])](/reference/api/csharp/aspire.hosting.yarp/iyarpconfigurationbuilder/methods.md#addcluster-string-object) : [YarpCluster](/reference/api/csharp/aspire.hosting.yarp/yarpcluster.md) `abstract` `ats ignored` -- Add a new cluster to YARP based on a collection of urls.
- [AddCluster(string, object)](/reference/api/csharp/aspire.hosting.yarp/iyarpconfigurationbuilder/methods.md#addcluster-string-object) : [YarpCluster](/reference/api/csharp/aspire.hosting.yarp/yarpcluster.md) `virtual` `ats ignored` -- Add a new cluster to YARP based on a collection of urls.
- [AddRoute(string, YarpCluster)](/reference/api/csharp/aspire.hosting.yarp/iyarpconfigurationbuilder/methods.md#addroute-string-yarpcluster) : [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md) `abstract` `ats ignored` -- Add a new route to YARP that will target the cluster in parameter.
