Skip to content

feat: CommunityToolkit.Aspire.Hosting.Floc — Floci AWS emulator hosing integration#1448

Draft
edmondshtogu wants to merge 1 commit into
CommunityToolkit:mainfrom
edmondshtogu:main
Draft

feat: CommunityToolkit.Aspire.Hosting.Floc — Floci AWS emulator hosing integration#1448
edmondshtogu wants to merge 1 commit into
CommunityToolkit:mainfrom
edmondshtogu:main

Conversation

@edmondshtogu

@edmondshtogu edmondshtogu commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Closes floci-io/floci#1242

Adds CommunityToolkit.Aspire.Hosting.Floci — a hosting integration for Floci, a high-performance AWS emulator (65+ services, LocalStack-compatible) that runs as a container inside the Aspire AppHost.

What's included

Core integration (src/CommunityToolkit.Aspire.Hosting.Floci/)

  • AddFloci(name, port?, defaultRegion?, defaultAccountId?) — adds the Floci container with health check at /_floci/info
  • WithReference(floci) automatically injects AWS_ENDPOINT_URL, AWS_DEFAULT_REGION, AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY into dependent resources via a BeforeStartEvent subscriber. Host processes get localhost:{port}; containers get host.docker.internal:{port}
  • WithDataVolume / WithDataBindMount — switches Floci to persistent storage mode
  • WithDockerSocket — mounts the Docker socket and sets FLOCI_DOCKER_DOCKER_HOST so Lambda and other container-backed services can launch sibling containers
  • WithConfigFile(hostPath) — bind-mounts a Quarkus application.yml override at /deployments/config/application.yml for advanced Floci configuration not covered by extension methods
  • TLSWithHttpsCertificateConfiguration is registered inside AddFloci and fires automatically when the Aspire developer certificate service is active (or when WithHttpsDeveloperCertificate() is chained). Sets FLOCI_TLS_ENABLED, FLOCI_TLS_CERT_PATH, FLOCI_TLS_KEY_PATH and switches connection strings to https:// — no integration-specific TLS wrapper needed. WithDeveloperCertificateTrust(true) is also registered so Floci trusts the dev cert for its own outbound calls

Example app (examples/floci/)

  • AppHost — orchestrates Floci + ApiService, demonstrating WithReference, WaitFor, and health checks
  • ApiService — minimal ASP.NET Core app showing S3 bucket listing via AWSSDK.S3
  • AppHost.TypeScript — TypeScript AppHost covering the full exported API surface for compile-time validation

Tests (tests/CommunityToolkit.Aspire.Hosting.Floci.Tests/)

  • Container lifecycle, health check, connection string, data volume/bind-mount, Docker socket, config file, and TLS env-var tests

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

  • Floci serves both HTTP and HTTPS on the same port (4566), so no endpoint annotation switching is needed when TLS is enabled
  • AWS_ENDPOINT_URL is the standard SDK v4 env var; no AmazonS3Config.RegionEndpoint should be set alongside ServiceURL (triggers a NullReferenceException in the v4 endpoint rule engine — documented in the example)
  • The ASPIRECERTIFICATES001 experimental diagnostic is suppressed at file level in the hosting extension
  • TypeScript AppHost uses @ts-expect-error guards for experimental certificate APIs that have no polyglot binding yet

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 1448

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 1448"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add .NET Aspire hosting support (Aspire.Hosting.Floci)

1 participant