How to use the @aws-cdk/cloudformation-diff.formatSecurityChanges function in @aws-cdk/cloudformation-diff

To help you get started, we’ve selected a few @aws-cdk/cloudformation-diff examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-cdk / packages / aws-cdk / lib / diff.ts View on Github external
export function printSecurityDiff(oldTemplate: any, newTemplate: cxapi.CloudFormationStackArtifact, requireApproval: RequireApproval): boolean {
  const diff = cfnDiff.diffTemplate(oldTemplate, newTemplate.template);

  if (difRequiresApproval(diff, requireApproval)) {
    // tslint:disable-next-line:max-line-length
    warning(`This deployment will make potentially sensitive changes according to your current security approval level (--require-approval ${requireApproval}).`);
    warning(`Please confirm you intend to make the following modifications:\n`);

    cfnDiff.formatSecurityChanges(process.stdout, diff, buildLogicalToPathMap(newTemplate));
    return true;
  }
  return false;
}

@aws-cdk/cloudformation-diff

Utilities to diff CDK stacks against CloudFormation templates

Apache-2.0
Latest version published 5 days ago

Package Health Score

98 / 100
Full package analysis