Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithClusterLifetime

Method
📦 CommunityToolkit.Aspire.Hosting.Kind v13.5.1-beta.895
func (IKindResource) WithClusterLifetime(lifetime ClusterLifetime) IKindResource

Signature

methodWithClusterLifetimebuilder
Sets the cluster lifetime. When Session (the default), the cluster is deleted on graceful shutdown or other process-exit signals on a best-effort basis. When Persistent, the cluster survives AppHost restarts and is reused on next startup.
WithClusterLifetime(lifetime ClusterLifetime) IKindResource
lifetimeClusterLifetimeThe desired cluster lifetime.
IKindResource

A reference to the IResourceBuilder.

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

Applies to

This method applies to the following types: