I have a role ssm-role
for EC2. I want another IAM user to launch EC2 instance with ssm-role
attached.
Policy attached with ssm-role
: AmazonEC2RoleforSSM
Trust relationship for ssm-role
:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com",
"AWS": "arn:aws:iam::<ACC_ID>:user/test-user"
},
"Action": "sts:AssumeRole"
}
]
}
I have added the following inline policy for the user who wants to assume ssm-role
:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "test",
"Effect": "Allow",
"Action": [
"sts:AssumeRole"
],
"Resource": "arn:aws:iam::<ACC_ID>:role/ssm-role"
}
]
}
Despite these, test-user
is not able to launch EC2 with ssm-role
attached.
Any help will be greatly appreciated.
Note: test-user has EC2FullAccess