I am trying to limit ssh access to ec2 instances by using a resource tag condition in my instance connect policy. So basically I have something like that:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2-instance-connect:SendSSHPublicKey",
"Resource": "arn:aws:ec2:*:*:instance/*",,
"Condition": {
"StringEquals": {"ec2:ResourceTag/Squad": "blah"}
}
},
{
"Effect": "Allow",
"Action": "ec2:DescribeInstances",
"Resource": "*"
}
]
}
However, that seems it doesn't work. Isn't instance connect able to use the ec2:ResourceTag
condition? I have seen it working with a condition like ec2:osuser
, so I am wondering if there is a limitation or I'm doing something wrong.