Agent Skill · Harness

manage-iacm

Manage Harness Infrastructure as Code Management (IaCM) via MCP. Configure Terraform workspaces with remote state and RBAC, set up continuous drift detection with auto-remediation, design multi-tier change approval workflows, and estimate infrastructure costs before deployment. Use when asked to manage Terraform workspaces, detect infrastructure drift, set up approval workflows for infrastructure changes, or estimate Terraform costs. Do NOT use for creating Harness infrastructure definitions (use create-infrastructure instead) or OPA policies (use create-policy instead). Trigger phrases: terraform, workspace, drift detection, infrastructure cost, IaCM, state management, change approval, terraform plan, infracost, infrastructure governance.

Provider: Harness Path in repo: skills/manage-iacm/SKILL.md

Skill body

Manage IaCM

Configure Terraform workspaces, drift detection, change approval workflows, and cost estimation in Harness Infrastructure as Code Management.

Instructions

Step 1: Establish Scope

Confirm the user’s org, project, cloud provider, and environments.

Call MCP tool: harness_list
Parameters:
  resource_type: "project"
  org_id: "<organization>"

Step 2: Identify the IaCM Task

Determine which workflow the user needs:

  1. Workspace and State Management – Workspace structure, remote state, RBAC, module registry
  2. Drift Detection – Continuous drift scanning with remediation workflows
  3. Change Approval Workflows – Risk-based approval tiers for infrastructure changes
  4. Cost Estimation – Pre-deployment cost impact analysis using Infracost

Step 3: Configure Workspaces and State Management

Gather from the user:

Design workspace structure:

Configure module registry:

Step 4: Set Up Drift Detection

Gather from the user:

Configure drift detection:

Remediation workflows:

Step 5: Design Change Approval Workflows

Gather risk categories from the user:

Call MCP tool: harness_create
Parameters:
  resource_type: "pipeline"
  org_id: "<organization>"
  project_id: "<project>"
  body:
    pipeline:
      name: "terraform-change-approval"
      identifier: "terraform_change_approval"
      stages:
        - stage:
            name: Plan
            type: CI
            spec:
              # terraform plan + output change summary
        - stage:
            name: Cost Estimate
            type: CI
            spec:
              # infracost diff
        - stage:
            name: Approval
            type: Approval
            spec:
              # risk-based approval routing
        - stage:
            name: Apply
            type: CI
            spec:
              # terraform apply

Step 6: Estimate Infrastructure Costs

When asked for cost estimation:

Present a cost report with:

Examples

Performance Notes

Troubleshooting

State Locking Conflicts

Drift Detection False Positives

Cost Estimation Missing Resources

Skill frontmatter

metadata: {"author"=>"Harness", "version"=>"1.0.0", "mcp-server"=>"harness-mcp-v2"} license: Apache-2.0 compatibility: Requires Harness MCP v2 server (harness-mcp-v2)