I have organization root aws account named cloud. below is the policy attached to it.
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": [
"arn:aws:iam::XXXXXXXXX:role/Account-accessROle"
]
}
}
I have role Accountaccessrole created in child accounts. this role have trust relationship with organization account such that only cloud user can assume this role.
it's trust relationship:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::{ROOTACCOUNT}:user/cloud"
},
"Action": "sts:AssumeRole"
}
]
}
its attached policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "EC2:*",
"Resource": "*",
}
}
]
}
this is sorted. but the users from child account (XXXXX) can use this role in lambda to do something....I want to restrict it....no one from child account should do any thing with this role...how to restrict this??
tried adding the condition for policy in child account roles..but could not find any specific