Sub topic 7
Opt-in Regions and how to enable them
This chapter explains why some AWS Regions are off by default, how to turn them on and off, and what breaks when you use one without preparing. It assumes you can run aws commands and that you know what a Region is and how global, regional, and zonal resources differ. You also need an AWS account and the AWS CLI. Some commands need permissions that an administrator or the root user holds.
Two kinds of Regions
AWS Regions fall into two groups.
- Default-enabled Regions are available in every account from the start. Examples are
us-east-1,us-west-2, andeu-west-1. - Opt-in Regions are disabled until you enable them for your account. AWS applies this to Regions launched after March 20, 2019. Examples include
af-south-1(Cape Town),ap-east-1(Hong Kong),eu-south-1(Milan), andme-south-1(Bahrain). Newer Regions generally follow the same rule.
AWS adds Regions over time, so do not rely on a memorized list. Ask your own account, as the next section shows.
The practical effect is that an opt-in Region does not exist for you until you enable it. The console hides it. The CLI and SDK reject calls to it with an authentication or endpoint error. IAM users and roles cannot reach it either, even with administrator permissions.
Seeing which Regions are enabled
The describe-regions command reports the Regions your account can currently use. By default it leaves out opt-in Regions you have not enabled.
aws ec2 describe-regions --query "Regions[].RegionName" --output textAdd --all-regions and filter on OptInStatus to see what is still switched off.
aws ec2 describe-regions --all-regions \
--query "Regions[?OptInStatus=='not-opted-in'].RegionName" \
--output textEach Region reports one of three OptInStatus values:
| OptInStatus | Meaning |
|---|---|
| `opt-in-not-required` | Default-enabled Region. Nothing to do. |
| `opted-in` | Opt-in Region that you have enabled. |
| `not-opted-in` | Opt-in Region that is still disabled. |
This EC2 view only says whether a Region is on or off. The Account Management API gives finer detail, including transitional states, and it is also the API you use to change the setting.
The lifecycle of an opt-in Region
Enabling a Region is not instant. AWS has to set up your account's data in the Region, including IAM entities such as users, roles, and policies. This usually takes a few minutes, and sometimes longer. During that time the Region is in a transitional state.
The statuses are ENABLED_BY_DEFAULT, ENABLED, ENABLING, DISABLING, and DISABLED. You can only request a change when the Region is in a stable state. If it is already ENABLING or DISABLING, a new request fails until the current one finishes.
Enabling a Region
You can enable a Region in the console or with the CLI.
In the console
- Sign in as the root user, or as an IAM principal with the permissions listed below.
- Open the account settings page, then find the AWS Regions section.
- Select the Region and choose Enable.
- Wait until the status changes from Enabling to Enabled.
With the CLI
The aws account commands manage the setting. Check a Region's status first.
aws account get-region-opt-status --region-name af-south-1The output has the form {"RegionName": "af-south-1", "RegionOptStatus": "DISABLED"}. Request the change.
aws account enable-region --region-name af-south-1The call returns right away with no output. It does not wait for completion, so poll the status until it reads ENABLED. To list Regions grouped by status, filter on the status values:
aws account list-regions \
--region-opt-status-contains ENABLED ENABLED_BY_DEFAULT \
--query "Regions[].RegionName" --output textWith boto3
The same operations are available in Python. This script requests the change and polls until it finishes.
import time
import boto3
REGION = "af-south-1"
account = boto3.client("account")
status = account.get_region_opt_status(RegionName=REGION)["RegionOptStatus"]
print(REGION, "starts as", status)
if status == "DISABLED":
account.enable_region(RegionName=REGION)
while True:
status = account.get_region_opt_status(RegionName=REGION)["RegionOptStatus"]
print(REGION, status)
if status in ("ENABLED", "ENABLED_BY_DEFAULT"):
break
time.sleep(30)
print("Ready to use", REGION)If the status is ENABLING when the script starts, it skips the request and just waits.
Required permissions
The root user can always change these settings. An IAM user or role needs explicit permission on the Account Management actions:
account:ListRegionsandaccount:GetRegionOptStatusto read status.account:EnableRegionto enable a Region.account:DisableRegionto disable a Region.
Grant EnableRegion and DisableRegion narrowly. A principal that can enable Regions can also enlarge your attack surface and your bill.
Managing Regions across an organization
If your accounts belong to an AWS Organization, the management account (or a delegated administrator) can change Region settings for member accounts. Enable trusted access for AWS Account Management in Organizations first. Then pass the target account ID:
aws account enable-region \
--region-name eu-south-1 \
--account-id 111122223333This lets you roll out a Region to many accounts with a script, instead of signing in to each one.
What happens after you enable a Region
Enabling does not create any resources, so it costs nothing by itself. You pay only for what you later launch there. Several things still behave differently in an opt-in Region.
Endpoints and credentials
Opt-in Regions only accept credentials from regional endpoints. The legacy global AWS STS endpoint (sts.amazonaws.com) issues session tokens that are valid only in default-enabled Regions, unless you change the account's global endpoint token version. If a call to an opt-in Region fails with an "invalid token" or "security token" error, the usual cause is a token minted by the global endpoint. Fix it by calling a regional STS endpoint.
aws configure set sts_regional_endpoints regionalRecent SDK and CLI versions already default to regional endpoints, so this problem mostly affects old tooling and long-lived scripts.
IAM is global, but it still has to replicate
IAM users, roles, and policies are global resources. For an opt-in Region, AWS replicates them when you enable it. A role you create after enabling reaches the Region as normal, so plan on a short delay between creating an IAM entity and using it there.
Service availability and quotas
An opt-in Region often launches with fewer services than an older Region. Check the service you need before you commit to it. Service quotas also start at defaults for the new Region, so a quota you raised in us-east-1 does not carry over.
Placement and AZ IDs
AZ names are mapped per account, and this holds in opt-in Regions too. Use describe-availability-zones to see the names and AZ IDs for the new Region.
aws ec2 describe-availability-zones --region af-south-1 \
--query "AvailabilityZones[].[ZoneName,ZoneId,State,ZoneType]" \
--output tableDisabling a Region
You can turn an opt-in Region back off.
aws account disable-region --region-name af-south-1Disabling has consequences, so read this list before you run it.
- Principals lose access to the Region, and the console hides it again.
- The disable process removes your IAM data from the Region. Re-enabling later starts that setup over.
- Delete your resources first. Disabling does not clean up what you built, and you should not assume billing for leftover resources stops. Run your cleanup routine (see the chapter on budgets, alerts, and cleanup) and confirm nothing is left before you disable.
- You cannot disable a default-enabled Region.
Using Regions as a guardrail
The opt-in model gives you a cheap control. A Region you never enable is a Region nobody can use, whether by mistake or after a credential leak. If your workloads live in two Regions, leave the opt-in Regions off.
For default-enabled Regions you cannot disable, add a service control policy (SCP) in Organizations. A common pattern denies actions when aws:RequestedRegion is outside an approved list. Exempt global services, such as IAM, from the deny. Otherwise you will block actions that are not tied to a Region.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| Region missing from the console list | Opt-in Region not enabled | Enable it, then wait for `ENABLED` |
| `AuthFailure` or "not authorized" from EC2 in a new Region | Region still `ENABLING`, or not enabled | Poll `get-region-opt-status` |
| "The security token included in the request is invalid" | Token from the global STS endpoint | Use regional STS endpoints |
| `enable-region` returns a conflict error | A change is already in progress | Wait until the status is stable, then retry |
| `AccessDenied` on `enable-region` | Missing `account:EnableRegion` | Add the permission, or use the root user |
| Quota error on first launch | New Region has default quotas | Request an increase in that Region |
Summary
- Regions launched after March 20, 2019 are disabled until you opt in.
- Check the state with
aws ec2 describe-regions --all-regionsoraws account get-region-opt-status. - Enabling is asynchronous. Poll until the status is
ENABLED. - Use regional STS endpoints, and check services and quotas in the new Region.
- Delete resources before you disable a Region.
Exercise
A teammate runs aws account enable-region --region-name me-south-1, sees no output, and immediately runs aws ec2 describe-instances --region me-south-1, which fails. What is the most likely reason, and what should they do next?
Show answer
The enable request returns immediately, but the Region stays in the ENABLING state while AWS sets up the account's data, including IAM entities. This can take minutes or longer. The teammate should run aws account get-region-opt-status --region-name me-south-1 repeatedly until it reports ENABLED, then retry. If the error still says the security token is invalid after that, they should check that they are using a regional STS endpoint.
Exercise
You want to know which opt-in Regions your account has not enabled, and you want to enable one for a member account (ID 111122223333) from the management account. Which two commands do you use?
Show answer
To list the disabled opt-in Regions: aws ec2 describe-regions --all-regions --query "Regions[?OptInStatus=='not-opted-in'].RegionName" --output text. To enable one for the member account: aws account enable-region --region-name <region> --account-id 111122223333. This also requires trusted access for AWS Account Management to be enabled in Organizations.