cfn-lint | A CloudFormation JSON and YAML Validator | YAML Processing library

 by   martysweet TypeScript Version: 1.9.7 License: MIT

kandi X-RAY | cfn-lint Summary

kandi X-RAY | cfn-lint Summary

cfn-lint is a TypeScript library typically used in Utilities, YAML Processing applications. cfn-lint has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

A CloudFormation JSON and YAML Validator
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              cfn-lint has a low active ecosystem.
              It has 167 star(s) with 42 fork(s). There are 12 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 39 open issues and 79 have been closed. On average issues are closed in 57 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of cfn-lint is 1.9.7

            kandi-Quality Quality

              cfn-lint has 0 bugs and 0 code smells.

            kandi-Security Security

              cfn-lint has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              cfn-lint code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              cfn-lint is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              cfn-lint releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 7866 lines of code, 0 functions and 129 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cfn-lint
            Get all kandi verified functions for this library.

            cfn-lint Key Features

            No Key Features are available at this moment for cfn-lint.

            cfn-lint Examples and Code Snippets

            No Code Snippets are available at this moment for cfn-lint.

            Community Discussions

            QUESTION

            CloudFormation cnf-lint Obsolete "DependsOn"
            Asked 2021-Dec-18 at 11:39

            When running cfn-lint on the following code I get a warning

            ...

            ANSWER

            Answered 2021-Dec-17 at 22:20

            Yes, the warning is valid since the Ref usage implicitly defines a dependency on MicroserviceLoadBalancerSGPrivate. Technically speaking, redundant would be more correct than obsolete.

            Unless you specifically need MicroserviceSG to be created after MicroserviceLoadBalancerSGPrivate, then you should remove the DependsOn and let CloudFormation do it's thing, as CloudFormation will optimize and parallelize the deployment.

            The most common use of the DependsOn is to enforce the creation and deletion of resources in a certain order, as mentioned by the documentation:

            You can use the DependsOn attribute with any resource. Here are some typical uses: Declare dependencies for resources that must be created or deleted in a specific order

            The DependsOn documentation has more scenarios on when and why you might want to use DependsOn.

            Source https://stackoverflow.com/questions/70399358

            QUESTION

            Creating Managed Policy in CDK errors with MalformedPolicy
            Asked 2021-Dec-18 at 06:18

            When I try to deploy a seemingly simple CDK stack, it fails with a strange error. I don't get this same behavior when I create a different iam.ManagedPolicy in a different file, and that one has a much more complicated policy with several actions, etc. What am I doing wrong?

            ...

            ANSWER

            Answered 2021-Dec-18 at 06:18

            The role ARN rolename was incorrect; I was missing a colon after iam. So it's iam:: not iam:. I think I copied the single colon from a (wrong) example somewhere on the Internet. Gah...

            Source https://stackoverflow.com/questions/70400687

            QUESTION

            With pre-commit hook getting "E0000 Template needs to be an object."
            Asked 2021-Aug-06 at 09:41

            cfn-lint version: 0.53.0

            Description of issue.

            I have following setup on my Ubuntu machine

            1. cfn-lint
            2. cfn-python-lint via pre-commit

            Case 1: If I run cfn-lint ./**/*.yml from terminal at the project root folder then there are no errors

            Case 2: If I now try to git commit the code with pre-commit installed, it gives the following error "E0000 Template needs to be an object." for the parameters JSON file.

            The parameter JSON looks something like this:

            ...

            ANSWER

            Answered 2021-Aug-06 at 09:41

            In Case 1, you are only matching files with a *.yml extension and not a JSON extension. However, in Case 2, being your pre-commit hook, you do include json files as well. Meaning it will probably try to interpret your parameters JSON file as a CloudFormation file.

            Your parameters file isn't CloudFormation however, it is a simple JSON array containing some values. A CloudFormation file is always an object, never an array at the top level. This would explain the error message. The solution: only include files in your cfn-python-lint scan that are actually CloudFormation files.

            Source https://stackoverflow.com/questions/68664454

            QUESTION

            AWS cloudformation: How to run cfn-nag locally in Windows
            Asked 2021-Jul-15 at 10:53

            I have a cloud formation template where I have all the resources and details for the project.

            I have the cfn-lint setup locally and it is running perfectly fine. However when I push the code changes, build fails at deployment stage due to cfn-nag stating some simple changes which could be fixed.

            I'm using windows machine and I need a way to run this cfn-nag locally so that I could check this just like cfn-lint and fix them locally instead of waiting 40 minutes for build till it reaches deployment stage.

            I referred several posts online, found below two helpful

            https://stelligent.com/2018/03/23/validating-aws-cloudformation-templates-with-cfn_nag-and-mu/ https://github.com/stelligent/cfn_nag

            What is the difference between cfn-nag and cfn-lint and why lint is not failing on what cfn-nag is complaining about?

            The above links have some instructions on Ruby and Brew but I'm using Nodejs, felt lost. Please help.

            ...

            ANSWER

            Answered 2021-Jul-15 at 10:53

            CFN-Nag looks for patterns in AWS CloudFormation templates that may indicate insecure infrastructure,

            Ex:

            IAM rules that are too permissive (wildcards), Security group rules that are too permissive (wildcards), Access logs that aren’t enabled, Encryption that isn’t enabled,

            CFN-Lint scans the AWS CloudFormation template by processing a collection of Rules, where every rule handles a specific function check or validation of the template. It validates against AWS CloudFormation Resource specification.

            This collection of rules can be extended with custom rules using the --append-rules argument.

            Ex: Whitespaces, alignment(YAML), type checks, valid values for resource properties, and other best practices.

            Those two links you previded above have all the information needed, just not directly for a Nodejs developer using a Windows machine.

            Step1: Pull the docket image stelligent/cfn-nag

            Step2: Add the script to your package.json for cfn-nag

            Ex:

            Source https://stackoverflow.com/questions/68327451

            QUESTION

            How to check if CloudFormation template is correct?
            Asked 2021-Jun-30 at 22:27

            I want to deploy an SQS queue from a CloudFormation template. Is there any issue with my template?

            ...

            ANSWER

            Answered 2021-Jun-30 at 21:35

            sqs:SendMessage is missing the end quote

            Recommend trying the CloudFormation Linter in VSCode to see some of these errors inline while authoring templates along with autocompletion and documentation links

            Source https://stackoverflow.com/questions/68199178

            QUESTION

            Cloudformation DynamoDB-API Gateway Proxy
            Asked 2021-Mar-20 at 00:18

            I was trying to implement a dynamodb proxy using apigateway. But when invoking it, the api is returning error,

            Fri Mar 19 20:30:27 UTC 2021 : Execution failed due to configuration error: Unable to transform request

            Fri Mar 19 20:30:27 UTC 2021 : Method completed with status: 500

            To me it looks like the issue is not with the requestTemplates transformation(?), but what else, any idea?

            Cloudformation template.

            ...

            ANSWER

            Answered 2021-Mar-19 at 22:40

            I think this line is the issue:

            Source https://stackoverflow.com/questions/66715419

            QUESTION

            Differentiate between Shell Variables and Cloudformation template parameters
            Asked 2021-Feb-15 at 12:27

            I have come across a usecase where i am seeing conflict between Shell Variables and Cloudformation Parameters.

            Example:

            I am writing AWS::ImageBuilder::Component

            ...

            ANSWER

            Answered 2021-Feb-15 at 12:26

            You have to escape your variables using ${!} notation:

            Source https://stackoverflow.com/questions/66206218

            QUESTION

            Cfn-Lint : Property "ExecutionRoleArn" has no valid Refs to Resources at Resources/TaskDefinition/Properties/ExecutionRoleArn/Ref
            Asked 2021-Feb-02 at 11:13

            I am building a cloudformation template to run ECS cluster and ECS tasks on AWS.

            Also i am using Atom Text editor with plugin Cfn-Lint.

            I am facing below issue in cfn linter validation in Atom text editor as shown in image.

            Sharing some code snippet

            ...

            ANSWER

            Answered 2021-Feb-02 at 11:13

            To get the Arn, you have to use GetAtt intristic function:

            Source https://stackoverflow.com/questions/66008337

            QUESTION

            "Parameter values specified for a template which does not require them." when trying to deploy a conformance pack via AWS cloudformation
            Asked 2020-Nov-12 at 09:16

            I am working on a proof of concept for deploying a conformance pack via AWS cloudformation and I am stumped by the error "Parameter values specified for a template which does not require them." The config rule I am using does require a parameter. Code is attached. I have also tested the template with cfn-lint and do not receive any feedback/errors.

            My template is "simple" and below:

            ...

            ANSWER

            Answered 2020-Nov-12 at 09:16

            The cause is that you are passing a parameter (the one specified in ConformancePackInputParameters) to a CloudFormation template (the one specified in TemplateBody) that does not contain a Parameters section and therefore expects no parameters. To solve this, you need to add a parameter to the inner CloudFormation template, which you can then refer to in predefinedPolicyName:

            The following template works for me:

            Source https://stackoverflow.com/questions/64794787

            QUESTION

            Use macro inside CloudFormation Conditions
            Asked 2020-Sep-10 at 00:16

            I've written a macro (called BucketChecker) that takes in an s3 bucket name and checks if it already exists. The fragment will return true or false accordingly.

            I would like to use this macro in a Conditions section as described in this article: https://cloudnineapps.com/blogs/cloud-computing/how-to-create-dynamic-condition-expressions-in-aws-cloudformation-using-macros/.

            The idea is to use this as a condition in my template like this:

            ...

            ANSWER

            Answered 2020-Jul-10 at 10:39

            Based on the comments.

            The cfn-linter was incorrectly classifying the Fn::Transform as malformed.

            Deploying the stack confirmed that there are no issues with the Fn::Transform.

            Source https://stackoverflow.com/questions/62817550

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install cfn-lint

            You can install with npm:. If you get /usr/bin/env: 'node': No such file or directory ensure your system has NodeJs installed. On Debian systems you may need to symlink node to nodejs due to namespacing issues (ln -s /usr/bin/nodejs /usr/bin/node).
            If you use a JetBrains editor, the following Run Configuration can be setup for the Mocha test suite:. Node Options: None Extra Mocha Options: None Test Directory: /lib/test.

            Support

            Ask a question on the Github Issue Page!.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i cfn-lint

          • CLONE
          • HTTPS

            https://github.com/martysweet/cfn-lint.git

          • CLI

            gh repo clone martysweet/cfn-lint

          • sshUrl

            git@github.com:martysweet/cfn-lint.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular YAML Processing Libraries

            yq

            by mikefarah

            yaml

            by go-yaml

            js-yaml

            by nodeca

            yaml

            by symfony

            yaml-cpp

            by jbeder

            Try Top Libraries by martysweet

            latex-to-speech

            by martysweetPython

            alexa-tv-remote

            by martysweetPython

            gapps-sheets-extractor-to-s3

            by martysweetPython