Error “You must specify a region” when running any aws CLI command

In AWS most of the services are either regional or global. If you try to access a regional service like VPC or EC2 and your AWS CLI config file doesn’t have region information and you did not provide the region information during run time as well then you get this error message. The mitigation is very simple and you have two options as listed below –

Option 1: Set the default region details in your AWS CLI config file

Option 2: Provide the region details during runtime using –region global AWS CLI parameter

You can use the below links to install and configure AWS CLI
https://cloudaffaire.com/how-to-install-aws-cli/
https://cloudaffaire.com/how-to-configure-aws-cli/