Amplify Storage Simulator
raw JSON →Amplify Storage Simulator (v1.11.8) is an S3 API simulator designed for local testing of AWS Amplify projects that use S3 storage. It implements a subset of S3 REST APIs (ListObjects, GetObject, PutObject, DeleteObject, etc.) using a local file system backend, enabling offline development without actual AWS credentials. Part of the AWS Amplify CLI monorepo, it is updated irregularly alongside Amplify CLI releases. Unlike mock AWS services such as localstack or moto, it is lightweight, Amplify-specific, and integrates seamlessly with Amplify's storage category. It ships TypeScript types and is ESM-only. Key differentiators: automatic Amplify resource path mapping, no Docker dependency, and direct integration with Amplify's local mock server.
Common errors
error Error: connect ECONNREFUSED ::1:20005 ↓
error TypeError: (0 , _amplifyStorageSimulator.AmplifyStorageSimulator) is not a constructor ↓
error Error: bucket 'my-bucket' is not configured ↓
error TypeError: Cannot read properties of undefined (reading 'port') ↓
Warnings
deprecated The constructor option 'buckets' as an array of strings is deprecated in v1.8+; use array of objects with 'name' property instead. ↓
gotcha The simulator does not enforce S3 access control policies; all authenticated clients have full access to all buckets. ↓
gotcha Object ETags are generated from UUIDs, not MD5 hashes of content. This may break clients that verify ETag integrity. ↓
breaking In v1.6.0, the 'start()' method changed from synchronous to returning a Promise. Calling 'start()' without await may cause issues. ↓
gotcha The simulator does not support multipart upload operations (CreateMultipartUpload, UploadPart, etc.). ↓
deprecated The 'getPort()' method is deprecated in v1.10+; use the 'port' property instead. ↓
gotcha The simulator only supports the 'us-east-1' region; other regions are not validated but may cause client-side errors. ↓
Install
npm install amplify-storage-simulator yarn add amplify-storage-simulator pnpm add amplify-storage-simulator Imports
- AmplifyStorageSimulator wrong
import AmplifyStorageSimulator from 'amplify-storage-simulator'correctimport { AmplifyStorageSimulator } from 'amplify-storage-simulator' - AmplifyStorageSimulatorServer wrong
const { AmplifyStorageSimulatorServer } = require('amplify-storage-simulator')correctimport { AmplifyStorageSimulatorServer } from 'amplify-storage-simulator' - StorageSimulatorConfig
import type { StorageSimulatorConfig } from 'amplify-storage-simulator'
Quickstart
import { AmplifyStorageSimulator } from 'amplify-storage-simulator';
const sim = new AmplifyStorageSimulator({
port: 20005,
localDir: '/tmp/storage-sim',
buckets: ['my-bucket']
});
await sim.start();
// Now you can use any S3-compatible client to interact with the simulator
// e.g., using @aws-sdk/client-s3
import { S3Client, PutObjectCommand, GetObjectCommand } from '@aws-sdk/client-s3';
const client = new S3Client({
region: 'us-east-1',
endpoint: `http://localhost:${sim.getPort()}`,
forcePathStyle: true,
credentials: {
accessKeyId: 'fake',
secretAccessKey: 'fake'
}
});
await client.send(new PutObjectCommand({
Bucket: 'my-bucket',
Key: 'test.txt',
Body: 'Hello Simulator'
}));
console.log('Object stored!');
await sim.stop();