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
Notes: - Inputs may include 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_nodegroup
  • aws_postgres, aws_mysql, aws_redis, aws_dynamodb, aws_s3, aws_ses, aws_sns, aws_sqs, aws_documentdb
  • aws_iam_role, aws_iam_policy, aws_iam_user

Embedded modules (GCP)

  • gcp_base, gcp_dns, gcp_gke, gcp_nodepool
  • gcp_postgres, gcp_mysql, gcp_redis, gcp_gcs
  • gcp_service_account, gcp_k8s_service

Embedded modules (Azure)

  • azure_base, azure_aks
  • azure_postgres, azure_redis
  • azure_k8s_service

Shared modules

  • helm_chart

Custom modules

  • Mark spec entries with source: custom to force lookup in your custom modules root (via --modules or profile defaults), or point the entry at a git URL so pltf fetches its metadata directly.
  • Generate module.yaml for your module with pltf 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).