According to the documentation for AWS::Serverless::Function
in the Serverless Application Model, it is possible to specify a list of IAM Policy Document Objects (PDO) for the Policies
property of a Resource.
However, the AWS Toolkit for Visual Studio is flagging a syntax error when I try to define an IAM PDO:
Here is a full example of my Resources
section:
"Resources": {
"Example" : {
"Type" : "AWS::Serverless::Function",
"Properties": {
"Handler": "Example::Example.Controllers.ExampleController::ExampleAction",
"Runtime": "dotnetcore2.0",
"CodeUri": "",
"MemorySize": 256,
"Timeout": 30,
"Policies": [{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "*",
"Resource": "*"
}
}],
"Events": {
"PutResource": {
"Type": "Api",
"Properties": {
"Path": "/{id}",
"Method": "GET"
}
}
}
}
}
}
Is there something I'm getting wrong, or is there an issue with either SAM or the AWS Toolkit syntax validation?