Panfactum LogoPanfactum
Infrastructure-as-CodeUsing Panfactum Modules

Using Panfactum Modules

We provide 100+ OpenTofu (Terraform) modules that define the infrastructure comprising the Panfactum stack.

You can find the full list here.

All source code for the modules are found here.

You can directly deploy these modules via your terragrunt configuration code.

Sourcing via Terragrunt

We use the following terragrunt variables, to automatically configure your terraform.source.

  • pf_stack_version: Check here for the full list of available releases. This should be the same version as used for the Panfactum devenv. Set this in each environment.yaml so that you can test version updates in one environment at a time.

  • module: The name of the module to deploy. Defaults to the directory name if not provided. Should be set in the module.yaml. Example.

In each module's terragrunt.hcl, you can set the source via the terraform source block to include.panfactum.locals.pf_stack_source.

For example, to use a Panfactum module your code would look like this:

include "panfactum" {
  path   = find_in_parent_folders("panfactum.hcl")
  expose = true
}

terraform {
  source = include.panfactum.locals.pf_stack_source
}

Sourcing via Terraform

You do not have to deploy third-party modules directly. You can instead include them via your own first-party infrastructure modules.

You can accomplish this via module blocks in your infrastructure code (docs).

For example:

module "pod_template" {
  source       = "github.com/Panfactum/stack.git/packages/infrastructure//kube_pod?ref=24-05.0"

  # Inputs below
  ...
}