Playground lets you launch, manage, and clean up cloud instances across multiple providers. The playground itself is stateless, so you choose how to track instances.
- Install the package
npm install @tobimadehin/playground- Create a provider map
import { AWSProvider, Playground } from '@tobimadehin/playground';
const providers = new Map();
providers.set('aws', new AWSProvider({
accessKeyId: '...',
secretAccessKey: '...',
region: 'us-east-1'
}));
const playground = new Playground({
providers,
imageMappingsPath: './examples/image-mappings.yaml'
});- Launch an instance
const instance = await playground.createInstance({
imageType: 'ubuntu-22-small',
sshKey: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAB... user@host'
});
console.log('Instance created:', instance.id, instance.ip);- Track and clean up
import { PlaygroundUtils } from '@tobimadehin/playground';
if (PlaygroundUtils.isExpired(instance)) {
await playground.destroyInstance(instance.provider, instance.id);
}- View example configurations
- View provider implementations
- Learn about state management patterns
- Explore multi-cloud failover and region-specific deployments
- Check-out dployr (Your app, your server, your rules!) - https://dployr.dev
MIT License — see LICENSE for details.