How to use the @aws-cdk/cfnspec.scrutinizableResourceTypes function in @aws-cdk/cfnspec

To help you get started, we’ve selected a few @aws-cdk/cfnspec 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 / cloudformation-diff / lib / diff / types.ts View on Github external
private scrutinizableResourceChanges(scrutinyTypes: cfnspec.schema.ResourceScrutinyType[]): ResourceChange[] {
    const ret = new Array();

    const scrutinizableTypes = new Set(cfnspec.scrutinizableResourceTypes(scrutinyTypes));

    for (const [resourceLogicalId, resourceChange] of Object.entries(this.resources.changes)) {
      if (!resourceChange) { continue; }

      const commonProps = {
        oldProperties: resourceChange.oldProperties,
        newProperties: resourceChange.newProperties,
        resourceLogicalId
      };

      // Even though it's not physically possible in CFN, let's pretend to handle a change of 'Type'.
      if (resourceChange.resourceTypeChanged) {
        // Treat as DELETE+ADD
        if (scrutinizableTypes.has(resourceChange.oldResourceType!)) {
          ret.push({
            ...commonProps,