serverless-iam-roles-per-function
serverless-iam-roles-per-function copied to clipboard
No role creating when using referenced json
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 :)