Я пытаюсь использовать другого пользователя вместе с настраиваемой политикой для выполнения моей команды плана Terraform, но я не могу выяснить, какое действие политики мне не хватает для запуска этой команды. Я не хочу разрешать ec2:*
.
Ресурсы уже запущены, мы просто пытаемся переместить код в другой проект.
Когда я запускаю план с разрешениями ec2:*
, он работает правильно.
Ошибка:
Error refreshing state: 2 error(s) occurred:
* module.mesos.aws_instance.master: 3 error(s) occurred:
* module.mesos.aws_instance.master[2]: aws_instance.master.2: UnauthorizedOperation: You are not authorized to perform this operation.
status code: 403, request id: 484574e1-0dd0-4c43-b829-42c034763bad
* module.mesos.aws_instance.master[1]: aws_instance.master.1: UnauthorizedOperation: You are not authorized to perform this operation.
status code: 403, request id: e0499d28-d55c-46e8-af1a-91262427b422
* module.mesos.aws_instance.master[0]: aws_instance.master.0: UnauthorizedOperation: You are not authorized to perform this operation.
status code: 403, request id: f1fb50ac-7bb5-47d6-b1b4-b24b38a61fdd
* module.mesos.data.aws_ami.agent: 1 error(s) occurred:
* module.mesos.data.aws_ami.agent: data.aws_ami.agent: UnauthorizedOperation: You are not authorized to perform this operation.
status code: 403, request id: a7dcf75b-30d1-4c74-8c30-a002644db313
Код:
{
"Sid": "gitec2",
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeVolumeStatus",
"ec2:StartInstances",
"ec2:DescribeVolumes",
"ec2:RunInstances",
"ec2:StopInstances",
"ec2:AssignPrivateIpAddresses",
"ec2:DescribeVolumeAttribute",
"ec2:DescribeSubnets",
"ec2:AttachVolume",
"ec2:DescribeRegions",
"ec2:DescribeVpcAttribute",
"ec2:DescribeAvailabilityZones",
"ec2:DescribeInstanceStatus",
"ec2:DescribeSecurityGroups",
"ec2:DescribeVpcs",
"ec2:DescribeNetworkAcls",
"ec2:DescribeRouteTables",
"ec2:DescribeLaunchTemplates",
"ec2:DescribeAddresses",
"ec2:DescribeInstanceAttributes",
"ec2:DescribeNetworkInterfaces",
"ec2:CreateSecurityGroup",
"ec2:TerminateInstances",
"ec2:DescribeIamInstanceProfileAssociations",
"ec2:DescribeTags",
"ec2:DescribeImageAttribute",
"ec2:DescribeSecurityGroupReferences",
"ec2:AssociateIamInstanceProfile",
"ec2:AttachInternetGateway",
"ec2:AttachNetworkGateway",
"ec2:AssociateIamInstanceProfile",
"ec2:DeleteSecurityGroup"
],
"Resource": "*"
}