EC2实例连接 - IAM策略:畸形的PolicyDocument:策略中的语法错误
在创建我的IAM策略时,我正在遇到“畸形的pocydocument”错误。这是用于配置EC2实例连接。
{
"Version": "2022-6-26",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2-instance-connect:SendSSHPublicKey",
"Resource": "arn:aws:ec2:us-east-1:123456789:instance/*",
"Condition": {
"StringEquals": {
"ec2:osuser": "ktian"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:DescribeInstances",
"Resource": "*"
}
]
}
这是我使用的创建策略命令:
aws iam create-policy --policy-name IAM-policy --policy-document file://iam-policy.json
据我所知,策略文件中的实际语法还可以,文件本身是否还有其他问题?
I'm running into the 'MalformedPolicyDocument' error while creating my IAM policy. This is for configuring ec2 instance connect.
{
"Version": "2022-6-26",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2-instance-connect:SendSSHPublicKey",
"Resource": "arn:aws:ec2:us-east-1:123456789:instance/*",
"Condition": {
"StringEquals": {
"ec2:osuser": "ktian"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:DescribeInstances",
"Resource": "*"
}
]
}
Here's the create policy command I used:
aws iam create-policy --policy-name IAM-policy --policy-document file://iam-policy.json
As far as I can see the actual syntax in the policy file is ok, is there some another issue in the file itself?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
版本
2022-6-26
是不正确。 最新版本17 。Version
2022-6-26
is incorrect. The latest version available is2012-10-17
.