-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having issues with more complex templates (e.g. !Ref, FindInMap, !If ) #46
Comments
@mraliagha when cfn-lint provides errors it will do so by prefixing them with
|
I've also just installed the package and seem to have similar issues. A more complete example, which is providing a This template deploys fine and I can't see why there would be an error. Resources:
PublicSubnet1:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
AvailabilityZone: !Select [0, !GetAZs ""]
CidrBlock: !Ref PublicSubnet1CIDR
MapPublicIpOnLaunch: true
Tags:
- Key: Name
Value: !Sub ${EnvironmentName} Public Subnet (AZ1) My // Custom tags for the parser to use
"yaml.customTags": [
"!And",
"!If",
"!Not",
"!Equals",
"!Or",
"!FindInMap",
"!Base64",
"!Cidr",
"!Ref",
"!Sub",
"!GetAtt",
"!GetAZs",
"!ImportValue",
"!Select",
"!Split",
"!Join"
],
// Enable/disable default YAML formatter (requires restart)
"yaml.format.enable": true,
"cfnLint.path": "/usr/local/bin/cfn-lint" The version of When I run it against the YAML file directly it doens't raise these errors. |
Replacing the
with AvailabilityZone:
Fn::Select: [0, !GetAZs ""] Fixes the issue with the error being raised in the IDE, but both are valid syntaxes (and I would vastly prefer to use the shortened version). This seems to happen wherever the shortened function syntax is used within the parameters of another shortened function. |
OK, my fix so far after further research. I have adjusted my I'm sure I'll probably have to make further changes to this over time, but it appears the value suggested for configuring CloudFormation plugins is incorrect. Here is my current settings: "yaml.customTags": [
"!And",
"!If",
"!Not",
"!Equals",
"!Or",
"!FindInMap sequence",
"!Base64",
"!Cidr",
"!Ref",
"!Sub",
"!GetAtt scalar",
"!GetAtt sequence",
"!GetAZs",
"!ImportValue",
"!Select sequence",
"!Split",
"!Join sequence"
] |
Thanks @waynerobinson I'm actually going to update my settings to match this as well. Since this is all related to this plugin https://github.com/redhat-developer/vscode-yaml are you or @mraliagha ok with me closing this issue? |
Yes. Mine is fixed as well. Thank you. |
Thanks. |
I have installed this extension on Visual Studio Code. Although it is installed properly, the plugin does not recognize more advanced templates. Is that correct or I am missing some part of the installation?
For example, every tag starts with "!" is unknown including the following tags:
!Ref
!FindInMap
!If
The text was updated successfully, but these errors were encountered: