From LocalStack to Production: What Changes When Your AWS Code Runs for Real
Your Terraform applies cleanly against LocalStack. Your boto3 tests pass against Floci or Moto. The code is written, the CI pipeline is green, and now it has to run somewhere real. Typically that place is an AWS region. But what if there was another option? This guide walks through what changes when the same AWS code moves from an emulator to Spinifex, an AWS-compatible cloud that runs on your…
When migrating AWS code from LocalStack or Floci to Spinifex, a production-ready AWS-compatible cloud, several key changes arise. The core code remains the same, but you need to adjust the endpoint, credentials, and TLS configuration to move from emulation to real AWS services.
The endpoint configuration changes significantly. Spinifex uses two endpoints: the AWS gateway on port 9999 for most services and a Predastore endpoint on port 8443 for S3. This is a departure from the single HTTP port (4566) used by LocalStack emulators.
Credentials also differ. Emulators accept any key, while Spinifex requires real access keys verified with SigV4. You'll need to replace any "test" keys and point your SDK and AWS CLI at Spinifex's certificate authority.
IAM policies are evaluated on every request in Spinifex, unlike emulators where they're often off by default. This means code that previously ran without issues against LocalStack may now fail on Spinifex due to insufficient permissions.
EC2 instances in Spinifex are actual virtual machines booted from AMIs, unlike the in-memory or Docker containers used by LocalStack emulators. This change impacts startup times, AMI lookups, and the use of user data through cloud-init.
Security groups in Spinifex are enforced as stateful firewall rules in the hypervisor, unlike the mock enforcement seen in LocalStack. State also persists in Spinifex until you explicitly delete it, requiring changes to your testing and clean-up processes.
You should check Spinifex's compatibility with your specific services before deploying. While Spinifex supports many AWS services, it doesn't cover Lambda, DynamoDB, SQS, or SNS. Additionally, be aware that the root user in Spinifex bypasses policy evaluation, so avoid using it for production workloads. Instead, create dedicated IAM users or roles for each pipeline and workload.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.