pistazie / cdk-dia

Automated diagrams of CDK provisioned infrastructure
MIT License
895 stars 38 forks source link

chore: add mapping for mac1 and mac2 ec2 instance families #28

Closed cgatt closed 2 years ago

cgatt commented 2 years ago

This is a simple PR to support the new Mac1 and Mac2 instance types, which currently throw an exception when cdk-dia is run on a repo using them:

Uncaught TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null
    at new NodeError (node:internal/errors:372:5)
    at validateString (node:internal/validators:120:11)
    at Object.join (node:path:1172:7)
    at AwsIconSupplier.instanceIconByFamily (file:///usr/local/lib/node_modules/cdk-dia/dist/src/diagram/aws/aws-icon-supplier.js:82:46)
    at AwsIconSupplier.matchEC2InstanceIcon (file:///usr/local/lib/node_modules/cdk-dia/dist/src/diagram/aws/aws-icon-supplier.js:64:21)
    at AwsIconSupplier.matchIcon (file:///usr/local/lib/node_modules/cdk-dia/dist/src/diagram/aws/aws-icon-supplier.js:35:29)
    at AwsDiagramGenerator.generateCfnComponent (file:///usr/local/lib/node_modules/cdk-dia/dist/src/diagram/aws/aws-diagram-generator.js:153:40)
    at AwsDiagramGenerator.generateComponent (file:///usr/local/lib/node_modules/cdk-dia/dist/src/diagram/aws/aws-diagram-generator.js:77:30)
    at AwsDiagramGenerator.generateSubTree (file:///usr/local/lib/node_modules/cdk-dia/dist/src/diagram/aws/aws-diagram-generator.js:63:32)
    at file:///usr/local/lib/node_modules/cdk-dia/dist/src/diagram/aws/aws-diagram-generator.js:67:41

This re-uses the base MAC instance icon, as no new icons are available for mac1 and mac2 instances at this time.

pistazie commented 2 years ago

released as 0.7.1