FlociHostingExtension Methods
ClassMethods23 members
Provides extension methods for adding Floci to an
Hosting.IDistributedApplicationBuilder. AddFlociAws(IDistributedApplicationBuilder, string, int?, string, string)Section titled AddFlociAws(IDistributedApplicationBuilder, string, int?, string, string)extensionIResourceBuilder<FlociAwsContainerResource> Adds a Floci AWS emulator container resource to the
Hosting.IDistributedApplicationBuilder. public static class FlociHostingExtension{ public static IResourceBuilder<FlociAwsContainerResource> AddFlociAws( this IDistributedApplicationBuilder builder, string name, int? port = null, string defaultRegion = "us-east-1", string defaultAccountId = "000000000000") { // ... }}Parameters
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder to which the Floci resource will be added.namestringThe name of the Floci container resource.portint?optionalOptional. The host port to bind for the AWS endpoint.defaultRegionstringoptionalOptional. The default AWS region (default: us-east-1).defaultAccountIdstringoptionalOptional. The default AWS account ID (default: 000000000000).Returns
IResourceBuilder<FlociAwsContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further resource configuration.AddFlociAzure(IDistributedApplicationBuilder, string, int?)Section titled AddFlociAzure(IDistributedApplicationBuilder, string, int?)extensionIResourceBuilder<FlociAzureContainerResource> Adds a Floci Azure emulator container resource to the
Hosting.IDistributedApplicationBuilder. public static class FlociHostingExtension{ public static IResourceBuilder<FlociAzureContainerResource> AddFlociAzure( this IDistributedApplicationBuilder builder, string name, int? port = null) { // ... }}Parameters
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder to which the Floci resource will be added.namestringThe name of the Floci container resource.portint?optionalOptional. The host port to bind for the Azure endpoint.Returns
IResourceBuilder<FlociAzureContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further resource configuration.AddFlociGcp(IDistributedApplicationBuilder, string, int?, string)Section titled AddFlociGcp(IDistributedApplicationBuilder, string, int?, string)extensionIResourceBuilder<FlociGcpContainerResource> Adds a Floci GCP emulator container resource to the
Hosting.IDistributedApplicationBuilder. public static class FlociHostingExtension{ public static IResourceBuilder<FlociGcpContainerResource> AddFlociGcp( this IDistributedApplicationBuilder builder, string name, int? port = null, string defaultProjectId = "floci-local") { // ... }}Parameters
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder to which the Floci resource will be added.namestringThe name of the Floci container resource.portint?optionalOptional. The host port to bind for the GCP endpoint.defaultProjectIdstringoptionalOptional. The default GCP project ID (default: floci-local).Returns
IResourceBuilder<FlociGcpContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further resource configuration.WithConfigFile(IResourceBuilder<FlociAwsContainerResource>, string)Section titled WithConfigFile(IResourceBuilder<FlociAwsContainerResource>, string)extensionIResourceBuilder<FlociAwsContainerResource> Mounts a custom Quarkus
application.yml configuration file into the Floci container. The file is mounted read-only at /deployments/config/application.yml, which Quarkus reads on startup and merges with built-in defaults. public static class FlociHostingExtension{ public static IResourceBuilder<FlociAwsContainerResource> WithConfigFile( this IResourceBuilder<FlociAwsContainerResource> builder, string hostPath) { // ... }}Parameters
builderIResourceBuilder<FlociAwsContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.hostPathstringThe host-side path to the application.yml file to mount.Returns
IResourceBuilder<FlociAwsContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithDataBindMount(IResourceBuilder<FlociAwsContainerResource>, string, bool)Section titled WithDataBindMount(IResourceBuilder<FlociAwsContainerResource>, string, bool)extensionIResourceBuilder<FlociAwsContainerResource> Configures a bind mount for persistent Floci state.
public static class FlociHostingExtension{ public static IResourceBuilder<FlociAwsContainerResource> WithDataBindMount( this IResourceBuilder<FlociAwsContainerResource> builder, string source, bool isReadOnly = false) { // ... }}Parameters
builderIResourceBuilder<FlociAwsContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.sourcestringThe host path to bind into the container.isReadOnlybooloptionalWhether the bind mount should be read-only.Returns
IResourceBuilder<FlociAwsContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithDataBindMount(IResourceBuilder<FlociAzureContainerResource>, string, bool)Section titled WithDataBindMount(IResourceBuilder<FlociAzureContainerResource>, string, bool)extensionIResourceBuilder<FlociAzureContainerResource> Configures a bind mount for persistent Floci Azure state.
public static class FlociHostingExtension{ public static IResourceBuilder<FlociAzureContainerResource> WithDataBindMount( this IResourceBuilder<FlociAzureContainerResource> builder, string source, bool isReadOnly = false) { // ... }}Parameters
builderIResourceBuilder<FlociAzureContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.sourcestringThe host path to bind into the container.isReadOnlybooloptionalWhether the bind mount should be read-only.Returns
IResourceBuilder<FlociAzureContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithDataBindMount(IResourceBuilder<FlociGcpContainerResource>, string, bool)Section titled WithDataBindMount(IResourceBuilder<FlociGcpContainerResource>, string, bool)extensionIResourceBuilder<FlociGcpContainerResource> Configures a bind mount for persistent Floci GCP state.
public static class FlociHostingExtension{ public static IResourceBuilder<FlociGcpContainerResource> WithDataBindMount( this IResourceBuilder<FlociGcpContainerResource> builder, string source, bool isReadOnly = false) { // ... }}Parameters
builderIResourceBuilder<FlociGcpContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.sourcestringThe host path to bind into the container.isReadOnlybooloptionalWhether the bind mount should be read-only.Returns
IResourceBuilder<FlociGcpContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithDataVolume(IResourceBuilder<FlociAwsContainerResource>, string, bool)Section titled WithDataVolume(IResourceBuilder<FlociAwsContainerResource>, string, bool)extensionIResourceBuilder<FlociAwsContainerResource> Configures a named data volume for persistent Floci state.
public static class FlociHostingExtension{ public static IResourceBuilder<FlociAwsContainerResource> WithDataVolume( this IResourceBuilder<FlociAwsContainerResource> builder, string name, bool isReadOnly = false) { // ... }}Parameters
builderIResourceBuilder<FlociAwsContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.namestringThe name of the volume to mount.isReadOnlybooloptionalWhether the volume should be read-only.Returns
IResourceBuilder<FlociAwsContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithDataVolume(IResourceBuilder<FlociAzureContainerResource>, string, bool)Section titled WithDataVolume(IResourceBuilder<FlociAzureContainerResource>, string, bool)extensionIResourceBuilder<FlociAzureContainerResource> Configures a named data volume for persistent Floci Azure state.
public static class FlociHostingExtension{ public static IResourceBuilder<FlociAzureContainerResource> WithDataVolume( this IResourceBuilder<FlociAzureContainerResource> builder, string name, bool isReadOnly = false) { // ... }}Parameters
builderIResourceBuilder<FlociAzureContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.namestringThe name of the volume to mount.isReadOnlybooloptionalWhether the volume should be read-only.Returns
IResourceBuilder<FlociAzureContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithDataVolume(IResourceBuilder<FlociGcpContainerResource>, string, bool)Section titled WithDataVolume(IResourceBuilder<FlociGcpContainerResource>, string, bool)extensionIResourceBuilder<FlociGcpContainerResource> Configures a named data volume for persistent Floci GCP state.
public static class FlociHostingExtension{ public static IResourceBuilder<FlociGcpContainerResource> WithDataVolume( this IResourceBuilder<FlociGcpContainerResource> builder, string name, bool isReadOnly = false) { // ... }}Parameters
builderIResourceBuilder<FlociGcpContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.namestringThe name of the volume to mount.isReadOnlybooloptionalWhether the volume should be read-only.Returns
IResourceBuilder<FlociGcpContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithDockerSocket(IResourceBuilder<FlociAwsContainerResource>, string)Section titled WithDockerSocket(IResourceBuilder<FlociAwsContainerResource>, string)extensionIResourceBuilder<FlociAwsContainerResource> Mounts the Docker socket into the Floci container so that Lambda and other container-backed AWS services can launch sibling containers. Also sets
FLOCI_DOCKER_DOCKER_HOST to unix:///var/run/docker.sock (the container-side path where the socket is always mounted) so Floci can connect to it. public static class FlociHostingExtension{ public static IResourceBuilder<FlociAwsContainerResource> WithDockerSocket( this IResourceBuilder<FlociAwsContainerResource> builder, string socketPath = "/var/run/docker.sock") { // ... }}Parameters
builderIResourceBuilder<FlociAwsContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.socketPathstringoptionalOptional. Host path to the Docker socket (default: /var/run/docker.sock). Non-standard paths (e.g. Podman at /run/user/1000/podman/podman.sock) are bind-mounted to /var/run/docker.sock inside the container.Returns
IResourceBuilder<FlociAwsContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithDockerSocket(IResourceBuilder<FlociAzureContainerResource>, string)Section titled WithDockerSocket(IResourceBuilder<FlociAzureContainerResource>, string)extensionIResourceBuilder<FlociAzureContainerResource> Mounts the Docker socket into the Floci Azure container so that Azure Functions and other container-backed services can launch sibling containers. Also sets
FLOCI_AZ_DOCKER_DOCKER_HOST to unix:///var/run/docker.sock (the container-side path where the socket is always mounted) so Floci can connect to it. public static class FlociHostingExtension{ public static IResourceBuilder<FlociAzureContainerResource> WithDockerSocket( this IResourceBuilder<FlociAzureContainerResource> builder, string socketPath = "/var/run/docker.sock") { // ... }}Parameters
builderIResourceBuilder<FlociAzureContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.socketPathstringoptionalOptional. Host path to the Docker socket (default: /var/run/docker.sock). Non-standard paths (e.g. Podman at /run/user/1000/podman/podman.sock) are bind-mounted to /var/run/docker.sock inside the container.Returns
IResourceBuilder<FlociAzureContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithDockerSocket(IResourceBuilder<FlociGcpContainerResource>, string)Section titled WithDockerSocket(IResourceBuilder<FlociGcpContainerResource>, string)extensionIResourceBuilder<FlociGcpContainerResource> Mounts the Docker socket into the Floci GCP container so that Cloud Run, Cloud SQL, and other container-backed services can launch sibling containers. Also sets
FLOCI_GCP_DOCKER_DOCKER_HOST to unix:///var/run/docker.sock (the container-side path where the socket is always mounted) so Floci can connect to it. public static class FlociHostingExtension{ public static IResourceBuilder<FlociGcpContainerResource> WithDockerSocket( this IResourceBuilder<FlociGcpContainerResource> builder, string socketPath = "/var/run/docker.sock") { // ... }}Parameters
builderIResourceBuilder<FlociGcpContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.socketPathstringoptionalOptional. Host path to the Docker socket (default: /var/run/docker.sock). Non-standard paths (e.g. Podman at /run/user/1000/podman/podman.sock) are bind-mounted to /var/run/docker.sock inside the container.Returns
IResourceBuilder<FlociGcpContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithFlociUI(IResourceBuilder<FlociAzureContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)Section titled WithFlociUI(IResourceBuilder<FlociAzureContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)extensionIResourceBuilder<FlociAzureContainerResource> Adds a Floci UI web console container for browsing the resources hosted by the Floci Azure emulator.
public static class FlociHostingExtension{ public static IResourceBuilder<FlociAzureContainerResource> WithFlociUI( this IResourceBuilder<FlociAzureContainerResource> builder, Action<IResourceBuilder<FlociUIContainerResource>>? configureContainer = null, string? containerName = null) { // ... }}Parameters
builderIResourceBuilder<FlociAzureContainerResource>The Floci Azure resource builder.configureContainerAction<IResourceBuilder<FlociUIContainerResource>>optionalConfiguration callback for the Floci UI container resource.containerNamestring?optionalOptional. The name of the Floci UI container (default: {floci-name}-ui).Returns
IResourceBuilder<FlociAzureContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further resource configuration.WithFlociUI(IResourceBuilder<FlociAwsContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)Section titled WithFlociUI(IResourceBuilder<FlociAwsContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)extensionIResourceBuilder<FlociAwsContainerResource> Adds a Floci UI web console container for browsing the resources hosted by the Floci AWS emulator.
public static class FlociHostingExtension{ public static IResourceBuilder<FlociAwsContainerResource> WithFlociUI( this IResourceBuilder<FlociAwsContainerResource> builder, Action<IResourceBuilder<FlociUIContainerResource>>? configureContainer = null, string? containerName = null) { // ... }}Parameters
builderIResourceBuilder<FlociAwsContainerResource>The Floci resource builder.configureContainerAction<IResourceBuilder<FlociUIContainerResource>>optionalConfiguration callback for the Floci UI container resource. Use this to attach additional clouds to the same UI console via WithReference.containerNamestring?optionalOptional. The name of the Floci UI container (default: {floci-name}-ui).Returns
IResourceBuilder<FlociAwsContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further resource configuration.Examples
Use in application host with a Floci resource
var builder = DistributedApplication.CreateBuilder(args);
var floci = builder.AddFlociAws("floci") .WithFlociUI();
builder.Build().Run();WithFlociUI(IResourceBuilder<FlociGcpContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)Section titled WithFlociUI(IResourceBuilder<FlociGcpContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)extensionIResourceBuilder<FlociGcpContainerResource> Adds a Floci UI web console container for browsing the resources hosted by the Floci GCP emulator.
public static class FlociHostingExtension{ public static IResourceBuilder<FlociGcpContainerResource> WithFlociUI( this IResourceBuilder<FlociGcpContainerResource> builder, Action<IResourceBuilder<FlociUIContainerResource>>? configureContainer = null, string? containerName = null) { // ... }}Parameters
builderIResourceBuilder<FlociGcpContainerResource>The Floci GCP resource builder.configureContainerAction<IResourceBuilder<FlociUIContainerResource>>optionalConfiguration callback for the Floci UI container resource.containerNamestring?optionalOptional. The name of the Floci UI container (default: {floci-name}-ui).Returns
IResourceBuilder<FlociGcpContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further resource configuration.WithHostPort(IResourceBuilder<FlociUIContainerResource>, int?)Section titled WithHostPort(IResourceBuilder<FlociUIContainerResource>, int?)extensionIResourceBuilder<FlociUIContainerResource> Configures the host port that the Floci UI resource is exposed on instead of using a randomly assigned port.
public static class FlociHostingExtension{ public static IResourceBuilder<FlociUIContainerResource> WithHostPort( this IResourceBuilder<FlociUIContainerResource> builder, int? port) { // ... }}Parameters
builderIResourceBuilder<FlociUIContainerResource>The resource builder for Floci UI.portint?The port to bind on the host. If null is used a random port will be assigned.Returns
IResourceBuilder<FlociUIContainerResource>The resource builder for Floci UI.WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAwsContainerResource>)Section titled WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAwsContainerResource>)extensionIResourceBuilder<TDestination> Adds a reference to a Floci AWS emulator resource, injecting the standard
ConnectionStrings__{name} entry plus the AWS SDK environment variables ( AWS_ENDPOINT_URL, AWS_DEFAULT_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) so dependent services need no further configuration. public static class FlociHostingExtension{ public static IResourceBuilder<TDestination> WithReference<TDestination>( this IResourceBuilder<TDestination> builder, IResourceBuilder<FlociAwsContainerResource> floci) { // ... }}Parameters
builderIResourceBuilder<TDestination>The resource builder for the resource receiving the reference.flociIResourceBuilder<FlociAwsContainerResource>The Floci AWS resource to reference.Returns
IResourceBuilder<TDestination>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAzureContainerResource>)Section titled WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAzureContainerResource>)extensionIResourceBuilder<TDestination> Adds a reference to a Floci Azure emulator resource, injecting the standard
ConnectionStrings__{name} entry plus AZURE_STORAGE_CONNECTION_STRING — a development storage connection string carrying the Blob, Queue and Table endpoints so all three Azure Storage SDK clients resolve to the emulator. public static class FlociHostingExtension{ public static IResourceBuilder<TDestination> WithReference<TDestination>( this IResourceBuilder<TDestination> builder, IResourceBuilder<FlociAzureContainerResource> floci) { // ... }}Parameters
builderIResourceBuilder<TDestination>The resource builder for the resource receiving the reference.flociIResourceBuilder<FlociAzureContainerResource>The Floci Azure resource to reference.Returns
IResourceBuilder<TDestination>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociAwsContainerResource>)Section titled WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociAwsContainerResource>)extensionIResourceBuilder<FlociUIContainerResource> Attaches an additional Floci AWS emulator resource to an existing Floci UI console, so a single console can browse multiple clouds at once instead of creating a UI container per cloud.
public static class FlociHostingExtension{ public static IResourceBuilder<FlociUIContainerResource> WithReference( this IResourceBuilder<FlociUIContainerResource> builder, IResourceBuilder<FlociAwsContainerResource> cloud) { // ... }}Parameters
builderIResourceBuilder<FlociUIContainerResource>The Floci UI resource builder (from the configureContainer callback of WithFlociUI).cloudIResourceBuilder<FlociAwsContainerResource>The additional Floci AWS resource to attach.Returns
IResourceBuilder<FlociUIContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociAzureContainerResource>)Section titled WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociAzureContainerResource>)extensionIResourceBuilder<FlociUIContainerResource> Attaches an additional Floci Azure emulator resource to an existing Floci UI console, so a single console can browse multiple clouds at once instead of creating a UI container per cloud.
public static class FlociHostingExtension{ public static IResourceBuilder<FlociUIContainerResource> WithReference( this IResourceBuilder<FlociUIContainerResource> builder, IResourceBuilder<FlociAzureContainerResource> cloud) { // ... }}Parameters
builderIResourceBuilder<FlociUIContainerResource>The Floci UI resource builder (from the configureContainer callback of WithFlociUI).cloudIResourceBuilder<FlociAzureContainerResource>The additional Floci Azure resource to attach.Returns
IResourceBuilder<FlociUIContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociGcpContainerResource>)Section titled WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociGcpContainerResource>)extensionIResourceBuilder<FlociUIContainerResource> Attaches an additional Floci GCP emulator resource to an existing Floci UI console, so a single console can browse multiple clouds at once instead of creating a UI container per cloud.
public static class FlociHostingExtension{ public static IResourceBuilder<FlociUIContainerResource> WithReference( this IResourceBuilder<FlociUIContainerResource> builder, IResourceBuilder<FlociGcpContainerResource> cloud) { // ... }}Parameters
builderIResourceBuilder<FlociUIContainerResource>The Floci UI resource builder (from the configureContainer callback of WithFlociUI).cloudIResourceBuilder<FlociGcpContainerResource>The additional Floci GCP resource to attach.Returns
IResourceBuilder<FlociUIContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociGcpContainerResource>)Section titled WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociGcpContainerResource>)extensionIResourceBuilder<TDestination> Adds a reference to a Floci GCP emulator resource, injecting the standard
ConnectionStrings__{name} entry plus the *_EMULATOR_HOST environment variables the Google Cloud SDKs already honor, along with GOOGLE_CLOUD_PROJECT and CLOUDSDK_CORE_PROJECT. public static class FlociHostingExtension{ public static IResourceBuilder<TDestination> WithReference<TDestination>( this IResourceBuilder<TDestination> builder, IResourceBuilder<FlociGcpContainerResource> floci) { // ... }}Parameters
builderIResourceBuilder<TDestination>The resource builder for the resource receiving the reference.flociIResourceBuilder<FlociGcpContainerResource>The Floci GCP resource to reference.Returns
IResourceBuilder<TDestination>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.