AWS SAM YAML template - Unknown Tag !Ref












2















When I try to deploy my AWS SAM YAML file, it fails saying the !Ref is an unknown tag.



enter image description here



Any ideas to get around this?



AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Resources:
MySimpleFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs4.3
CodeUri: s3://<bucket>/MyCode.zip
Events:
MyUploadEvent:
Type: S3
Properties:
Id: !Ref Bucket
Events: Create
Bucket:
Type: AWS::S3::Bucket









share|improve this question

























  • I think the ! notation is still not supported. Try just REF

    – Zoran Pandovski
    Nov 25 '18 at 18:05











  • Using !Ref in a YAML AWS SAM is definitely posssible.

    – Dunedan
    Nov 25 '18 at 18:14











  • @EdsonF: What's generating the error message? What's the IDE you're using?

    – Dunedan
    Nov 25 '18 at 18:15











  • @Dunedan Visual Studio 2017. And I've also tried Visual Studio Code, to no availe

    – EdsonF
    Nov 25 '18 at 18:17













  • Does it fail when you run sls deploy?

    – tkwargs
    Nov 25 '18 at 22:19
















2















When I try to deploy my AWS SAM YAML file, it fails saying the !Ref is an unknown tag.



enter image description here



Any ideas to get around this?



AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Resources:
MySimpleFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs4.3
CodeUri: s3://<bucket>/MyCode.zip
Events:
MyUploadEvent:
Type: S3
Properties:
Id: !Ref Bucket
Events: Create
Bucket:
Type: AWS::S3::Bucket









share|improve this question

























  • I think the ! notation is still not supported. Try just REF

    – Zoran Pandovski
    Nov 25 '18 at 18:05











  • Using !Ref in a YAML AWS SAM is definitely posssible.

    – Dunedan
    Nov 25 '18 at 18:14











  • @EdsonF: What's generating the error message? What's the IDE you're using?

    – Dunedan
    Nov 25 '18 at 18:15











  • @Dunedan Visual Studio 2017. And I've also tried Visual Studio Code, to no availe

    – EdsonF
    Nov 25 '18 at 18:17













  • Does it fail when you run sls deploy?

    – tkwargs
    Nov 25 '18 at 22:19














2












2








2








When I try to deploy my AWS SAM YAML file, it fails saying the !Ref is an unknown tag.



enter image description here



Any ideas to get around this?



AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Resources:
MySimpleFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs4.3
CodeUri: s3://<bucket>/MyCode.zip
Events:
MyUploadEvent:
Type: S3
Properties:
Id: !Ref Bucket
Events: Create
Bucket:
Type: AWS::S3::Bucket









share|improve this question
















When I try to deploy my AWS SAM YAML file, it fails saying the !Ref is an unknown tag.



enter image description here



Any ideas to get around this?



AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Resources:
MySimpleFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs4.3
CodeUri: s3://<bucket>/MyCode.zip
Events:
MyUploadEvent:
Type: S3
Properties:
Id: !Ref Bucket
Events: Create
Bucket:
Type: AWS::S3::Bucket






yaml amazon-cloudformation serverless aws-serverless aws-sam






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 26 '18 at 7:43









Dunedan

2,20151522




2,20151522










asked Nov 25 '18 at 18:01









EdsonFEdsonF

1,54721929




1,54721929













  • I think the ! notation is still not supported. Try just REF

    – Zoran Pandovski
    Nov 25 '18 at 18:05











  • Using !Ref in a YAML AWS SAM is definitely posssible.

    – Dunedan
    Nov 25 '18 at 18:14











  • @EdsonF: What's generating the error message? What's the IDE you're using?

    – Dunedan
    Nov 25 '18 at 18:15











  • @Dunedan Visual Studio 2017. And I've also tried Visual Studio Code, to no availe

    – EdsonF
    Nov 25 '18 at 18:17













  • Does it fail when you run sls deploy?

    – tkwargs
    Nov 25 '18 at 22:19



















  • I think the ! notation is still not supported. Try just REF

    – Zoran Pandovski
    Nov 25 '18 at 18:05











  • Using !Ref in a YAML AWS SAM is definitely posssible.

    – Dunedan
    Nov 25 '18 at 18:14











  • @EdsonF: What's generating the error message? What's the IDE you're using?

    – Dunedan
    Nov 25 '18 at 18:15











  • @Dunedan Visual Studio 2017. And I've also tried Visual Studio Code, to no availe

    – EdsonF
    Nov 25 '18 at 18:17













  • Does it fail when you run sls deploy?

    – tkwargs
    Nov 25 '18 at 22:19

















