1 Answers
0
Hi
I think you can add another permission on the policy to recheck if the issue persists again.
{
"Sid": "IAM1",
"Effect": "Allow",
"Action": [ "iam:PassRole","iam:GetRole" ],
"Resource": [ "arn:aws:iam:::role/Pentest-EC2-Role" ],
"Condition": { "StringEquals": { "iam:PassedToService": "ec2.amazonaws.com" },
"StringLike": { "iam:AssociatedResourceARN": [ "arn:aws:ec2:us-west-2::instance/" ] } }
}
Check the EC2 trusted policy is there and its correct.
Test the Policies: You can use AWS IAM simulator to check if the policy permissions are okay https://policysim.aws.amazon.com/home/index.jsp?#
answered a month ago
Relevant questions
I need to attach IAM role to my EC2 instance.
asked a month agoMy IAM role is not listed when trying to create a new EC2 instance
asked 7 months agoDynamically assign an IAM Role between an IAM user and and EC2 instance
asked 5 months agoShould I create IAM role to allow AWS service send events to my default bus
asked 2 years agoChanging IAM Role on EC2 instance: Internal Error
asked 2 years agoDid not have IAM permissions to process tags on AWS::EC2::Instance resource
asked a year agoCreate an IAM role to read from Secrets Manager
asked 2 years agodetails of IAM role which is attached to ec2 instances with cloudshell
Accepted Answerasked 5 months agoHow to allow a role to attach role to an instance?
asked 2 years agoLimit which IAM roles can be attached to an EC2 instance by different IAM users
asked 8 months ago
Thanks you! I need to take away the condition from policy! And works)