terraform-aws-vpc
terraform-aws-vpc copied to clipboard
You must define a backend block (it can be empty!) in your Terraform code
Hello,
I'm getting the following issue when I call this module from terragrunt:
You must define a backend block (it can be empty!) in your Terraform code or your remote state settings will have no effect! It should look something like this:
terraform {
backend "s3" {}
}
I went through the files and don't see the backend definition anywhere.
Inside terragrunt code I have the following backend definition:
remote_state {
backend = "s3"
config = {
bucket = "statebucket-name-${get_aws_account_id()}"
key = "${path_relative_to_include()}/terraform.tfstate"
region = "${get_env("TF_VAR_TF_BACKEND_REGION", "us-west-1")}"
encrypt = true
dynamodb_table = "dynamodbtablename-state-lock-${get_aws_account_id()}"
}
}
I'm using the latest module tag. Please advise whether it is a bug or a feature.
Hello, thanks for opening this issue.
Backend settings are always set in the root module. It would sit alongside this module in your HCL definition, never inside the module code.
Unfortunately, your error has nothing to do with this module.
Closing this issue as it is unrelated to the use of the module itself. Hopefully you were able to fix it! :)