docs/src/data/commands/backend/bootstrap.mdx
import { Aside } from '@astrojs/starlight/components';
Using this command bootstraps the resources described in your remote_state block.
If any of the resources described in the remote_state block need provisioning, bootstrap will provision them. If they are present, but configured in a way that differs from remote_state configuration, Terragrunt will attempt to update them when it is safe to do so.
For example, if you have the following remote_state block:
# terragrunt.hcl
remote_state {
backend = "s3"
config = {
bucket = "mybucket"
key = "path/to/my/key"
region = "us-east-1"
encrypt = true
dynamodb_table = "tf-lock"
accesslogging_bucket_name = "mybucket-logs"
}
}
Then run the following:
terragrunt backend bootstrap
You'll ensure the availability of:
mybucket in the us-east-1 region with the following enabled:
tf-lock in the us-east-1 region with SSE.mybucket-logs configured as the access log destination for the mybucket bucket.The bootstrap command is idempotent. If the resources already exist, bootstrap will not provision them again.
The flag --backend-bootstrap is equivalent to explicitly running the bootstrap command.
Using it in conjunction with any run command will result in any required bootstrapping to be performed prior to initiating the run.