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

resolveTemplate transforms arrays into objects #1

Open
bboure opened this issue Jul 9, 2019 · 0 comments
Open

resolveTemplate transforms arrays into objects #1

bboure opened this issue Jul 9, 2019 · 0 comments

Comments

@bboure
Copy link

bboure commented Jul 9, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant