serverless-iam-roles-per-function icon indicating copy to clipboard operation
serverless-iam-roles-per-function copied to clipboard

No role creating when using referenced json

Open simon-dk opened this issue 5 years ago • 0 comments

In my serverless.yml file I have two imported functions:

functions:
   - ${file(./test.json)}
   - ${file(./test.yml)}

Both are identical (different function names) but the function referenced in test.json only gets the global iamRole, while the .yml creates a role as expected.

//// test.json

{
  "convert": {
    "handler": "test.handler",
    "iamRoleStatements:": [
      {
        "Effect": "Allow",
        "Action": ["s3:GetObject"],
        "Resource": [
          "arn:aws:s3:::${cf:S3Stack-${self:custom.stage}.bucket}/*"        ]
      }
    ]
  }
}

I can't find any logical explanation for this, but would like to hear if this is fixable - i am one of those people who prefer json over yml :)

simon-dk avatar Jun 16 '20 11:06 simon-dk