Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.
This repository was archived by the owner on May 1, 2020. It is now read-only.

resolveTemplate transforms arrays into objects #1

@bboure

Description

@bboure

Hi,

I am trying to build my own component and after looking at some examples, I tried the "new way" of doing it (using @serverless/core and @serverless/cli). I understand this is still experimental (I can tell by the age of this repo), but I gave it a shot anyway.
In my progress I hit a first issue:

Here, my template which contains an array, gets transformed into an object.

...
accessPolicies:
      Version: "2012-10-17"
      Statement:
        - Effect: Allow
          Principal:
            AWS: "*"
          Action:
            - es:*
          Resource: "*"

becomes

...
{
    "accessPolicies": {
        "Version": "2012-10-17",
        "Statement": {
            "0": {
                "Effect": "Allow",
                "Principal": {
                    "AWS": "*"
                },
                "Action": {
                    "0": "es:*"
                },
                "Resource": "*"
            }
        }
    }
}

This causes the API call to AWS to fail because it is expecting an array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions