Sub topic 7
Opt-in Regions and how to enable them
This chapter assumes you can run AWS CLI commands, know what a Region is, and have an AWS account with credentials configured. It covers Regions that are disabled by default, how to see them, how to enable one, and the errors you will meet if you skip that step.
What an opt-in Region is
Most AWS Regions are enabled in every account from the start. Newer Regions are different. An opt-in Region is a Region that stays disabled in your account until you enable it. Regions created after March 20, 2019 are generally opt-in. Examples include af-south-1 (Cape Town), ap-east-1 (Hong Kong), me-south-1 (Bahrain), and eu-south-1 (Milan).
AWS makes these Regions opt-in so that you choose whether your account's data and API traffic can reach them. Until you enable a Region, your account has no resources there and cannot create any.
Enabling is per account and per Region. If you use AWS Organizations, each member account needs its own enablement, though an administrator can do it from the management account.
Finding out which Regions are enabled
Without extra flags, describe-regions returns only the Regions enabled for your account.
aws ec2 describe-regions --query "Regions[].RegionName" --output textTo see the opt-in Regions you have not enabled, include all Regions and filter on OptInStatus.
aws ec2 describe-regions --all-regions \
--query "Regions[?OptInStatus=='not-opted-in'].RegionName" \
--output textOptInStatus has three values:
| Value | Meaning |
|---|---|
| `opt-in-not-required` | A default Region, always enabled |
| `opted-in` | An opt-in Region you have enabled |
| `not-opted-in` | An opt-in Region that is still disabled |
Enabling a Region
You can enable a Region in the console under Account settings, in the AWS Regions section. You can also use the CLI with the account service.
aws account enable-region --region-name af-south-1
aws account get-region-opt-status --region-name af-south-1The status moves through these states:
Enabling can take several minutes, sometimes longer. Wait until get-region-opt-status reports ENABLED before you create resources. Disabling a Region is also possible, but AWS removes access to it, so empty it of resources first.
The caller needs permission for account:EnableRegion, account:GetRegionOptStatus, and account:ListRegions. The root user can always do this. An IAM user or role needs these permissions explicitly.
Common errors
AuthFailureor "not authorized" on a new Region. The Region is probably stillnot-opted-inorENABLING. Check its status first.- Region missing from
describe-regions. Without--all-regions, disabled Regions are hidden by design. - Region absent from the console selector. Disabled Regions do not appear until you enable them.
- Regional endpoints for IAM-related calls. Credentials from the global AWS STS endpoint are valid only in default Regions. Opt-in Regions require tokens from a Regional STS endpoint, so set the Region in your tools rather than relying on the global endpoint.
Cost and the Free Tier
Enabling a Region costs nothing by itself. Charges come from resources you create there. Prices differ between Regions, and Free Tier allowances count your usage across Regions, so a forgotten instance in a rarely used Region still uses your allowance. Disable or clean up Regions you no longer need.
Exercise
A teammate runs aws ec2 describe-regions and does not see ap-east-1, but the Region is listed in AWS documentation. Which command shows its status, and what value would explain the missing entry?
Show answer
Run aws ec2 describe-regions --all-regions --query "Regions[?RegionName=='ap-east-1']". An OptInStatus of not-opted-in explains it, because the default call lists only Regions enabled for the account. Enable it with aws account enable-region --region-name ap-east-1 and wait for ENABLED.
Exercise
You enabled an opt-in Region ten seconds ago and create-vpc fails with an authorization error. What do you check, and why?
Show answer
Check aws account get-region-opt-status --region-name <region>. Enabling is asynchronous, so the status is probably still ENABLING. Retry once it shows ENABLED.