I think the ! notation is still not supported. Try just REF

– Zoran Pandovski
Nov 25 '18 at 18:05





I think the ! notation is still not supported. Try just REF

– Zoran Pandovski
Nov 25 '18 at 18:05













Using !Ref in a YAML AWS SAM is definitely posssible.

– Dunedan
Nov 25 '18 at 18:14





Using !Ref in a YAML AWS SAM is definitely posssible.

– Dunedan
Nov 25 '18 at 18:14













@EdsonF: What's generating the error message? What's the IDE you're using?

– Dunedan
Nov 25 '18 at 18:15





@EdsonF: What's generating the error message? What's the IDE you're using?

– Dunedan
Nov 25 '18 at 18:15













@Dunedan Visual Studio 2017. And I've also tried Visual Studio Code, to no availe

– EdsonF
Nov 25 '18 at 18:17







@Dunedan Visual Studio 2017. And I've also tried Visual Studio Code, to no availe

– EdsonF
Nov 25 '18 at 18:17















Does it fail when you run sls deploy?

– tkwargs
Nov 25 '18 at 22:19





Does it fail when you run sls deploy?

– tkwargs
Nov 25 '18 at 22:19












2 Answers
2






active

oldest

votes


















1














This error message is almost certainly a false-positive from the YAML parser your IDE is using. To assess the correctness of the AWS SAM template, you should use cfn-python-lint instead, which comes with plugins for most major IDEs (unfortunately not for Visual Studio, but for Visual Studio Code).






share|improve this answer































    0














    You can use the Full name. Just remove the !, wrap it with quote notation and the whole expression with {}:



    {"Ref": Bucket}





    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53470329%2faws-sam-yaml-template-unknown-tag-ref%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      This error message is almost certainly a false-positive from the YAML parser your IDE is using. To assess the correctness of the AWS SAM template, you should use cfn-python-lint instead, which comes with plugins for most major IDEs (unfortunately not for Visual Studio, but for Visual Studio Code).






      share|improve this answer




























        1














        This error message is almost certainly a false-positive from the YAML parser your IDE is using. To assess the correctness of the AWS SAM template, you should use cfn-python-lint instead, which comes with plugins for most major IDEs (unfortunately not for Visual Studio, but for Visual Studio Code).






        share|improve this answer


























          1












          1








          1







          This error message is almost certainly a false-positive from the YAML parser your IDE is using. To assess the correctness of the AWS SAM template, you should use cfn-python-lint instead, which comes with plugins for most major IDEs (unfortunately not for Visual Studio, but for Visual Studio Code).






          share|improve this answer













          This error message is almost certainly a false-positive from the YAML parser your IDE is using. To assess the correctness of the AWS SAM template, you should use cfn-python-lint instead, which comes with plugins for most major IDEs (unfortunately not for Visual Studio, but for Visual Studio Code).







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 25 '18 at 18:19









          DunedanDunedan

          2,20151522




          2,20151522

























              0














              You can use the Full name. Just remove the !, wrap it with quote notation and the whole expression with {}:



              {"Ref": Bucket}





              share|improve this answer




























                0














                You can use the Full name. Just remove the !, wrap it with quote notation and the whole expression with {}:



                {"Ref": Bucket}





                share|improve this answer


























                  0












                  0








                  0







                  You can use the Full name. Just remove the !, wrap it with quote notation and the whole expression with {}:



                  {"Ref": Bucket}





                  share|improve this answer













                  You can use the Full name. Just remove the !, wrap it with quote notation and the whole expression with {}:



                  {"Ref": Bucket}






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 27 '18 at 10:53









                  Kostas TzouvalidisKostas Tzouvalidis

                  1




                  1






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53470329%2faws-sam-yaml-template-unknown-tag-ref%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      404 Error Contact Form 7 ajax form submitting

                      How to know if a Active Directory user can login interactively

                      TypeError: fit_transform() missing 1 required positional argument: 'X'