根据无服务器应用程序模型中的文档,可以为资源的属性AWS::Serverless::Function
指定 IAM 策略文档对象 (PDO) 列表。Policies
但是,当我尝试定义 IAM PDO 时,AWS Toolkit for Visual Studio 会标记语法错误:
这是我的Resources
部分的完整示例:
"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"
}
}
}
}
}
}
我有什么问题吗,还是 SAM 或 AWS Toolkit 语法验证有问题?