Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ValkeyResource

Handle
📦 Aspire.Hosting.Valkey v17.0.0

A resource that represents a Valkey resource independent of the hosting model.

type ValkeyResource interface {
ExpressionValue
IComputeResource
Resource
ResourceWithArgs
ResourceWithConnectionString
ResourceWithEndpoints
ResourceWithEnvironment
ResourceWithWaitSupport
}

Properties

propertyConnectionStringExpression*ReferenceExpressionget
Gets the connection string expression for the Valkey server.
ConnectionStringExpression() *ReferenceExpression
propertyHostEndpointReferenceExpressionget
Gets the host endpoint reference for this resource.
Host() EndpointReferenceExpression
propertyPasswordParameterParameterResourceget
Gets the parameter that contains the Valkey server password.
PasswordParameter() ParameterResource
propertyPortEndpointReferenceExpressionget
Gets the port endpoint reference for this resource.
Port() EndpointReferenceExpression
propertyPrimaryEndpointEndpointReferenceget
Gets the primary endpoint for the Valkey server.
PrimaryEndpoint() EndpointReference
propertyResourceTypeDisplayNamestringget
Gets the ResourceTypeDisplayName property
ResourceTypeDisplayName() (string, error)
propertyUriExpression*ReferenceExpressionget
Gets the connection URI expression for the Valkey server.
UriExpression() *ReferenceExpression

Methods

methodWithDataBindMountbuilder
Adds a bind mount for the data folder to a Valkey container resource and enables Valkey persistence.
WithDataBindMount(
source string,
options ...*WithDataBindMountOptions,
) ValkeyResource
sourcestringThe source directory on the host to mount into the container.
options...*WithDataBindMountOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithDataBindMountOptions argument.

IsReadOnly*boolA flag that indicates if this is a read-only mount. Setting this to true will disable Valkey persistence. Defaults to false.
ValkeyResource

The resource builder.

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

methodWithDataVolumebuilder
Adds a named volume for the data folder to a Valkey container resource and enables Valkey persistence.
WithDataVolume(options ...*WithDataVolumeOptions) ValkeyResource
options...*WithDataVolumeOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithDataVolumeOptions argument.

Name*stringThe name of the volume. Defaults to an auto-generated name based on the application and resource names.
IsReadOnly*boolA flag that indicates if this is a read-only volume. Setting this to true will disable Valkey persistence. Defaults to false.
ValkeyResource

The resource builder.

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

methodWithPersistencebuilder
Configures a Valkey container resource for persistence.
WithPersistence(options ...*WithPersistenceOptions) ValkeyResource
options...*WithPersistenceOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithPersistenceOptions argument.

Interval*float64The interval between snapshot exports. Defaults to 60 seconds.
KeysChangedThreshold*float64The number of key change operations required to trigger a snapshot at the interval. Defaults to 1.
ValkeyResource

The resource builder.

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

methodWithReplbuilder
Adds a REPL command that opens an authenticated Valkey shell in the dashboard terminal dock.
WithRepl() ValkeyResource
ValkeyResource

The resource builder for chaining.

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