I need to restrict a specific user role from performing any EC2 instance actions in public subnets across any VPC. Is there a way to achieve this by leveraging subnet tags? I know how to use EC2 Resource Tags to control access to EC2 resources like in the code snippet below but in my case I need to base it off vpc or subnet tags. Is there something like a vpc:ResourceTag condition I could leverage?
{
"Effect" : "Allow",
"Action" : "ec2:*",
"Resource" : "*",
"Condition" : {
"StringEquals" : {
"ec2:ResourceTag/UserName" : "${aws:username}"
}