New-EC2Tag を実行しようとすると、次のエラーが発生します。
New-EC2Tag : You are not authorized to perform this operation.
ユーザー ポリシーは次のとおりです。
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["ec2:DescribeInstances","ec2:CreateTags"],
"Resource": "arn:aws:ec2:ap-southeast-2:<my_account_id>:instance/*",
"Condition": {
"StringEquals": {
"ec2:ResourceTag/OctopusTentacle": "yes"
}
}
}
]
}
上記のように、Policy Simulator で問題なく動作します。
条件を削除して Resource を * に設定すると、機能します。条件を削除したり、リソースを * に設定したりするだけでは機能しません。これをインスタンスのローカル管理者として実行しています。
アクセスを許可する必要がある New-EC2Tag のアクセス/実行は他に何ですか?