# DevTunnelResource

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

## Definition

```go
type DevTunnelResource interface {
    IComputeResource
    Resource
    ResourceWithArgs
    ResourceWithEndpoints
    ResourceWithEnvironment
    ResourceWithWaitSupport
}
```

## Embeds

- `IComputeResource`
- `Resource`
- `ResourceWithArgs`
- `ResourceWithEndpoints`
- `ResourceWithEnvironment`
- `ResourceWithWaitSupport`

## Methods

- [GetTunnelEndpoint](/reference/api/go/aspire.hosting.devtunnels/devtunnelresource/gettunnelendpoint.md) -- `method` -- Gets the tunnel endpoint reference for the specified target endpoint.
  ```go
  GetTunnelEndpoint(targetEndpointReference EndpointReference) EndpointReference
  ```
- [WithAnonymousAccess](/reference/api/go/aspire.hosting.devtunnels/devtunnelresource/withanonymousaccess.md) -- `method` -- Allows the tunnel to be publicly accessed without authentication.
  ```go
  WithAnonymousAccess() DevTunnelResource
  ```
- [WithExpiration](/reference/api/go/aspire.hosting.devtunnels/devtunnelresource/withexpiration.md) -- `method` -- Configures how long the tunnel can remain unused or unmodified before it expires.
  ```go
  WithExpiration(expirationHours float64) DevTunnelResource
  ```
- [WithTunnelReference](/reference/api/go/aspire.hosting.devtunnels/devtunnelresource/withtunnelreference.md) -- `method` -- Exposes the specified endpoint via the dev tunnel.
  ```go
  WithTunnelReference(targetEndpoint EndpointReference) DevTunnelResource
  ```
- [WithTunnelReferenceAll](/reference/api/go/aspire.hosting.devtunnels/devtunnelresource/withtunnelreferenceall.md) -- `method` -- Adds ports on the dev tunnel for all endpoints found on the referenced resource and sets whether anonymous access is allowed.
  ```go
  WithTunnelReferenceAll(resourceBuilder ResourceWithEndpoints, allowAnonymous bool) DevTunnelResource
  ```
- [WithTunnelReferenceAnonymous](/reference/api/go/aspire.hosting.devtunnels/devtunnelresource/withtunnelreferenceanonymous.md) -- `method` -- Exposes the specified endpoint via the dev tunnel and sets whether anonymous access is allowed.
  ```go
  WithTunnelReferenceAnonymous(targetEndpoint EndpointReference, allowAnonymous bool) DevTunnelResource
  ```
