mach-composer-cli
mach-composer-cli copied to clipboard
Add template option to extend generated Terraform configuration
This could be useful for example to add extra custom Terraform providers.
For example with an terraform_extension_template: tf-tmpl.tf
option in the MACH config.
A direct use case. For a component using Stripe as payment provider I need to include their provider:
terraform {
required_providers {
stripe = {
source = "franckverrot/stripe"
version = "1.8.0"
}
}
}
Also support variables (varfile and env) like so:
terraform {
required_providers {
stripe = {
source = "franckverrot/stripe"
version = "1.8.0"
username = ${var.provider.username}
username = ${env.STRIPE_USERNAME}
}
}
}
I think this can now be achieved via plugins.
Of course creating a plugin for only adding a provider seems overkill. But it's quite easy to create a reusable provider setting plugin (mach-composer-plugin-add-providers
)
Agree to close?
Agree with the approach. Let's close this once we have some clear instructions on this in the documentation