Skip to content

Commit

Permalink
Update to limit the script to only run in regions EC2-Classic is supp…
Browse files Browse the repository at this point in the history
…orted in
  • Loading branch information
TheScottMo committed Aug 11, 2021
1 parent 677c05f commit ea774c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Classic-Resource-Finder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ if [[ ! $cuttest == "success" ]] ## If the test did not result in the output of
fi

## Search for EC2-Classic Resources
for region in `aws ec2 describe-regions --output json --region us-east-1 | jq -r '.Regions[] .RegionName'` ## Use the EC2 CLI to get all regions and loop through them
declare -a regions=('us-east-1' 'eu-west-1' 'us-west-1' 'ap-southeast-1' 'ap-northeast-1' 'us-west-2' 'sa-east-1' 'ap-southeast-2') ## Define regions that support EC2-Classic
for region in "${regions[@]}" ## Loop through the regions that support EC2-Classic
do
printf "# -------------------------------------------------------------------------\nSearching for resources in EC2-Classic in $region\n# -------------------------------------------------------------------------\n\n"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

We launched Amazon VPC on 5-Sep-2009 as an enhancement over EC2-Classic and while we maintained EC2-Classic in its current state for our existing customers, we continuously made improvements, added cutting edge instances, and networking features on Amazon VPC. In the spirit of offering the best customer experience, we firmly believe that all our customers should migrate their resources from EC2-Classic to Amazon VPC. To help determine what resources may be running in EC2-Classic, this script will help identify resources running in EC2-Classic in an ad-hoc, self-service manner. For more information on migrating to VPC, visit our [docs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html).

This script helps identify all resources provisioned in EC2-Classic across all regions in an account as well as each region's enablement status for EC2-Classic. Depending on the number of resources you are running, and the number of regions you are in, this script may take longer to run in order to describe and evaluate all resources. If no resources were found, all CSVs will be empty except Classic_Platform_Status.csv which will show the current status in each region. Also, make sure to check the errors.txt for any errors that occurred during running the script. It is normal to see some errors related to `Could not connect to the endpoint URL` for DataPipeline and OpsWorks in some regions those services are not available in. Additionally, you may see `An error occurred (UnsupportedOperation) when calling the DescribeVpcClassicLink operation: The functionality you requested is not available in this region.` this is normal as well in certain regions. Other errors should be investigated to confirm any missing data.
This script helps identify all resources provisioned in EC2-Classic across all regions which support EC2-Classic in an account, as well as each of those regions' enablement status for EC2-Classic. Depending on the number of resources you are running, and the number of regions you are in, this script may take longer to run in order to describe and evaluate all resources. If no resources were found, all CSVs will be empty except Classic_Platform_Status.csv which will show the current status in each region. Also, make sure to check the errors.txt for any errors that occurred during running the script. It is normal to see some errors related to `Could not connect to the endpoint URL` for DataPipeline in some regions in which the service is not available in. Other errors should be investigated to confirm any missing data.



Expand Down

0 comments on commit ea774c5

Please sign in to comment.