How to allow a role to attach role to an instance?

0

How do I allow a role to attach role to an EC2 instance without having Administrator Access?? Below is my IAM policy. Something appears to be missing.

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"iam:List*",
"iam:Get*",
"iam:CreateRole",
"iam:CreatePolicy",
"iam:PutRolepolicy",
"iam:CreateServiceLinkedRole",
"iam:AttachRolePolicy",
"iam:CreateInstanceProfile",
"iam:AddRoleToInstanceProfile",
"iam:PassRole",
"sts:AssumeRole"
],
"Resource": [
"arn:aws:iam:::role/service-role/",
"arn:aws:iam:::policy/service-role/"
]
}
]
}

preguntada hace 3 años412 visualizaciones
1 Respuesta
0

I figured it out. The ARNs were not being called out correctly:

"arn:aws:iam:::role/NameOfRole",
"arn:aws:iam:::policy/NameOfPolicy"

respondido hace 3 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas