RedisResource

Handle
📦 Aspire.Hosting.Redis v17.0.0
interface RedisResource
extends IComputeResource,
IExpressionValue,
IManifestExpressionProvider,
IResource,
IResourceWithArgs,
IResourceWithConnectionString,
IResourceWithEndpoints,
IResourceWithEnvironment,
IResourceWithProbes,
IResourceWithWaitSupport,
IValueProvider,
IValueWithReferences {
readonly connectionStringExpression: ReferenceExpression;
readonly host: EndpointReferenceExpression;
passwordParameter: ParameterResource;
readonly port: EndpointReferenceExpression;
readonly primaryEndpoint: EndpointReference;
readonly resourceTypeDisplayName: string;
readonly tlsEnabled: boolean;
readonly uriExpression: ReferenceExpression;
withDataBindMount(
source: string,
isReadOnly?: boolean): RedisResource;
withDataVolume(
name?: string,
isReadOnly?: boolean): RedisResource;
withHostPort(port: number): RedisResource;
withModule(path: string): RedisResource;
withPassword(password: ParameterResource): RedisResource;
withPersistence(
interval?: timespan,
keysChangedThreshold?: number): RedisResource;
withRedisCommander(configureContainer?: (obj: RedisCommanderResource) => Promise<void>, containerName?: string): RedisResource;
withRedisInsight(configureContainer?: (obj: RedisInsightResource) => Promise<void>, containerName?: string): RedisResource;
withRepl(): RedisResource;
}

Properties

propertyconnectionStringExpressionReferenceExpressionget
Gets the connection string expression for the Redis server.
propertyhostEndpointReferenceExpressionget
Gets the host endpoint reference for this resource.
propertypasswordParameterParameterResourceget · set
Gets the parameter that contains the Redis server password.
propertyportEndpointReferenceExpressionget
Gets the port endpoint reference for this resource.
propertyprimaryEndpointEndpointReferenceget
Gets the primary endpoint for the Redis server.
propertyresourceTypeDisplayNamestringget
Gets the ResourceTypeDisplayName property
propertytlsEnabledbooleanget
Indicates whether TLS is enabled for the Redis server.
propertyuriExpressionReferenceExpressionget
Gets the connection URI expression for the Redis server.

Methods

methodwithDataBindMountbuilder
Adds a bind mount for the data folder to a Redis container resource and enables Redis persistence.
withDataBindMount(
source: string,
isReadOnly?: boolean): RedisResource
sourcestringThe source directory on the host to mount into the container.
isReadOnlybooleanoptional= FalseA flag that indicates if this is a read-only mount. Setting this to `true` will disable Redis persistence. Defaults to `false`.
RedisResource
methodwithDataVolumebuilder
Adds a named volume for the data folder to a Redis container resource and enables Redis persistence.
withDataVolume(
name?: string,
isReadOnly?: boolean): RedisResource
namestringoptionalThe name of the volume. Defaults to an auto-generated name based on the application and resource names.
isReadOnlybooleanoptional= FalseA flag that indicates if this is a read-only volume. Setting this to `true` will disable Redis persistence. Defaults to `false`.
RedisResource
methodwithHostPortbuilder
Configures the host port that the Redis resource is exposed on instead of using randomly assigned port.
withHostPort(port: number): RedisResource
portnumberThe port to bind on the host. If `null` is used random port will be assigned.
RedisResource
methodwithModulebuilder
Configures the Redis resource to use the specified Redis module by providing its path inside the container.
withModule(path: string): RedisResource
pathstringThe absolute path to the Redis module inside the Redis container.
RedisResource
methodwithPasswordbuilder
Configures the password that the Redis resource is used.
withPassword(password: ParameterResource): RedisResource
passwordParameterResourceThe parameter used to provide the password for the Redis resource. If `null`, no password will be configured.
RedisResource
methodwithPersistencebuilder
Configures a Redis container resource for persistence.
withPersistence(
interval?: timespan,
keysChangedThreshold?: number): RedisResource
intervaltimespanoptionalThe interval between snapshot exports. Defaults to 60 seconds.
keysChangedThresholdnumberoptional= 1The number of key change operations required to trigger a snapshot at the interval. Defaults to 1.
RedisResource
methodwithRedisCommanderbuilder
Adds Redis Commander management UI
withRedisCommander(configureContainer?: (obj: RedisCommanderResource) => Promise<void>, containerName?: string): RedisResource
configureContainer(obj: RedisCommanderResource) => Promise<void>optionalConfiguration callback for Redis Commander container resource.
containerNamestringoptionalOverride the container name used for Redis Commander.
RedisResource
methodwithRedisInsightbuilder
Adds Redis Insight management UI
withRedisInsight(configureContainer?: (obj: RedisInsightResource) => Promise<void>, containerName?: string): RedisResource
configureContainer(obj: RedisInsightResource) => Promise<void>optionalConfiguration callback for Redis Insight container resource.
containerNamestringoptionalOverride the container name used for Redis Insight.
RedisResource
methodwithReplbuilder
Adds a REPL command that opens an authenticated Redis shell in the dashboard terminal dock.
withRepl(): RedisResource
RedisResource