-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add enable-regions command This enables all regions that are disabled. This is useful when you want to upload an AMI to all regions, but some regions are disabled. * Expose all pyproject scripts as apps * quota increase only when change detected
- Loading branch information
Showing
5 changed files
with
43 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import boto3 | ||
import logging | ||
|
||
|
||
def main(): | ||
""" | ||
Enable all regions that are disabled | ||
Due to rate limiting, you might need to run this multiple times. | ||
""" | ||
logging.basicConfig(level=logging.INFO) | ||
account = boto3.client("account") | ||
pages = account.get_paginator("list_regions").paginate( | ||
RegionOptStatusContains=["DISABLED"] | ||
) | ||
for page in pages: | ||
for region in page["Regions"]: | ||
logging.info(f"enabling region {region['RegionName']}") | ||
account.enable_region(RegionName=region["RegionName"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters