Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

DevTunnelResource

Handle
📦 Aspire.Hosting.DevTunnels v17.0.0
type DevTunnelResource interface {
IComputeResource
Resource
ResourceWithArgs
ResourceWithEndpoints
ResourceWithEnvironment
ResourceWithWaitSupport
}

Methods

Gets the tunnel endpoint reference for the specified target endpoint.
GetTunnelEndpoint(targetEndpointReference EndpointReference) EndpointReference
targetEndpointReferenceEndpointReferenceThe target endpoint reference.
EndpointReference

An EndpointReference representing the public tunnel endpoint.

Returns a handle; failures surface later via Err().

methodWithAnonymousAccessbuilder
Allows the tunnel to be publicly accessed without authentication.
WithAnonymousAccess() DevTunnelResource
DevTunnelResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithExpirationbuilder
Configures how long the tunnel can remain unused or unmodified before it expires.
WithExpiration(expirationHours float64) DevTunnelResource
expirationHoursfloat64The idle expiration period, in whole hours from one hour through 30 days, inclusive.
DevTunnelResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithTunnelReferencebuilder
Exposes the specified endpoint via the dev tunnel.
WithTunnelReference(targetEndpoint EndpointReference) DevTunnelResource
targetEndpointEndpointReferenceThe endpoint to expose via the dev tunnel.
DevTunnelResource

The resource builder.

Returns a handle; failures surface later via Err().

Adds ports on the dev tunnel for all endpoints found on the referenced resource and sets whether anonymous access is allowed.
WithTunnelReferenceAll(
resourceBuilder ResourceWithEndpoints,
allowAnonymous bool,
) DevTunnelResource
resourceBuilderResourceWithEndpointsThe resource builder for the referenced resource.
allowAnonymousboolWhether anonymous access is allowed.
DevTunnelResource

The resource builder.

Returns a handle; failures surface later via Err().

Exposes the specified endpoint via the dev tunnel and sets whether anonymous access is allowed.
WithTunnelReferenceAnonymous(
targetEndpoint EndpointReference,
allowAnonymous bool,
) DevTunnelResource
targetEndpointEndpointReferenceThe endpoint to expose via the dev tunnel.
allowAnonymousboolWhether anonymous access is allowed.
DevTunnelResource

The resource builder.

Returns a handle; failures surface later via Err().