infra-sync

Compares Terraform and CDK infrastructure definitions to detect parity gaps and generate fixes.

892|225|Updated May 29, 2025
One-click install
npx skills add https://github.com/agentic-community/mcp-gateway-registry --skill infra-sync
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: infra-sync
Source: https://github.com/agentic-community/mcp-gateway-registry/tree/main/.claude/skills/infra-sync
Command: npx skills add https://github.com/agentic-community/mcp-gateway-registry --skill infra-sync

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Teams maintaining the same AWS infrastructure in both Terraform and CDK face configuration drift, where changes to one IaC tool silently diverge from the other, causing inconsistent deployments and hard-to-trace environment differences.

Core Features & Use Cases

  • Full or Targeted Sync Checks: Compare ECS services, networking, storage, secrets, IAM, observability, and CI/CD resources across terraform/aws-ecs/ and infra/ using a detailed file mapping and per-area checklists.
  • Parity Reporting: Generate a structured parity report with per-area status, discrepancy tables, intentional differences, and prioritized fix recommendations.
  • Automated Fix Application: Apply corrections to the target IaC tool and verify with npx tsc --noEmit for CDK or terraform validate for Terraform.
  • Use Case: After updating ECS task definitions in Terraform, run a targeted sync to confirm the CDK stacks define identical environment variables, secrets, and health checks before deployment.

Quick Start

Ask the assistant to check whether the Terraform and CDK infrastructure are in sync and report any parity gaps.

Frequently Asked Questions about infra-sync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if Terraform and CDK infrastructure are in sync?

Run a full sync check that reads both terraform/aws-ecs/ and infra/ configurations and compares ECS services, networking, storage, secrets, and IAM resource by resource. The result is a parity report listing every discrepancy with the required fix.

How to compare ECS task definitions between Terraform and CDK?

Compare container images, CPU/memory, port mappings, environment variables, secrets, EFS mounts, health checks, and auto-scaling settings for each service. Environment variables are the most common drift source, so compare them line by line.

Can I sync only one area like networking or secrets?

Yes, targeted sync mode compares a single area such as ECS services, networking, storage, or secrets. Each area has a defined file mapping between Terraform files and CDK stack files plus a dedicated comparison checklist.

Are all differences between Terraform and CDK treated as errors?

No, known intentional differences are excluded from sync warnings, such as CDK's circuit breaker, HOME=/tmp on the registry container, DocumentDB credential passing, and the Keycloak URL fallback. These are documented with their rationale.

How are fixes verified after syncing infrastructure code?

CDK changes are verified by running npx tsc --noEmit in the infra directory to confirm TypeScript compiles. Terraform changes are checked with terraform fmt and terraform validate in terraform/aws-ecs.