You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@aws-cdk/cloudformation-diff

Package Overview
Dependencies
Maintainers
4
Versions
589
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-cdk/cloudformation-diff

Utilities to diff CDK stacks against CloudFormation templates

2.103.0
Source
npm
Version published
Weekly downloads
373K
-3.16%
Maintainers
4
Weekly downloads
 
Created

What is @aws-cdk/cloudformation-diff?

@aws-cdk/cloudformation-diff is a package that provides tools to compare AWS CloudFormation templates. It helps in identifying the differences between two CloudFormation templates, which is useful for understanding changes before applying them.

What are @aws-cdk/cloudformation-diff's main functionalities?

Template Diffing

This feature allows you to compare two CloudFormation templates and identify the differences. The `diffTemplate` function takes two templates as input and returns the differences.

const { diffTemplate } = require('@aws-cdk/cloudformation-diff');
const templateA = require('./templateA.json');
const templateB = require('./templateB.json');
const differences = diffTemplate(templateA, templateB);
console.log(differences);

Change Detection

This feature helps in detecting specific changes between two templates. By iterating over the differences, you can log or handle each change individually.

const { diffTemplate } = require('@aws-cdk/cloudformation-diff');
const templateA = require('./templateA.json');
const templateB = require('./templateB.json');
const differences = diffTemplate(templateA, templateB);
differences.forEach(diff => {
  console.log(`Change detected: ${diff}`);
});

Resource Comparison

This feature focuses on comparing resources within the templates. It allows you to identify changes specific to resources, which is useful for understanding the impact on infrastructure.

const { diffTemplate } = require('@aws-cdk/cloudformation-diff');
const templateA = require('./templateA.json');
const templateB = require('./templateB.json');
const differences = diffTemplate(templateA, templateB);
differences.resources.forEach(resourceDiff => {
  console.log(`Resource change detected: ${resourceDiff}`);
});

Other packages similar to @aws-cdk/cloudformation-diff

Keywords

aws

FAQs

Package last updated on 26 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts