Skip to content
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

[Regression] Cloudformation Support #77

Closed
17twenty opened this issue Jul 19, 2018 · 23 comments
Closed

[Regression] Cloudformation Support #77

17twenty opened this issue Jul 19, 2018 · 23 comments
Labels
Milestone

Comments

@17twenty
Copy link

@17twenty 17twenty commented Jul 19, 2018

Originally closed issue in #20 but it looks like Cloudformation support is no longer present.

image

This is with the following tags:

...
    "yaml.customTags": [
        "!Ref",
        "!GetAtt",
        "!FindInMap sequence",
        "!FindInMap scalar",
        "!GetAtt",
        "!GetAZs",
        "!Cidr",
        "!ImportValue",
        "!Join sequence",
        "!Select",
        "!Split",
        "!Sub sequence",
        "!Sub scalar",
        "!And",
        "!Equals",
        "!If",
        "!Not",
        "!Or"
    ]
@JPinkney
Copy link
Member

@JPinkney JPinkney commented Jul 19, 2018

What are the errors?

@17twenty
Copy link
Author

@17twenty 17twenty commented Jul 19, 2018

unacceptable node kind for !<!FindInMap> tag; it should be "scalar", not "sequence"
@17twenty
Copy link
Author

@17twenty 17twenty commented Jul 19, 2018

It also triggers follow on errors like missed comma between flow collection entries but that seems to be a knock on effect of the previous

@JPinkney
Copy link
Member

@JPinkney JPinkney commented Jul 21, 2018

It looks like instead of checking if the !FindInMap contains either scalar or sequence its looking like it is instead throwing an error when one one is found but not the other.

@JPinkney JPinkney added the bug label Jul 21, 2018
@17twenty
Copy link
Author

@17twenty 17twenty commented Jul 21, 2018

The sample above is from the AWS codepipeline tutorial here https://s3.amazonaws.com/cloudformation-examples/user-guide/continuous-deployment/wordpress-single-instance.zip

Hope that helps!

@dessite
Copy link

@dessite dessite commented Oct 15, 2018

Any luck with fixing?
I have error

unknown tag <!Ref>

despite having

"yaml.customTags": [
        "!Ref",
        "!GetAtt",
        "!FindInMap sequence",
        "!FindInMap scalar",
        "!GetAtt",
        "!GetAZs",
        "!Cidr",
        "!ImportValue",
        "!Join sequence",
        "!Select",
        "!Split",
        "!Sub sequence",
        "!Sub scalar",
        "!And",
        "!Equals",
        "!If",
        "!Not",
        "!Or"
    ]
@str3tch
Copy link

@str3tch str3tch commented Oct 16, 2018

I have similar error for !Join:

unacceptable node kind for !<!Join> tag; it should be "scalar", not "sequence"

@farmerbean
Copy link

@farmerbean farmerbean commented Oct 16, 2018

I had this issue too. Custom tags setup in user.settings, etc.

Removed cloudformation plugin
Removed rhel yaml plugin

Added in cloudformation plugin
(cloudformation plugin installed rhel yaml dependency)

Problem now (temporarily I assume!) resolved.

@wgroenewald
Copy link

@wgroenewald wgroenewald commented Oct 23, 2018

Still not working for me. This is the contents of my settings.json:
{ "workbench.startupEditor": "newUntitledFile", "git.enableSmartCommit": true, "window.zoomLevel": 0, "files.associations": {}, "yaml.customTags": [ "!Ref", "!GetAtt", "!FindInMap sequence", "!FindInMap scalar", "!GetAtt", "!GetAZs", "!Cidr", "!ImportValue", "!Join sequence", "!Select", "!Split", "!Sub sequence", "!Sub scalar", "!And", "!Equals", "!If", "!Not", "!Or"] }

Still get the error, unknown tag <!Equals>

Anyone have any luck resolving yet?
Tried reinstalling Cloudformation and YAML for RHEL plugin, no luck

@deepu105
Copy link

@deepu105 deepu105 commented Oct 25, 2018

This works for me, but if you are using scalar types with those you will have issues

    "yaml.customTags": [
        "!fn",
        "!And",
        "!If",
        "!Not",
        "!Equals",
        "!Or",
        "!FindInMap sequence",
        "!Base64",
        "!Cidr",
        "!Ref",
        "!Sub",
        "!GetAtt",
        "!GetAZs",
        "!ImportValue",
        "!Select",
        "!Split",
        "!Join sequence"
    ]
@sgtoj
Copy link

@sgtoj sgtoj commented Nov 15, 2018

I resolved a similar issue by renaming my template to end with yaml extension. Same file throws errors with yml extension.

@dan-petty
Copy link

@dan-petty dan-petty commented Nov 21, 2018

Is there a fix in the works for this? Have to disable validation make the editor usable:
"yaml.validate": false

@JPinkney
Copy link
Member

@JPinkney JPinkney commented Nov 21, 2018

Not currently. Would you like to contribute one? I can show you where to get started.

@dan-petty
Copy link

@dan-petty dan-petty commented Nov 21, 2018

I'm not familiar with vscode extensions but I can take a look...

@JPinkney
Copy link
Member

@JPinkney JPinkney commented Nov 21, 2018

@tanduong
Copy link

@tanduong tanduong commented Nov 30, 2018

It appears that after added "!If sequence" to the list of custom tags, I need to restart my editor and it will work.

@mandersondesign
Copy link

@mandersondesign mandersondesign commented Dec 18, 2018

I ended up using this one so far...

"yaml.customTags": [
        "!fn",
        "!And",
        "!If",
        "!Not",
        "!Equals",
        "!Or",
        "!FindInMap sequence",
        "!Base64",
        "!Cidr",
        "!Ref",
        "!Sub",
        "!GetAtt",
        "!GetAZs",
        "!ImportValue",
        "!Select",
        "!Split",
        "!Join sequence",
        "!Select sequence"
    ]
@strannik19
Copy link

@strannik19 strannik19 commented Jan 4, 2019

none of the customTags options work when you mix and max sequence and scalar. it only uses the first one and doesn't allow for the alternative option. so far the only way to go is "yaml.validate": false.

@zoellner
Copy link

@zoellner zoellner commented Jan 11, 2019

Replacing "!Equals", with "!Equals sequence", in the settings worked for me for this

@JPinkney
Copy link
Member

@JPinkney JPinkney commented Mar 20, 2019

Hi everyone! Its been a long time coming but I've finally got custom tags working when you have a tag with multiple different types. That means in the next version you're able to do:

"yaml.customTags": [
        "!myTag1 scalar",
        "!myTag1 mapping",
        "!myTag1 sequence",
    ]

and the document will report no errors if you have something like:

test: !myTag1 hello_world

test2: !myTag1
  hello: world

test3: !myTag1
  - hello: world
@Splike
Copy link

@Splike Splike commented Apr 4, 2019

@JPinkney That's pretty cool! If I just have

"yaml.customTags": [
        "!myTag1"
    ]

I think it would make sense that scalar, mapping and sequence should all be accepted for !myTag1

@lorcanoeire
Copy link

@lorcanoeire lorcanoeire commented Jul 16, 2019

This is the full set of required configurations (worked for me):

{
    "window.zoomLevel": 0,
    "workbench.colorTheme": "Material Theme Darker",
    "yaml.customTags": [
        "!And scalar",
        "!And mapping",
        "!And sequence",                
        "!If scalar",
        "!If mapping",
        "!If sequence",                
        "!Not scalar",
        "!Not mapping",
        "!Not sequence",                
        "!Equals scalar",
        "!Equals mapping",
        "!Equals sequence",                
        "!Or scalar",
        "!Or mapping",
        "!Or sequence",                
        "!FindInMap scalar",
        "!FindInMap mappping",        
        "!FindInMap sequence",
        "!Base64 scalar",
        "!Base64 mapping",
        "!Base64 sequence",                
        "!Cidr scalar",
        "!Cidr mapping",
        "!Cidr sequence",                
        "!Ref scalar",
        "!Ref mapping",
        "!Ref sequence",                
        "!Sub scalar",
        "!Sub mapping",
        "!Sub sequence",                
        "!GetAtt scalar",
        "!GetAtt mapping",
        "!GetAtt sequence",                
        "!GetAZs scalar",
        "!GetAZs mapping",
        "!GetAZs sequence",                
        "!ImportValue scalar",
        "!ImportValue mapping",
        "!ImportValue sequence",                
        "!Select scalar",
        "!Select mapping",
        "!Select sequence",
        "!Split scalar",
        "!Split mapping",
        "!Split sequence",                
        "!Join scalar",
        "!Join mapping",
        "!Join sequence"                
    ],
    "yaml.format.enable": true,
}
@benkehoe
Copy link

@benkehoe benkehoe commented Oct 31, 2019

The CloudFormation extension has added support to do this configuration automatically. aws-cloudformation/aws-cfn-lint-visual-studio-code#65

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet