How to List All Available Regions in OCI CLI

When you use Terraform, you are going to want to know the name of the region to use. I’ll show you in a easy-to-see way.

oci iam region list \
--query "data[*]".{'key:key,name:name'} --output table

The command above shows the following output.

+-----+----------------+
| key | name           |
+-----+----------------+
| AMS | eu-amsterdam-1 |
| BOM | ap-mumbai-1    |
| DXB | me-dubai-1     |
| FRA | eu-frankfurt-1 |
| GRU | sa-saopaulo-1  |
| HYD | ap-hyderabad-1 |
| IAD | us-ashburn-1   |
| ICN | ap-seoul-1     |
| JED | me-jeddah-1    |
| KIX | ap-osaka-1     |
| LHR | uk-london-1    |
| MEL | ap-melbourne-1 |
| NRT | ap-tokyo-1     |
| PHX | us-phoenix-1   |
| SJC | us-sanjose-1   |
| SYD | ap-sydney-1    |
| YNY | ap-chuncheon-1 |
| YUL | ca-montreal-1  |
| YYZ | ca-toronto-1   |
| ZRH | eu-zurich-1    |
+-----+----------------+

It is possible to view available regions from the web console though it’s paged. Click the region -> Manage Regions to view.

It is wise to subscribe to only the regions you are going to use. Subscribing to regions do not cost at all, however.

What I Wish I Had Known about Terraform When I Started

I feel extremely lucky that I am working for the company that I am working for. It’s a job and there are things I don’t like but I am doing what I have wanted to do. I think Terraform is an important technology to manage cloud resources, so I am listing the things I wish I had known

  1. Terraform is a compiled go-lang executable.
  2. Terraform communicates with Terraform state file. It reads from and writes to the state file.
  3. Terraform communicates with cloud through provider.
  4. Terraform state file can be stored locally or on Object Storage.
  5. Terraform can import existing cloud resources to the state file.

The list can go on. I will add more when they pop in my mind.