PinguApps.Aspire.Hosting.Upstash.Redis
1.1.3
dotnet add package PinguApps.Aspire.Hosting.Upstash.Redis --version 1.1.3
NuGet\Install-Package PinguApps.Aspire.Hosting.Upstash.Redis -Version 1.1.3
<PackageReference Include="PinguApps.Aspire.Hosting.Upstash.Redis" Version="1.1.3" />
<PackageVersion Include="PinguApps.Aspire.Hosting.Upstash.Redis" Version="1.1.3" />
<PackageReference Include="PinguApps.Aspire.Hosting.Upstash.Redis" />
paket add PinguApps.Aspire.Hosting.Upstash.Redis --version 1.1.3
#r "nuget: PinguApps.Aspire.Hosting.Upstash.Redis, 1.1.3"
#:package PinguApps.Aspire.Hosting.Upstash.Redis@1.1.3
#addin nuget:?package=PinguApps.Aspire.Hosting.Upstash.Redis&version=1.1.3
#tool nuget:?package=PinguApps.Aspire.Hosting.Upstash.Redis&version=1.1.3
PinguApps.Aspire.Hosting.Upstash.Redis
PinguApps.Aspire.Hosting.Upstash.Redis lets an Aspire AppHost publish a normal Aspire Redis resource to Upstash Redis during aspire deploy.
- Package id:
PinguApps.Aspire.Hosting.Upstash.Redis - Distribution: NuGet for both C# and TypeScript AppHosts
- Tested Aspire baseline:
13.5.2 - Provider scope: Upstash Redis through the Upstash Developer API
- Local behaviour: standard Aspire Redis
- Deploy behaviour: opt-in Upstash create/adopt/reconcile flow
Install
C# AppHost:
dotnet add package PinguApps.Aspire.Hosting.Upstash.Redis
TypeScript AppHost:
{
"packages": {
"Aspire.Hosting.Redis": "13.5.2",
"PinguApps.Aspire.Hosting.Upstash.Redis": "<package version>"
}
}
Then run:
aspire restore --non-interactive
No npm package is required for the integration itself. TypeScript AppHosts consume the same NuGet package through Aspire's generated guest-language module flow.
Minimal .NET Example
Maintained sample source: samples/AppHostSnippets/UpstashRedisAppHostSnippets.cs
using Aspire.Hosting;
using Aspire.Hosting.ApplicationModel;
using Aspire.Hosting.Upstash.Redis;
var builder = DistributedApplication.CreateBuilder(args);
IResourceBuilder<ParameterResource> databaseName = builder.AddParameter("upstash-database-name");
IResourceBuilder<ParameterResource> accountEmail = builder.AddParameter("upstash-account-email");
IResourceBuilder<ParameterResource> apiKey = builder.AddParameter("upstash-api-key", secret: true);
IResourceBuilder<RedisResource> cache = builder.AddRedis("cache")
.PublishToUpstash(
databaseName,
accountEmail,
apiKey,
UpstashRedisOwnershipMode.CreateOrAdopt,
options =>
{
options.SetPlatform(UpstashRedisCloudPlatform.Aws);
options.SetPrimaryRegion(UpstashRedisRegion.AwsEuWest1);
options.SetPlan(UpstashRedisPlan.PayAsYouGo);
options.Eviction = true;
});
builder.AddProject<Projects.Api>("api")
.WithReference(cache);
builder.Build().Run();
Minimal TypeScript AppHost Example
Maintained demo source: samples/TypeScriptAppHost/apphost.mts
import {
createBuilder,
upstashRedisCloudPlatform,
upstashRedisOwnershipMode,
upstashRedisPlan,
upstashRedisRegion,
} from "./.aspire/modules/aspire.mjs";
const builder = await createBuilder();
const databaseName = await builder.addParameter("upstash-database-name");
const accountEmail = await builder.addParameter("upstash-account-email");
const apiKey = await builder.addParameter("upstash-api-key", { secret: true });
let cache = await builder.addRedis("cache");
cache = await cache.publishToUpstash(databaseName, accountEmail, apiKey, {
ownershipMode: upstashRedisOwnershipMode.createOrAdopt,
platform: upstashRedisCloudPlatform.aws,
primaryRegion: upstashRedisRegion.awsEuWest1,
plan: upstashRedisPlan.payAsYouGo,
eviction: true,
});
let worker = await builder.addContainer("worker", "mcr.microsoft.com/dotnet/runtime-deps:10.0");
worker = await worker.withReference(cache);
const app = await builder.build();
await app.run();
Deploy Inputs
| Input | Purpose |
|---|---|
upstash-database-name |
Explicit remote Upstash database name and stable deployment identity. |
upstash-account-email |
Infrastructure-only Upstash account email. |
upstash-api-key |
Infrastructure-only Upstash Management API key. Mark it secret. |
The management API key is never exposed as an application-facing Redis output.
For non-interactive deploys, provide real values as Aspire parameter environment variables:
$env:Parameters__upstash_database_name = "upstash-ts-test"
$env:Parameters__upstash_account_email = $env:UPSTASH_EMAIL
$env:Parameters__upstash_api_key = $env:UPSTASH_API_KEY
Behaviour Summary
builder.AddRedis("cache") remains the resource of record. PublishToUpstash(...) or publishToUpstash(...) attaches deploy-time intent to that normal Redis resource.
Local runs keep using standard Aspire Redis behaviour and do not call Upstash while the AppHost model is built. During aspire deploy, the package resolves parameters, creates or adopts the named Upstash database, reconciles explicitly configured mutable settings, fails on unsafe drift, and redirects app-facing Redis connection details to Upstash.
Docs
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Aspire.Hosting (>= 13.5.2)
- Aspire.Hosting.Redis (>= 13.5.2)
- MessagePack (>= 3.1.11)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.