terraformprovider can both provision a Terraform stack when initializing Garden, or through
terraformmodules that are deployed like other services in your stack.
kubernetesprovider then runs on, along with the services in the project. The drawback is that Garden doesn't currently watch for changes in those Terraform files, and you need to restart to apply new changes, or apply them manually.
terraformmodules, can be better if your other providers don't need to reference the stack outputs but your services, tasks and tests do. In this style, you can basically create small Terraform stacks that are part of your Stack Graph much like other services. A good example would be deploying a database instance, that other services in your project can then connect to.
initRootparameter tells Garden that there is a Terraform working directory at the specified path. If you don't specify this, Garden doesn't attempt to apply a stack when initializing the provider.
kubernetesprovider. This can be very powerful, and allows you to fully codify your full project setup, not just the services running in your environment. Any Garden module can also reference the provider outputs in the exact same way, so you can easily provide your services with any information they need to operate.
autoApplyflag on the config for the stack. Instead, Garden will warn you if the stack is out of date.
terraformCLI command, but you need to place them after a
--so that they aren't parsed as Garden options. For example, to apply the root stack with
terraformmodules as part of your project, which act much like other Garden modules. A
terraformmodule maps to a single service, that you can define as a runtime dependency for any of your other services and tasks. You can also reference the stack outputs of a
terraformmodule using runtime output template strings. For example:
my-database-urioutput, that we then supply to
terraform/backend.tfmanifest, we need to replace the
keybased on which environment we are building.
project.garden.yamlfile for this sample, the exec provider calls an initScript that replaces in-place the pre-existing state file with a copy that substitutes the s3 bucket name with the environment name in the