-
-
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 mypy and black * stubs * Type upload-ami * Fix all type errors * Check mypy and black * Fix
- Loading branch information
Showing
10 changed files
with
223 additions
and
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
use flake .#upload-ami |
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
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 |
---|---|---|
@@ -1,19 +1,21 @@ | ||
import boto3 | ||
from mypy_boto3_account import AccountClient | ||
import logging | ||
|
||
|
||
def main(): | ||
def main() -> None: | ||
""" | ||
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") | ||
account: AccountClient = boto3.client("account") | ||
pages = account.get_paginator("list_regions").paginate( | ||
RegionOptStatusContains=["DISABLED"] | ||
) | ||
for page in pages: | ||
for region in page["Regions"]: | ||
assert "RegionName" in region | ||
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
49 changes: 35 additions & 14 deletions
49
upload-ami/src/upload_ami/request_public_ami_quota_increase.py
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
Oops, something went wrong.