Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Error trying an example from the docs for 'Example with S3' #3130

Closed
DevopsMercenary opened this issue May 10, 2024 · 0 comments · Fixed by #3136
Closed

Documentation: Error trying an example from the docs for 'Example with S3' #3130

DevopsMercenary opened this issue May 10, 2024 · 0 comments · Fixed by #3136
Labels
bug Something isn't working

Comments

@DevopsMercenary
Copy link

DevopsMercenary commented May 10, 2024

Describe the bug

I'm trying to setup and run a simple example from the docs. The example is here

# Configure terraform state to be stored in S3, in the bucket "my-terraform-state" in us-east-1 under a key that is

and I get a couple of errors.

Steps To Reproduce

I've setup the same folder structure. I have my 'root' /terragrunt.hcl file and I've pasted the example verbatim into the file. Here though I remove the Comments...

remote_state {
  backend = "s3"
  config = {
    bucket = "my-terraform-state"
    key = "${path_relative_to_include()}/terraform.tfstate"
    region = "us-east-1"
    encrypt = true
    dynamodb_table = "my-lock-table"
  }
}

I assume that the file /child/terragrunt.hcl should contain the standard boilerplate....

include "root" {
  path   = find_in_parent_folders()
}

Expected behavior

Running terragrunt plan in the /child folder, I would have expected

But I get the following Error...

$ tg plan
ERRO[0000] Found remote_state settings in /Users/greg/workspace/terragrunt/child/terragrunt.hcl but no backend block in the Terraform code in /Users/greg/workspace/terragrunt/child. 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" {}
}

ERRO[0000] Unable to determine underlying exit code, so Terragrunt will exit with error code 1

It would be nice if the example was complete and noted there needs to be another file.

# This file is not in the sample code, but it is required
 
terraform {
  backend "s3" {}
}
@DevopsMercenary DevopsMercenary added the bug Something isn't working label May 10, 2024
@DevopsMercenary DevopsMercenary changed the title Documentation: Error trying an example from the docs for Single Includes Documentation: Error trying an example from the docs for 'Example with S3' May 10, 2024
@denis256 denis256 mentioned this issue May 14, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant