patrickchugh / terravision

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

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

Closed dnk8n closed 11 months ago

dnk8n commented 1 year 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 1 year 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 12 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 11 months ago

Didn't hear back so closing