Learn how to spawn new layer instances or kill existing ones.
spawn
a layer instance. That layer instance is based off of a layer definition previously provisioned to a Layerform back-end.
Once an engineer is done using an environment, they can kill
their environment so it stops consuming resources and incurring charges.
layerform spawn
command. This command takes the name of the layer definition to use, and the ID you want to assign to the new layer instance.
For example, if you want to create an instance of your services
layer and assign it an ID of my-dev
, you can run layerform spawn services my-dev
.
default
to use as underlying layers.
If a dependency whose ID is default
does not exist, Layerform will create one.
--base
flag when running layerform spawn
.
This flag takes a list of layer definition names and IDs.
Assume you have a services
layer that depends on k8s
and sqs
layers, for example. In that case, you can tell layerform
to use the k8s
layer instance whose ID is first
by running the command below.
example
layer for services
on top of the k8s
layer instance whose id is first
. It will also use the sqs
layer instance whose ID is default
because an ID was not specified for sqs
.
k8s
and sqs
layers, use k8s=first,sqs=second
as an argument to --base
, as shown in the command below.
k8s
whose ID is first
and the instance for sqs
whose ID is second
.
layerform kill
followed by a layer definition name and the ID of the layer instance you want to destroy.
Assume you want to destroy an instance of the services
layer definition whose ID is my-instance
, for example. In that case, you could run layerform kill services my-instance
.
services
whose ID is services-example
running on top of a base
layer whose ID is base-example
. In that case, running layerform kill base base-example
will cause an error.
The only way to kill the base-example
instance of base
is to kill the services-example
layer first.