-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Feature or Bugfix - V1.5.0 Features. Check each PR for a complete description of the feature. ### Detail - #292 - #355 - #337 - #427 - #431 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: kukushking <[email protected]> Co-authored-by: Dariusz Osiennik <[email protected]> Co-authored-by: Noah Paige <[email protected]> Co-authored-by: Dennis Goldner <[email protected]>
- Loading branch information
1 parent
6460986
commit 219553f
Showing
73 changed files
with
2,834 additions
and
1,939 deletions.
There are no files selected for viewing
Binary file not shown.
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,26 @@ | ||
import logging | ||
|
||
from .sts import SessionHelper | ||
|
||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
class EC2: | ||
@staticmethod | ||
def client(account_id: str, region: str, role=None): | ||
session = SessionHelper.remote_session(accountid=account_id, role=role) | ||
return session.client('ec2', region_name=region) | ||
|
||
@staticmethod | ||
def check_default_vpc_exists(AwsAccountId: str, region: str, role=None): | ||
log.info("Check that default VPC exists..") | ||
client = EC2.client(account_id=AwsAccountId, region=region, role=role) | ||
response = client.describe_vpcs( | ||
Filters=[{'Name': 'isDefault', 'Values': ['true']}] | ||
) | ||
vpcs = response['Vpcs'] | ||
log.info(f"Default VPCs response: {vpcs}") | ||
if vpcs: | ||
return True | ||
return False |
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
Oops, something went wrong.