Floci AWS Emulator

repository·main·Indexed 9 days ago

https://github.com/floci-io/floci

A free, open-source local AWS emulator for development, testing, and CI. It provides AWS-compatible services at http://localhost:4566 without requiring an AWS account or authentication tokens. Includes compatibility test suites for AWS SDKs in Python, TypeScript, Java (v2 2.31.8), Go (v2 1.41.4), and the AWS CLI v2, as well as IaC tools like AWS CDK v2, OpenTofu, and Terraform.

Tokens
209K
Snippets
413
Records
692
Agent score
94%

What's inside Floci

  1. Use Floci Lambda for local function execution

    main

    Floci Lambda provides a local execution environment for Lambda functions using real Docker containers, mimicking AWS Lambda's behavior. It exposes a REST JSON endpoint compatible with the AWS Lambda API.

    Endpoint: http://localhost:4566/2015-03-31/functions/...

  2. SSM Service Overview and Protocol

    main

    The SSM service in Floci provides an implementation of the AWS Systems Manager API. It supports Parameter Store operations, Run Command execution, and the ec2messages Agent Protocol.

    Protocol Details:

    • Format: JSON 1.1
    • Header: X-Amz-Target: AmazonSSM.*
    • Endpoint: POST http://localhost:4566/
  3. Route53 Service Overview and Capabilities

    main

    Floci provides a management-plane emulation of AWS Route53. It allows developers to simulate DNS management operations without actual DNS resolution.

    Key Capabilities:

    • Hosted zone management (create, list, delete).
    • Resource record set manipulation (A, NS, SOA, etc.).
    • Health check management.
    • Change tracking and tagging.

    Important Limitations:

    • No DNS Resolution: This is a management-plane-only implementation; it does not resolve actual DNS queries.
    • Immediate Sync: All changes return a status of INSYNC immediately (no async propagation simulation).
    • Apex Records: Every new hosted zone automatically receives SOA and NS records at the zone apex. These cannot be deleted.
    • Deletion Constraints: DeleteHostedZone will fail with a HostedZoneNotEmpty error if the zone contains any records other than the apex SOA and NS records.
  4. Use Application Auto Scaling in Floci

    main

    Application Auto Scaling is the API used to manage scalable targets and scaling policies for resources like ECS services, MSK broker storage, DynamoDB capacity, and Lambda provisioned concurrency.

    Note: This is distinct from the Auto Scaling service, which handles EC2 Auto Scaling groups. Application Auto Scaling uses the application-autoscaling signing name and the JSON 1.1 protocol.

    Protocol: JSON 1.1 (`X-Amz-Target: AnyScaleFrontendService.*`)
    Endpoint: `POST http://localhost:4566/`
    Signing name: `application-autoscaling`
  5. CloudFront Management-Plane Emulation Overview

    main

    Floci provides a management-plane emulation for AWS CloudFront. It allows developers to simulate the lifecycle and configuration of CloudFront resources without actual content delivery.

    Key Capabilities:

    • Distribution lifecycle management (Create, Get, Update, Delete, List).
    • Cache, Origin Request, and Response Headers policies.
    • Origin Access Control (OAC) and legacy Origin Access Identity (OAI).
    • CloudFront Functions management.
    • Cache invalidations and resource tagging.

    Important Constraints:

    • No Content Delivery: This is a management-plane-only implementation. Actual CDN content delivery and caching are NOT emulated.
    • Immediate State Transitions: Distributions are immediately set to Deployed state (no InProgress delay), and invalidations are immediately marked Completed.
    • Global Service: ARNs are global and contain no region segment (e.g., arn:aws:cloudfront::{accountId}:distribution/{id}).
    • Protocol: REST XML using API version 2020-05-31.
  6. Use Managed Service for Apache Flink (Kinesis Analytics V2) in Floci

    main

    Floci emulates the Amazon Managed Service for Apache Flink (Kinesis Analytics V2 API) at http://localhost:4566/. Unlike a simple mock, Floci runs a real Apache Flink cluster using Docker sidecars. When you start an application, Floci launches a JobManager and TaskManager container, uploads your provided JAR from local S3, and executes the job, allowing the application to reach a genuine RUNNING state.

    export AWS_ENDPOINT_URL=http://localhost:4566
  7. AppSync Service Overview

    main

    Floci implements the AWS AppSync Management API, providing a local emulation of GraphQL API configuration. This includes schema management, data source binding, resolver mapping, API key provisioning, custom domains, and channel namespaces.

    Protocol: REST JSON Endpoint: http://localhost:4566/v1/apis/...

  8. Use Elastic Load Balancing v2 (ELBv2) in Floci

    main

    Floci supports Application Load Balancers (ALB) and Network Load Balancers (NLB) via the ELBv2 management API. The implementation is compatible with the AWS SDK, AWS CLI, and Terraform.

    Protocol: Query (XML) via POST http://localhost:4566/ with an Action= parameter.

    Key Behaviors:

    • Persistence: State for load balancers, target groups, listeners, rules, and tags is persisted in Floci storage and rebuilt on startup.
    • Active State: Load balancers are created in an active state by default.
    • Target Resolution: Instance targets are resolved using EC2 instance private addresses, allowing local load balancer traffic to reach containers.
    • Health Checks: Target health begins in an initial state with the reason Elb.RegistrationInProgress and is updated by Floci's health checker.
    • Listener Sockets: HTTP listener sockets are preserved during configuration changes and only restart if socket-level settings (like the port) change.
    export AWS_ENDPOINT_URL=http://localhost:4566
    
    # Example: Create a load balancer
    aws elbv2 create-load-balancer \
      --name my-alb \
      --type application \
      --scheme internet-facing
  9. KMS Service Overview and Protocol

    main

    The KMS (Key Management Service) in Floci provides cryptographic operations and key management. It is compatible with the AWS KMS API.

    Protocol Details:

    • Format: JSON 1.1
    • Header: X-Amz-Target: TrentService.*
    • Endpoint: POST http://localhost:4566/
  10. Supported AWS services in Floci

    main
    Floci provides local emulation for a wide range of AWS services across multiple categories, including core application services, eventing, identity, infrastructure, and more. Services are implemented either as in-process emulations or via real Docker containers to provide high fidelity for local development.