Monday, December 26, 2022

AWS CloudFormation

 

cfn-lint (Windows)

  • Install Python
  • Install cfn-lint

pip install cfn-lint

    • Add PATH to Environment Variables of Windows system
In my local computer, I can find cfn-lint.exe here

C:\Users\username\AppData\Roaming\Python\Python310\Scripts

  • Use with the command below

cfn-lint .\cfn-main.yaml

  • VS Code extension setting
    • Install CloudFormation Linter
    • CloudFormation Linter > Extension Settings (@ext:kddejong.vscode-cfn-lint)
    • Set the path to Cfn Lint: Path
In my local computer, the path is like below

C:\Users\username\AppData\Roaming\Python\Python310\Scripts\cfn-lint.exe


VS Code Plugin for CloudFormation (Windows)

  • Install the plugin through VS code extension (CloudFormation by aws-scripting-guy)
  • VS Code > View > Command Palette
    • Enter settings.json
    • Go to Preferences: Open User Settings (JSON)
    • Add yaml.customTags
"yaml.customTags": [
        "!Base64 scalar",
        "!Cidr scalar",
        "!And sequence",
        "!Equals sequence",
        "!If sequence",
        "!Not sequence",
        "!Or sequence",
        "!Condition scalar",
        "!FindInMap sequence",
        "!GetAtt scalar",
        "!GetAtt sequence",
        "!GetAZs scalar",
        "!ImportValue scalar",
        "!Join sequence",
        "!Select sequence",
        "!Split sequence",
        "!Sub scalar",
        "!Transform mapping",
        "!Ref scalar",
    ]

YAML expression










No comments:

Post a Comment