Modules are discovered from a modules root where each module type directory contains a module.yaml. The CLI scans custom roots (when provided) and the embedded catalog. Modules marked source: custom must be found in your custom root; git/local source entries load metadata directly.
Wiring rules
- Inputs auto-wire to outputs with the same name (current scope, or parent env for services).
- Required inputs without a value or matching output fail validation.
- Optional/default inputs can stay unwired if nothing matches.
- Templates
${module.*},${var.*},${parent.*}are supported and converted to Terraform traversals.
Module metadata (module.yaml)
Example fields:
name: aws_eks
type: aws_eks
provider: aws
version: 1.0.0
description: EKS cluster
cluster: true
inputs:
- name: cluster_name
type: string
required: true
- name: enable_metrics
type: bool
required: true
- name: env_name
type: string
required: true
outputs:
- name: k8s_cluster_name
type: string
- name: plt_cluster_type
type: bool
description, default, capability (optional).
- Outputs may include description, capability.
- cluster: true marks the module as the Kubernetes cluster provider (used for kubernetes/helm/kustomize provider wiring).
- Cluster modules must output k8s_endpoint, k8s_ca_data, k8s_cluster_name, and plt_cluster_type (bool).
- Only one module marked cluster: true can exist across the env+service stack (including stacks).
- Capabilities can declare provides/accepts to describe contracts.
IAM module contract:
- Modules that provide iam.role must declare inputs iam_policy, kubernetes_trusts and output role_arn.
- Modules that provide iam.user must declare input iam_policy and output user_arn.
- Modules that provide iam.policy must declare output policy_arn.
Embedded modules (AWS)
aws_base,aws_dns,aws_eks,aws_nodegroupaws_postgres,aws_mysql,aws_redis,aws_dynamodb,aws_s3,aws_ses,aws_sns,aws_sqs,aws_documentdbaws_iam_role,aws_iam_policy,aws_iam_user
Embedded modules (GCP)
gcp_base,gcp_dns,gcp_gke,gcp_nodepoolgcp_postgres,gcp_mysql,gcp_redis,gcp_gcsgcp_service_account,gcp_k8s_service
Embedded modules (Azure)
azure_base,azure_aksazure_postgres,azure_redisazure_k8s_service
Shared modules
helm_chart
Custom modules
- Mark spec entries with
source: customto force lookup in your custom modules root (via--modulesor profile defaults), or point the entry at a git URL so pltf fetches its metadata directly. - Generate
module.yamlfor your module withpltf module init --path <module_dir> [--force]. - Inventory commands:
pltf module list|get [-m ./modules] -o table|json|yaml.
Treat modules as black boxes: configure via inputs, consume declared outputs, and let wiring handle references.
Module init helper
Use pltf module init --path <module_dir> [--force] to generate or refresh module.yaml from an existing Terraform module. This inspects variables/outputs and writes a fresh descriptor (backing up or overwriting if --force).