Learn what is a Layerform back-end and how to use and provision them.
spawn
or kill
command. Those commands cause the CLI to fetch layer definitions and the necessary pieces of state. The CLI will also update the state in the back-end when it changes.
local
and s3
.
The local
back-end means you will store state and layer definitions on disk.
The problem with using the local
back-end is that other members of the team won’t have access to your layer definitions and their state.
The s3
back-end specifies the S3 bucket into which Layerform will store layer definitions and state.
By using an s3
back-end you enable your whole team to fetch the definitions you provisioned. Additionally, your team can share core pieces of infrastructure because they will have access to shared state in the cloud.
config.yml
file in the ~/.layerform
folder.
layers.json
file. This file has definitions for each layer, as shown below.
layerform configure
to provision these layers to your S3 bucket.
layerform spawn
and layerform kill
.
Those commands cause the Layerform CLI to fetch state and layer definitions from the back-end so it knows which Terraform files to run.
config.yaml
file within ~/.layerform
so it pulls and writes data to the correct place.
To use an S3 bucket, you must add a context
entry whose type
is s3
. That entry must specify the bucket’s name under the bucket
key.
Then, you should set currentContext
to the name of your S3 context, as shown below.
context
entry must use the type local
and specify the directory containing your layer definitions and state.