terraform
provider can both provision a Terraform stack when initializing Garden, or through terraform
modules that are deployed like other services in your stack.kubernetes
provider 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.terraform
modules, 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.initRoot
parameter 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.kubernetes
provider. 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.autoApply
flag on the config for the stack. Instead, Garden will warn you if the stack is out of date.autoApply
for private development environments, since otherwise you may accidentally apply hazardous changes, or conflict with other users of an environment.terraform
CLI 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 -auto-approve
:terraform
modules as part of your project, which act much like other Garden modules. A terraform
module 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 terraform
module using runtime output template strings. For example:my-database-uri
output, that we then supply to my-service
via the DATABASE_URI
environment variable.repositoryUrl
key. See the Remote Sources guide for details.