I can’t find a valid way to restrict this permission. I would ideally like to restrict the permission to work in a particular VPC and/or subnet. I’m unsure where in the documentation to look & have tried numerous approaches with all failing.
My JSON is like this roughly & have tried lots of things in the resource and condition fields:
{
"Effect": "Allow",
"Action": [
"ec2:CreateNetworkInterface",
"ec2:DeleteNetworkInterface"
],
"Resource": [
"*"
],
"Condition": {
"StringLike": {
"ec2:XXXXX": "*"
}
}
}