我正在尝试使用现有的maneged政策创建IAM角色:
"SomeRole":
{
"Type": "AWS::IAM::Role",
"Properties":
{
"AssumeRolePolicyDocument": {},
"ManagedPolicyArns":
[
"arn:aws:iam::aws:policy/AmazonKinesisReadOnlyAccess",
"arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess",
"arn:aws:iam::aws:policy/CloudWatchFullAccess"
],
"RoleName": "SomeRole"
}
},
但它失败了,错误:位置(1,3)的语法错误
答案 0 :(得分:14)
看起来你必须在AssumeRolePolicyDocument
中有一些价值。
试试这个。
{
"Resources": {
"NewRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": [
"ec2.amazonaws.com"
]
},
"Action": [
"sts:AssumeRole"
]
}
]
},
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/AmazonKinesisReadOnlyAccess",
"arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess",
"arn:aws:iam::aws:policy/CloudWatchFullAccess"
]
}
}
}
}