[GH-ISSUE #85] Please supply a way to pass through terraform init args #44

Closed
opened 2026-05-06 12:36:38 +02:00 by BreizhHardware · 3 comments

Originally created by @dnk8n on GitHub (Nov 30, 2023).
Original GitHub issue: https://github.com/patrickchugh/terravision/issues/85

For example, for projects that abstract secrets from the remote state config we init like this:

terraform init -backend-config=backend.tfconf

From what I can gather, terravision only supports terraform init (no args)

Originally created by @dnk8n on GitHub (Nov 30, 2023). Original GitHub issue: https://github.com/patrickchugh/terravision/issues/85 For example, for projects that abstract secrets from the remote state config we init like this: `terraform init -backend-config=backend.tfconf` From what I can gather, terravision only supports `terraform init` (no args)
Author
Owner

@dnk8n commented on GitHub (Nov 30, 2023):

Note, how corresponding templates look in this case:

#main.tf
terraform {
  backend "s3" {}
}
#backend.tfconf
region = "af-south-1"
bucket = "terraform-state"
key    = "terraform.tfstate"
<!-- gh-comment-id:1833265993 --> @dnk8n commented on GitHub (Nov 30, 2023): Note, how corresponding templates look in this case: ``` #main.tf terraform { backend "s3" {} } ``` ``` #backend.tfconf region = "af-south-1" bucket = "terraform-state" key = "terraform.tfstate" ```
Author
Owner

@patrickchugh commented on GitHub (Dec 2, 2023):

@dnk8n This could be tricky. Running terraform init and terraform plan on an S3 backend or other custom backend that exists will mean terraform in most cases will not create a plan to create all new resources from scratch. I had to implement a workaround by over-riding the backend information that is provided in source with a temporary override.tf that specifies a local backend which was empty to get around this. Any thoughts on how you would envision this working so that we get a fresh plan to create all the resources every time it is run if we allow passing in backend files during init?

<!-- gh-comment-id:1837265160 --> @patrickchugh commented on GitHub (Dec 2, 2023): @dnk8n This could be tricky. Running `terraform init` and` terraform plan` on an S3 backend or other custom backend that exists will mean terraform in most cases will not create a plan to create all new resources from scratch. I had to implement a workaround by over-riding the backend information that is provided in source with a temporary `override.tf` that specifies a local backend which was empty to get around this. Any thoughts on how you would envision this working so that we get a fresh plan to create all the resources every time it is run if we allow passing in backend files during init?
Author
Owner

@patrickchugh commented on GitHub (Dec 20, 2023):

Didn't hear back so closing

<!-- gh-comment-id:1865251630 --> @patrickchugh commented on GitHub (Dec 20, 2023): Didn't hear back so closing
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/terravision#44
No description provided.