# YarpConfigurationBuilder

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

Interface to build a configuration file for YARP

## Definition

```go
type YarpConfigurationBuilder interface{}
```

## Methods

- [AddCatchAllRoute](/reference/api/go/aspire.hosting.yarp/yarpconfigurationbuilder/addcatchallroute.md) -- `method` -- Adds a catch-all route for a cluster, endpoint, resource, or string destination target.
  ```go
  AddCatchAllRoute(target any) YarpRoute
  ```
- [AddClusterFromEndpoint](/reference/api/go/aspire.hosting.yarp/yarpconfigurationbuilder/addclusterfromendpoint.md) -- `method` -- Adds a cluster for an endpoint reference.
  ```go
  AddClusterFromEndpoint(endpoint EndpointReference) YarpCluster
  ```
- [AddClusterFromExternalService](/reference/api/go/aspire.hosting.yarp/yarpconfigurationbuilder/addclusterfromexternalservice.md) -- `method` -- Adds a cluster for an external service resource.
  ```go
  AddClusterFromExternalService(externalService ExternalServiceResource) YarpCluster
  ```
- [AddClusterFromResource](/reference/api/go/aspire.hosting.yarp/yarpconfigurationbuilder/addclusterfromresource.md) -- `method` -- Adds a cluster for a resource that supports service discovery.
  ```go
  AddClusterFromResource(resource ResourceWithServiceDiscovery) YarpCluster
  ```
- [AddClusterWithDestination](/reference/api/go/aspire.hosting.yarp/yarpconfigurationbuilder/addclusterwithdestination.md) -- `method` -- Adds a cluster from a single destination.
  ```go
  AddClusterWithDestination(clusterName string, destination any) YarpCluster
  ```
- [AddClusterWithDestinations](/reference/api/go/aspire.hosting.yarp/yarpconfigurationbuilder/addclusterwithdestinations.md) -- `method` -- Adds a cluster from multiple destinations.
  ```go
  AddClusterWithDestinations(clusterName string, destinations []any) YarpCluster
  ```
- [AddRoute](/reference/api/go/aspire.hosting.yarp/yarpconfigurationbuilder/addroute.md) -- `method` -- Adds a route for a cluster, endpoint, resource, or string destination target.
  ```go
  AddRoute(path string, target any) YarpRoute
  ```

## Applies to

- [`YarpConfigurationBuilder`](/reference/api/go/aspire.hosting.yarp/yarpconfigurationbuilder.md)
