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

align output keys with terraform backend keys. #109

Open
mipmip opened this issue Feb 23, 2023 · 2 comments
Open

align output keys with terraform backend keys. #109

mipmip opened this issue Feb 23, 2023 · 2 comments

Comments

@mipmip
Copy link

mipmip commented Feb 23, 2023

small improvement but would make copy paste possible.

@arnvid
Copy link
Contributor

arnvid commented Jun 16, 2023

This can solved easily with having an output in the code like this which creates the backend.tf block.

output "backend_output" {
  value = {
    bucket         = module.terraform_remote_state.state_bucket.bucket
    key            = "ADDYOURKEYPATHHERE"
    dynamodb_table = module.terraform_remote_state.dynamodb_table.name
    region         = data.aws_region.current.name
    profile        = var.profile
  }
}

@motti24
Copy link

motti24 commented May 14, 2024

in addition, I'd recommend to create a local_file that contains the output.
I'm keeping all my backends to a dedicated folder.
A side note: I'm using an empty variable (var.env) and terraform apply prompt the user for input. this var is also the file name in my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants