Skip to main content

composite

Depot-local supports composite location with dynamoDB + elastic search

To start elastic search container elastic search port should be added to DepotLocal config:

const depot = new DepotLocal({
depot: {
port: 8089
},
dynamodb: {
port: 8000
},
elasticSearch: {
port: 9200
}
});

Port allocation is optional so the above declaration may be simplified to:

const depot = new DepotLocal({
depot: {},
dynamodb: {},
elasticSearch: {}
});

to create environment config with dynamo and elastic search composite location you need to use environment builder:

const namespace = Schemas.fromYamlFiles("test/schema/pet.yml");
const environment = new EnvironmentBuilder(pet).location(LocationBuilder.dynamoElastic()).build();
const api = depot.deploy(environment).api(0);
caution

the environment and api values should not be shared, but private to each individual test. This will ensure Depot-Local provides an empty dataset at each execution.