cfn-template-compare

Compares deployed CloudFormation templates with local CDK-synthesized ones to detect drift.

9|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/pantheon-org/tekhne --skill cfn-template-compare
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cfn-template-compare
Source: https://github.com/pantheon-org/tekhne/tree/main/skills/infrastructure/cfn/template-compare
Command: npx skills add https://github.com/pantheon-org/tekhne --skill cfn-template-compare

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires aws-cli, jq, make, bash, diff, comm, and includes scripts (resource) and references (resource) and evals (resource) components.

What problem does it solve?

This Skill helps ensure your infrastructure deployments are safe and predictable by comparing your local CDK-synthesized CloudFormation templates against the currently deployed stack, detecting drift, and validating changes before they go live.

Core Features & Use Cases

  • Drift Detection: Identify manual changes made directly in the AWS console that deviate from your IaC.
  • Pre-deployment Validation: Review exactly what will change before running cdk deploy.
  • Security Audits: Specifically check for changes in IAM policies, security group rules, and CDK Nag suppressions.
  • Use Case: Before deploying a new version of your application stack, use this Skill to compare your local template with the production stack. It will highlight any added, removed, or modified resources, allowing you to confirm that only intended changes are being made and that no critical security configurations have been altered.

Quick Start

Use the cfn-template-compare skill to compare your local CDK template with the deployed 'my-app-stack' in the 'us-east-1' region using the 'dev' profile.

Frequently Asked Questions about cfn-template-compare

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

FAQPage Schema
How do I detect drift between deployed CloudFormation templates and local CDK code?

CloudFormation drift detection compares deployed stack templates against locally synthesized CDK templates to identify manual console changes. This process highlights added, removed, or modified resources deviating from your infrastructure-as-code before deployment.

Can I validate IAM policy and security group changes before running cdk deploy?

Pre-deployment validation reviews synthesized CDK template changes against deployed stacks to specifically audit IAM policies and security group rules. This ensures no critical security configurations are altered before running cdk deploy.

Do I need AWS CLI and jq to compare CDK templates with deployed stacks?

Yes, comparing CDK templates with deployed CloudFormation stacks requires AWS CLI, jq, bash, make, diff, and comm. These dependencies fetch deployed templates and process structural template comparisons locally.

What is the best way to run a cdk diff review for pre-deployment validation?

The best way to run cdk diff reviews is comparing local CDK-synthesized CloudFormation templates against currently deployed stacks. This validates exact infrastructure changes, ensuring predictable and safe deployments across AWS environments.

Does cfn-template-compare work with AWS CDK Nag suppressions?

Yes, template comparison supports security audits by specifically checking for changes in CDK Nag suppressions alongside IAM policies. This validates that security configurations remain consistent between local templates and deployed stacks.