The goal is to restrict future EC2 instances to only types with nitro as the hypervisor (i.e. run_instances, modify_instance_attributes). Ideally at the Service Control Policy (SCP) level in AWS Organizations.
I have written a script to gather a list of all nitro instance types and presently that is 225 instance types or 31 generations (e.g. i3en, m5n, c5d, etc). That's not exactly elegant.
What I have imagined in my head is something like:
"Condition": {
"StringEquals": {
"ec2:InstanceType/Hypervisor": "nitro"
}
}
But the only thing I know to work looks akin to the following (with all 2
"Condition": {
"StringEquals": {
"ec2:InstanceType": ["t2.micro", "t2.small"]
}
}
Regardless whether there is a good solution, thanks for taking the time to read this. Cheers.