kops: Terraform output needs an option to exclude the provider block
Since one of the primary purposes of the Terraform output is to fit into an existing TF environment, the provider block is likely to already exist. It would be great if there were a simple flag to --include-provider=[true|false].
It may even make sense to default to false given what I assume to be the more common workflow.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 18 (10 by maintainers)
Odds are if someone is using TF output from Kops they’re already using TF and have a provider with a region specified. Given that, my thought was that the block itself could be optional because what Kops outputs may not be exactly right for the user (ie. they have access keys being passed to the provider, or an alias).
The block is definitely needed, it’s just a question of where it comes from.
This can be easily done using
terrsformitself, not sure putting that logic insidekopswill not over complicate things.kopsshould keep things simple.Terraform supports overrides nativelly. So you could put an
override.tffile in the same directory wherekopsoutputs theterraformconfgs. Theoverride.tffile could contain something like:That’s it, now when you
applythe configs,terraformwill know to use your provider instead ofkops’s one. In my case I do lot’s of overrides without affectingkopsgenerated configs whatsoever. Works for me for long time without issues.Read more about
terraformoverrides: https://www.terraform.io/docs/configuration/override.html