Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cfn-resolver-lib

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cfn-resolver-lib

Library that resolves AWS Cloudformation templates with exact values

  • 1.0.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20K
increased by0.41%
Maintainers
1
Weekly downloads
 
Created
Source

cfn-resolver-lib

Build Status npm version

JavaScript library that resolves and evaulates values in CloudFormation templates based on the provided stack parameters and produces the JS object representation of the resolved CFN template.

Did you ever had to debug what's wrong with your CloudFormation template and why your stack deployment fails? Your YAML/JSON could contain some logic with all kinds of nested intrinsic functions and CFN pseudo parameters and sometimes this can get even more complex when you use a tool (e.g. AWS CDK) that generates the file for you.

If you have more than couple of these in your templates it is quite time consuming to figure out which exactly caused the deployment to fail. This simple tool (cfn-resolver-lib and cfn-resolver-cli) tries to mitigate the issue by evaulating these logic and provide the final exact values that will be used in deployment time.

cfn-resolver can help you

  • understand your CFN template better
  • troublesoot CloudFormation deployment issues faster
  • secure your IaC with unit tests that assert on exact values before actually deploying anything
    • e.g. your unit test now can assert that the s3_reader IAM user has access to prod-uswest2-redshift-log S3 bucket in us-west-2 region in your prod stack.

CLI and Examples

Check out cfn-resolver-cli

How to use?

Install the npm package

npm i cfn-resolver-lib

Write your JavaScript code:

const NodeEvaulator = require('cfn-resolver-lib');

const stackParameters = {
  RefResolveres:
  {
      "AWS::Region": "us-west-2",
      "AWS::Partition": "aws",
      "AWS::AccountId": "000000111111",
      "Stage": "prod",
      "AWS::StackId": "MyEvaulatedFakeStackUsWest2"
  },
  "Fn::GetAttResolvers": {
      AuditLogsBucket: {
          "Arn": "arn:aws:s3:::prod-uswest2-redshift-log"
      }
  }
};

const resolvedObj = new NodeEvaulator(cloufFormationTemplateDeseralizedObj, stackParameters).evaulate();

Supported Features

Unsported Features

Roadmap

  • Enchance Fn::Sub to work with template parameter names, resource logical IDs, resource attributes
  • Support Fn::ImportValue
  • Support Fn::Base64
  • Support Fn::Cidr
  • Add linter/debugging features by identified valudation errors and warnings found during template evaulation (e.g. like cfn-lint)

Contribution

Feel free to implement any missing features or fix bugs. In any case don't forget to add unit tests.

Keywords

FAQs

Package last updated on 11 Dec 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc