patrickchugh / terravision

Terravision creates Professional Cloud Architecture Diagrams from your Terraform code automatically. Supports AWS, Google and Azure.
Mozilla Public License 2.0
683 stars 67 forks source link

Please supply a way to pass through terraform init args #85

Closed dnk8n closed 6 months ago

dnk8n commented 7 months ago

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)

dnk8n commented 7 months ago

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"
patrickchugh commented 7 months ago

@dnk8n This could be tricky. Running terraform init andterraform 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?

patrickchugh commented 6 months ago

Didn't hear back so closing