Skip to content
Cloud Governance Tools

Restrict EC2 launches to approved instance types

Restrict EC2 launches to approved instance types is an AWS guardrail written in service control policies. Denies ec2:RunInstances unless the instance type is in the approved list (t2.micro and t3.micro in the example). Copied from a licensed open source set and read on 10 Nov 2026.

More resource and cost guardrails ยท About Service control policies

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Deny",
      "Action": "ec2:RunInstances",
      "Resource": "arn:aws:ec2:*:*:instance/*",
      "Condition": {
        "StringNotEquals": {
          "ec2:InstanceType": [
            "t2.micro",
            "t3.micro"
          ]
        }
      }
    }
  ]
}
Blocks
Denies ec2:RunInstances unless the instance type is in the approved list (t2.micro and t3.micro in the example).
Breaks
Launches of any instance type not in the list fail for every principal in the affected accounts; the example list must be replaced with the types you approve. (source)
Test before applying
As for every Service control policies guardrail: how to test before enforcing
Mechanism
Service control policies (SCPs): IAM users, IAM roles and the root user in member accounts; not the management account and not service-linked roles.
Taken from
open source set, MIT-0 (README states MIT-0; LICENSE file fetched, MIT-0 text, Copyright Amazon.com, Inc.): https://raw.githubusercontent.com/aws-samples/service-control-policy-examples/main/LICENSE

What the policy text names

It names 1 action or pattern: ec2:RunInstances. Its conditions test ec2:InstanceType.

What the source says

ec2:InstanceType (read 10 Nov 2026).

On what it breaks: "Restrict users and roles from launching EC2 instances unless they use only approved instance types."

Sources

  1. Restrict EC2 launches to approved instance types, read 10 Nov 2026
  2. What it breaks, read 10 Nov 2026
  3. How to test it first, read 10 Nov 2026

Last reviewed 16 Nov 2026.