UNPKG

cdk-pretty-diff

Version:

Formatting tool for CDK Diff output. Inspired by Terraform prettyplan (https://github.com/chrislewisdev/prettyplan)

48 lines (47 loc) 1.76 kB
import * as cfnDiff from '@aws-cdk/cloudformation-diff'; export declare const cdkDiffCategories: readonly ["iamChanges", "securityGroup", "resources", "parameters", "metadata", "mappings", "conditions", "outputs", "unknown", "description"]; export type CdkDiffCategories = typeof cdkDiffCategories; export type CdkDiffCategory = CdkDiffCategories[number]; export type StackRawDiff = { stackName: string; rawDiff: cfnDiff.TemplateDiff; logicalToPathMap: Record<string, string>; }; export type NicerDiffChange = { label: string; from?: any; to: any; action: 'ADDITION' | 'UPDATE' | 'REMOVAL'; }; export type NicerDiff = { label: string; cdkDiffRaw: string; nicerDiff?: { cdkDiffCategory: CdkDiffCategory; resourceAction: 'ADDITION' | 'UPDATE' | 'REMOVAL'; resourceType: string; resourceLabel: string; changes: NicerDiffChange[]; }; }; export declare const nicerDiffGuard: (thing: any) => thing is NicerDiff; export type NicerStackDiff = { diff?: NicerDiff[]; raw: string; stackName: string; }; export declare const nicerStackDiffGuard: (thing: any) => thing is NicerStackDiff; export declare const nicerStackDiffValidator: (thing: any) => NicerStackDiff[]; export declare const guardResourceDiff: (thing: any) => thing is cfnDiff.ResourceDifference; export declare const diffValidator: (thing: any) => { diffCollectionKey: CdkDiffCategory; diffCollection: cfnDiff.DifferenceCollection<any, cfnDiff.Difference<any>>; } | { diffKey: CdkDiffCategory; diff: cfnDiff.Difference<any>; }; export type CdkToolkitDeploymentsProp = 'cloudFormation' | 'deployments'; export interface DiffOptions { context?: Record<string, string>; profile?: string; }