Skip to content

Summary Plugin

The summary plugin posts plan summaries as MR/PR comments. It is enabled by default and collects results from all other plugins (cost, policy) into a single comment.

Configuration

yaml
extensions:
  summary:
    enabled: true            # default: true (opt out with false)
    on_changes_only: false   # only comment when there are changes
    include_details: true    # include full plan output in expandable sections
    labels:
      - terraform
      - "{environment}"
      - "{module}"
      - "resource:{resource_type}"

Options

enabled

Enable or disable the summary plugin. Since summary uses EnabledByDefault policy, it is active unless explicitly disabled.

yaml
extensions:
  summary:
    enabled: false   # disable plan summary comments

on_changes_only

Only post a comment when the plan contains changes (add/change/destroy).

yaml
extensions:
  summary:
    on_changes_only: true

include_details

Include full plan output in expandable <details> sections within the comment.

yaml
extensions:
  summary:
    include_details: true   # default

labels

Synchronize TerraCI-managed MR/PR labels after posting the summary comment.

yaml
extensions:
  summary:
    labels:
      - terraform
      - "{environment}"
      - "{module}"
      - "resource:{resource_type}"

Static labels are added once. Templates without resource placeholders expand once per changed or failed module. Templates with resource_* placeholders expand once per changed Terraform resource in changed modules.

Supported placeholders:

PlaceholderValue
{module_id}Plan result module ID
{module_path}Plan result module path
{status}Plan result status
{service}, {environment}, {region}, {module}Structure components from structure.pattern
custom segment namesAny custom component from structure.pattern
{resource_address}Terraform resource address
{resource_type}Terraform resource type
{resource_name}Terraform resource name
{resource_action}Terraform action (create, update, delete, replace, read)

Empty or unresolved labels are skipped with a warning. Generated labels are trimmed, deduplicated, sorted, and preserve case.

Label synchronization is managed: TerraCI removes only labels that were generated by a previous TerraCI summary comment and are absent in the current run. User-owned labels are not removed. Label sync failures are warning-only; comment publishing errors still fail terraci summary.

CLI Command

bash
terraci summary

The terraci summary command scans for plan results in the service directory, loads plugin reports (cost, policy, tfupdate), composes a markdown comment, posts it to the MR/PR via the active CI provider's comment service, and synchronizes configured managed labels when the provider supports labels.

See Also

Released under the MIT License.