question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[REQUEST] Terraform Enterprise backend support

See original GitHub issue

Is your feature request related to a problem? Please describe. It appears that runway only supports terraform backends of type s3, currently. My organization has acquired Terraform Enterprise, and we are working on migrating our Terraform state storage from S3 to Terraform Enterprise. Since we heavily use runway, this lack of support is causing us trouble.

Describe the solution you’d like I’ve thought of a few potential solutions to this problem:

  • Update the terraform_backend_config property (and the backend config file feature) to support remote backend properties.
  • Another potential solution could be providing the option to skip terraform init. I don’t think this is inline with the mission of runway, but I’m guessing it would be a quicker/easier change.
  • Update the terraform backend configuration syntax to be more like that of terragrunt. If, instead of using backend[-*].tfvars files, runway used a templatized backend[-*].hcl file, this feature request likely wouldn’t be required and further flux in the backend space wouldn’t require rework and runway (disclaimer: I assume this is the case, as I’ve not done a deep dive on this area of the runway codebase)
  • Add support for terragrunt as a module type that runway can deploy.

Describe alternatives you’ve considered A few things I’ve tried to get around this limitation:

  • Passing a backend-config arg to terraform (despite the warning in the docs)
  • Adding a backend[-*].tfvars file with the best guesses at appropriate variable names
  • Running terraform init for terraform modules before running runway deploy

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ITProKylecommented, Jul 22, 2020

PRs are always welcome for bug fixes, planned/approved features, etc.

For this one, it may be better to let me take care of it. I have a few thoughts on removing restrictions on values passed to terraform_backend_config to open it up for future needs rather than just supporting the remote backend.

The other items I will likely turn into toggleable options to allow their use at the users discretion.

I should be able to start on this later today and will let you know when I have a usable build if you would like to beta test it.

0reactions
ITProKylecommented, Jul 24, 2020

updated https://github.com/ITProKyle/terraform-cloud-test to include example uses of both workspaces.name and workspaces.prefix. I also update the lock file to reference a new commit that should now autodetect when a remote backend is being used and deal with it appropriately depending on the use of name or prefix.


through a bit of digging, I was able to find this issue: https://github.com/hashicorp/terraform/issues/21830. It would appear that not being able to specify workspaces is a bug in v0.12 - it had worked in v0.11. The issue has been open for over a year at this point so theres no telling if it will be fixed but hopefully it will be fixed for v0.13.

I’m not sure if adding support for providing it as a CLI argument for v0.11 only is worth while but I can do it if it would be useful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Backend Type: remote | Terraform - HashiCorp Developer
As of Terraform v1.1.0 and Terraform Enterprise v202201-1, we recommend using the ... The remote backend supports the following Terraform commands:.
Read more >
Docs overview | hashicorp/tfe - Terraform Registry
This provider is used to interact with the many resources supported by Terraform Cloud. As Terraform Enterprise is a self-hosted distribution of Terraform ......
Read more >
Backend Type: terraform enterprise
This backend is useful for uncommon tasks like migrating state into a Terraform Enterprise workspace, but we no longer recommend using it as...
Read more >
Troubleshooting the Terraform integration with GitLab
The GitLab backend accepted the request, but internally stripped the period and any characters that followed from the state name. For example, a...
Read more >
How to manage Terraform state - Gruntwork Blog
A number of remote backends are supported, including Amazon S3, Azure Storage, Google Cloud Storage, and HashiCorp's Terraform Cloud and Terraform Enterprise.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found