question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

YAML creates nested objects instead of string representations

See original GitHub issue

ESDomain.AdvancedOptions parsed to object.

Description

The update/deployment of an “AWS::Elasticsearch::Domain” using 1.13.x

For bug reports:

The AdvancedOptions are broken and invalid for cloudformation:

  Serverless Error ---------------------------------------
 
     An error occurred while provisioning your stack: ESDomain
     - Value of property AdvancedOptions must be an object
     with String (or simple type) properties.

The cloudFormation definition should provide the following options:

   "AdvancedOptions": {
          "rest.action.multi.allow_explicit_index": "true",
          "indices.fielddata.cache.size": ""
}

Here are the AWS::Elasticsearch::Domain defintions

resources:
  Resources:
    ESDomain:
      Type: AWS::Elasticsearch::Domain
      Properties:
        AccessPolicies: 'xxx'
        DomainName: xxxx
        ElasticsearchVersion: "5.1"
        ElasticsearchClusterConfig:
          InstanceType: t2.medium.elasticsearch
          InstanceCount: 1
        EBSOptions:
          EBSEnabled: true
          VolumeType: standard
          VolumeSize: 10
        AdvancedOptions:
          rest.action.multi.allow_explicit_index: "true"
          indices.fielddata.cache.size: ""

Here is the cloudformation-template-update-stack.json (ES.Domain AdvancedOptions part) which is invalid for cloud-formation.

        "AdvancedOptions": {
          "rest.action.multi.allow_explicit_index": "true",
          "indices.fielddata.cache.size": "",
          "rest": {
            "action": {
              "multi": {
                "allow_explicit_index": "true"
              }
            }
          },
          "indices": {
            "fielddata": {
              "cache": {
                "size": ""
              }
            }
          }
        }

Additional Data

  • Serverless Framework Version: 1.13.x

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:15 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
HyperBraincommented, May 12, 2017

Also blocks us from upgrading to 1.13. The quoted YAML identifiers must not be parsed into objects.

3reactions
HyperBraincommented, May 12, 2017

@alex20465 @pmuens There is a difference in YAML between double and single quotes. Double quotes need escaping in the quoted text, while single quotes do not.

Could you try to put the dotted keys into single quotes like this? 'rest.action.multi.allow_explicit_index': 'true'

BTW: I wonder why you also quoted the boolean value - does it have to be a string?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to nest objects and arrays in a YAML file? - Stack Overflow
I currently have this JS array that I want to turn into a YAML file. I tried looking things up and ...
Read more >
YAML Tutorial: Everything You Need to Get Started in Minutes
YAML's simple nesting gives us the power to build sophisticated objects. But that's only the beginning.
Read more >
TypeDefinition for a nested collection, and how to ignore most ...
Given a document containing just the "developers" entry, I can write a constructor that parses it into objects of appropriate types. If composer...
Read more >
YAML Ain't Markup Language (YAML™) revision 1.2.2
Therefore, this specification defines two concepts: a class of data objects called YAML representations and a syntax for presenting YAML ...
Read more >
Tips, Tricks, Troubleshooting - yq - GitBook
Create bash array. Given a yaml file like. coolActions: - create ... There are a couple of tricks to getting the right string...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found