|
26 | 26 | from mypy_boto3_s3 import S3Client
|
27 | 27 | from mypy_boto3_shield import ShieldClient
|
28 | 28 | from mypy_boto3_shield.type_defs import (
|
29 |
| - AssociateProactiveEngagementDetailsRequestRequestTypeDef, |
30 | 29 | CreateProtectionResponseTypeDef,
|
31 | 30 | DescribeEmergencyContactSettingsResponseTypeDef,
|
32 | 31 | DescribeProtectionResponseTypeDef,
|
33 | 32 | DescribeSubscriptionResponseTypeDef,
|
34 |
| - DisableApplicationLayerAutomaticResponseRequestRequestTypeDef, |
35 | 33 | EmergencyContactTypeDef,
|
36 | 34 | ProtectionTypeDef,
|
37 | 35 | )
|
@@ -340,7 +338,7 @@ def delete_drt_role(account_session: boto3.Session, role_name: str) -> None:
|
340 | 338 | LOGGER.info(api_call_details)
|
341 | 339 | except iam_client.exceptions.NoSuchEntityException as nse:
|
342 | 340 | LOGGER.info(f"NoSuchEntityException {nse}")
|
343 |
| - LOGGER.info(f"Continuing...") |
| 341 | + LOGGER.info("Continuing...") |
344 | 342 |
|
345 | 343 |
|
346 | 344 | def check_if_role_exists(iam_client: IAMClient, role_name: str) -> str:
|
@@ -523,8 +521,10 @@ def check_proactive_engagement_enabled(shield_client: ShieldClient, params: dict
|
523 | 521 | elif proactive_engagement_status == "PENDING":
|
524 | 522 | time.sleep(5)
|
525 | 523 | check_proactive_engagement_enabled(shield_client, params, retry + 1)
|
| 524 | + return False |
526 | 525 | else:
|
527 | 526 | return False
|
| 527 | + return False |
528 | 528 |
|
529 | 529 |
|
530 | 530 | def check_if_protection_group_exists(shield_client: ShieldClient, protection_group_id: str) -> bool:
|
@@ -590,7 +590,7 @@ def update_protection_group(
|
590 | 590 | "APPLICATION_LOAD_BALANCER",
|
591 | 591 | "GLOBAL_ACCELERATOR",
|
592 | 592 | ],
|
593 |
| - pg_members: list[str], |
| 593 | + pg_members: str, |
594 | 594 | ) -> None:
|
595 | 595 | """Updates an existing protection group
|
596 | 596 |
|
@@ -637,7 +637,7 @@ def create_protection_group(shield_client: ShieldClient, params: dict, account_i
|
637 | 637 | "APPLICATION_LOAD_BALANCER",
|
638 | 638 | "GLOBAL_ACCELERATOR",
|
639 | 639 | ] = params[f"PROTECTION_GROUP_{i}_RESOURCE_TYPE"]
|
640 |
| - pg_members: list = params[f"PROTECTION_GROUP_{i}_MEMBERS"] |
| 640 | + pg_members: str = params[f"PROTECTION_GROUP_{i}_MEMBERS"] |
641 | 641 | if pg_id != "" and pg_account_id == account_id:
|
642 | 642 | if check_if_protection_group_exists(shield_client, pg_id):
|
643 | 643 | LOGGER.info(f"Protection_Group_{i} already exists in {account_id}")
|
@@ -728,9 +728,7 @@ def disable_proactive_engagement(shield_client: ShieldClient) -> None:
|
728 | 728 | shield_client: shield client
|
729 | 729 | """
|
730 | 730 | try:
|
731 |
| - disable_proactive_engagement_response: DisableApplicationLayerAutomaticResponseRequestRequestTypeDef = ( |
732 |
| - shield_client.disable_proactive_engagement() |
733 |
| - ) |
| 731 | + disable_proactive_engagement_response = shield_client.disable_proactive_engagement() |
734 | 732 | api_call_details = {"API_Call": "shield:DisableProactiveEngagement", "API_Response": disable_proactive_engagement_response}
|
735 | 733 | LOGGER.info(api_call_details)
|
736 | 734 | except ClientError as e:
|
|
0 commit comments