# Restrict EC2 launches to approved instance types

Facts read 10 Nov 2026. Page reviewed 16 Nov 2026.

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.

```json
{
  "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](https://raw.githubusercontent.com/aws-samples/service-control-policy-examples/main/Service-specific-controls/README.md))
- **Test before applying:** As for every Service control policies guardrail: [how to test before enforcing](/mechanisms/scp/)
- **Mechanism:** [Service control policies (SCPs)](/mechanisms/scp/): 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](https://raw.githubusercontent.com/aws-samples/service-control-policy-examples/main/Service-specific-controls/Amazon-EC2/Require-Amazon-EC2-instances-to-use-a-specific-type.json), 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."

## Related guardrails

- [Allowed resource types](/guardrails/azure-policy-allowed-resource-types/): Azure, Azure Policy (built-in definitions), resource and cost
- [Not allowed resource types](/guardrails/azure-policy-not-allowed-resource-types/): Azure, Azure Policy (built-in definitions), resource and cost
- [Allowed virtual machine size SKUs](/guardrails/azure-policy-allowed-vm-sizes/): Azure, Azure Policy (built-in definitions), resource and cost
- [Restrict AWS Marketplace subscription changes](/guardrails/aws-scp-restrict-marketplace-subscriptions/): AWS, Service control policies (SCPs), resource and cost

## Related pages

- [Restrict AWS Marketplace subscription changes (AWS Service control policies)](/guardrails/aws-scp-restrict-marketplace-subscriptions/)
- [Deny disabling block public access for AMIs (AWS Service control policies)](/guardrails/aws-scp-deny-disable-ami-block-public-access/)
- [Deny AWS RAM sharing with external accounts (AWS Service control policies)](/guardrails/aws-scp-deny-ram-external-sharing/)

## Sources

- Restrict EC2 launches to approved instance types: https://raw.githubusercontent.com/aws-samples/service-control-policy-examples/main/Service-specific-controls/Amazon-EC2/Require-Amazon-EC2-instances-to-use-a-specific-type.json (read 10 Nov 2026)
- What it breaks: https://raw.githubusercontent.com/aws-samples/service-control-policy-examples/main/Service-specific-controls/README.md (read 10 Nov 2026)
- How to test it first: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_testing-policies.html (read 10 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://cloudgovernancetools.com/guardrails/aws-scp-restrict-ec2-instance-types/
